[Closed] ROSbot 2 PRO tutorials, mapping and navigation strange behavior

@JanBrzyk
So update, for good measure, I copied the map files to the rosbot to rosbot-navigation\maps and for good measure I changed the permissions to read write. The map now appears correctly in Rviz.

I’m not sure if the maps were supposed to be updated by the ./sync_with_rosbot.sh script, but it apparently did not sync those files for me, as I need to manually move them over.

@JanBrzyk
So the map server seems to only work when I use the fastrtps DDS, but the localization and navigation is even worse than when I had the mismatched linux build installed.

When sending to a destination through Rviz,

Here’s what I get on the Ros bot:
rosbot-navigation-navigation-1 | [controller_server-1] [WARN] [1679929393.775694445] [controller_server]: Control loop missed its desired rate of 10.0000Hz
rosbot-navigation-navigation-1 | [planner_server-3] [WARN] [1679929394.688046898] [planner_server]: GridBased: failed to create plan, no valid path found.
rosbot-navigation-navigation-1 | [planner_server-3] [WARN] [1679929394.737603846] [planner_server]: Planning algorithm GridBased failed to generate a valid path to (1.51, -0.74)
rosbot-navigation-navigation-1 | [planner_server-3] [WARN] [1679929394.745386008] [planner_server]: [compute_path_to_pose] [ActionServer] Aborting handle.
rosbot-navigation-navigation-1 | [planner_server-3] [INFO] [1679929394.783431969] [global_costmap.global_costmap]: Received request to clear entirely the global_costmap
rosbot-navigation-navigation-1 | [bt_navigator-5] [WARN] [1679929394.808392893] [bt_navigator_navigate_to_pose_rclcpp_node]: Timed out while waiting for action server to acknowledge goal request for compute_path_to_pose
rosbot-navigation-navigation-1 | [bt_navigator-5] [ERROR] [1679929394.822310443] [bt_navigator]: Goal failed
rosbot-navigation-navigation-1 | [bt_navigator-5] [WARN] [1679929394.822540305] [bt_navigator]: [navigate_to_pose] [ActionServer] Aborting handle.
rosbot-navigation-navigation-1 | [controller_server-1] [INFO] [1679929394.871092716] [controller_server]: Goal was canceled. Stopping the robot.
rosbot-navigation-navigation-1 | [controller_server-1] [WARN] [1679929394.871446741] [controller_server]: [follow_path] [ActionServer] Aborting handle.
rosbot-navigation-navigation-1 | [controller_server-1] [WARN] [1679929394.872956328] [controller_server]: [follow_path] [ActionServer] Client requested to cancel the goal. Cancelling.
rosbot-navigation-localization-1 | [amcl-2] [INFO] [1679929524.264178543] [amcl]: initialPoseReceived
rosbot-navigation-localization-1 | [amcl-2] [WARN] [1679929524.264609117] [amcl]: Failed to transform initial pose in time (Lookup would require extrapolation into the future. Requested time 1679929524.264468 but the latest data is at time 1679929524.251061, when looking up transform from frame [base_link] to frame [odom])
rosbot-navigation-localization-1 | [amcl-2] [INFO] [1679929524.264711617] [amcl]: Setting pose (1679929524.264711): 1.376 -0.687 0.082
rosbot-navigation-localization-1 | [amcl-2] [INFO] [1679929548.289742314] [amcl]: initialPoseReceived
rosbot-navigation-localization-1 | [amcl-2] [WARN] [1679929548.290151676] [amcl]: Failed to transform initial pose in time (Lookup would require extrapolation into the future. Requested time 1679929548.289973 but the latest data is at time 1679929548.251111, when looking up transform from frame [base_link] to frame [odom])
rosbot-navigation-localization-1 | [amcl-2] [INFO] [1679929548.290268076] [amcl]: Setting pose (1679929548.290267): 1.302 -0.661 -0.022
rosbot-navigation-navigation-1 | [bt_navigator-5] [INFO] [1679929600.909277756] [bt_navigator]: Begin navigating from current location to (2.11, -0.70)
rosbot-navigation-navigation-1 | [controller_server-1] [INFO] [1679929600.942609005] [controller_server]: Received a goal, begin computing control effort.
rosbot-navigation-navigation-1 | [controller_server-1] [WARN] [1679929601.849465495] [controller_server]: Control loop missed its desired rate of 10.0000Hz

Here’s what shows up on the PC:
rosbot-navigation-rviz-1 | [ERROR] [1679929690.615518202] [rviz2]: Lookup would require extrapolation into the future. Requested time 1679929690.820942 but the latest data is at time 1679929690.751123, when looking up transform from frame [laser] to frame [map]

When I send it on anything other than simply moving straight, it gets lost and spins randomly. The /scan topic in Rviz keeps dropping off, and when it comes back, the robot clearly has lost localization.

I’ll update with the messages I get when trying cyclonedds once I charge the batteries back up

@JanBrzyk
When switching the DDS to cycloneDDS,

The Rosbot shows this:

rosbot-navigation-navigation-1 | [planner_server-3] [WARN] [1679947872.611358957] [global_costmap.global_costmap]: Sensor origin at (0.02, 3.00) is out of map bounds (-2.30, -6.98) to (4.68, 1.80). The costmap cannot raytrace for it.
rosbot-navigation-navigation-1 | [planner_server-3] [WARN] [1679947873.611248519] [nav2_costmap_2d]: Robot is out of bounds of the costmap!
rosbot-navigation-navigation-1 | [planner_server-3] [WARN] [1679947873.611516531] [global_costmap.global_costmap]: Sensor origin at (0.02, 3.00) is out of map bounds (-2.30, -6.98) to (4.68, 1.80). The costmap cannot raytrace for it.
rosbot-navigation-navigation-1 | [planner_server-3] [WARN] [1679947874.610984131] [nav2_costmap_2d]: Robot is out of bounds of the costmap!

The PC shows this:
rosbot-navigation-rviz-1 | Warning: Invalid frame ID “map” passed to canTransform argument target_frame - frame does not exist
rosbot-navigation-rviz-1 | at line 93 in ./src/buffer_core.cpp
rosbot-navigation-rviz-1 | Warning: Invalid frame ID “map” passed to canTransform argument target_frame - frame does not exist

But there is NO map showing up in Rviz, even thought the rosbot is complaining about the bounds of a costmap

When I start a bash terminal in both the PC or the rosbot and I “ros2 topic echo /map” I get nothing

@JanBrzyk do you have any insight as to what may be wrong here? Why is the map not working in the latter setup. And why is the navigation still stuttery and failure print in the former. I feel like maybe the scan data is being delayed which is slowing down localization. If this is true, how do I clear it up. I have followed all of your directions, yet the robot is still not working properly.

Thanks

Hello @moyboyufl

I tried to reproduce your mistakes, but unfortunately without success.
I was able to run the rosbot-navigtation demo with the configuration below without any problems. Before we proceed further, I would like you to confirm that we use identical hardware and software tools.

  • ROSbot 2 PRO with LiDAR RPLIDAR A3 - demo rosbot-navigation run on the basis of previously created map copied to the appropriate folder /maps
  • connection between laptop and ROSbot in the same network via ssh
  • in the .env file, the DDS_CONFIG=DEFAULT variable set like this, because I connect in the same WiFi network
  • the second part of the .env file looks like below to use configuration with Cyclone DDS
# RMW_IMPLEMENTATION=rmw_fastrtps_cpp
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
# on ROSbot run "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" in the terminal (system env has precedence over .env file)
  • before starting, the appropriate firmware was uploaded to the ROSbot with the command:
docker stop rosbot microros || true && docker run \
--rm -it --privileged\
husarion/rosbot:humble-22-12-08 \
/flash-firmware.py /root/firmware.bin

If you encounter errors all the time, try to remove all Docker Images on your robot and computer before posting here. Their list is available after executing the docker images command. You can delete all of them with the command docker image prune -a -f or individually using their IDs, for example docker rmi 14bf2e210a80 14bf2e210a80 - this command will remove two docker images with the indicated IDs. Then, execution of the command from the docker compose family will start automatic downloading of all the Docker Images required in the given configuration listed in the appropriate .yaml file.
Finally, try running the entire demo again. Let me know about the results.

Best regards
Jan Brzyk

I’m closing this thread after >2 months of inactivity.