ROS2 Navigation course no longer works

Hello guys,

I run this lesson (ROS2 Navigation in 5 days) until Section 6. Then I worked on a rosject to complete the requested task.

I didn’t work on the course for about 10 days and now that I come back to Section 6 to complete it nothing is working.
First of all I tried to run some basic mapping functionality to get started but I couldn’t run it, I got these errors:

[INFO] [occupancy_grid_node-2]: process started with pid [5834]
[cartographer_node-1] /opt/ros/galactic/lib/cartographer_ros/cartographer_node: symbol lookup error: /opt/ros/galactic/lib/cartographer_ros/cartographer_node: undefined symbol: _ZN7tf2_ros6BufferC1ESt10shared_ptrIN6rclcpp5ClockEENSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEES1_INS2_4NodeEE
[ERROR] [cartographer_node-1]: process has died [pid 5832, exit code 127, cmd '/opt/ros/galactic/lib/cartographer_ros/cartographer_node -configuration_directory /home/user/ros2_ws/install/cartographer_slam/share/cartographer_slam/config -configuration_basename cartographer.lua --ros-args -r __node:=cartographer_node --params-file /tmp/launch_params_mb3x9u2g'].

I couldn’t even run the rviz2, the error with rviz2 was that it couldn’t find the package rviz_common “ros2 package ‘rviz_common’ not found”.

Then I went to Section 1 to see if there is any setup that needed to be done in the first place (which there were).
After running all the steps, on the last step where I run “ros2 launch nav2_course nav2_demo.launch.py nav2_demo.launch” it doesn’t work either, it gives these errors:

[lifecycle_manager-4] [INFO] [1674292855.302889876] [lifecycle_manager_localization]: Configuring amcl
[rviz2-1] [rospack] Error: package 'rviz_common' not found
[rviz2-1] [librospack]: error while executing command
[rviz2-1] [INFO] [1674292855.473521591] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-1] [INFO] [1674292855.473670030] [rviz2]: OpenGl version: 3.1 (GLSL 1.4)
[rviz2-1] [rospack] Error: package 'rviz_common' not found
[rviz2-1] [librospack]: error while executing command
[rviz2-1] [rospack] Error: package 'rviz_common' not found
[rviz2-1] [librospack]: error while executing command
[rviz2-1] [INFO] [1674292855.538105902] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-1] rviz2: malloc.c:2379: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
[ERROR] [rviz2-1]: process has died [pid 2088, exit code -6, cmd '/opt/ros/galactic/lib/rviz2/rviz2 -d /opt/ros/galactic/share/nav2_bringup/rviz/nav2_default_view.rviz --ros-args'].
[INFO] [lifecycle_manager-10]: sending signal 'SIGINT' to process[lifecycle_manager-10]
[INFO] [waypoint_follower-9]: sending signal 'SIGINT' to process[waypoint_follower-9]
[INFO] [lifecycle_manager-4]: sending signal 'SIGINT' to process[lifecycle_manager-4]
[INFO] [map_server-2]: sending signal 'SIGINT' to process[map_server-2]
[lifecycle_manager-10] [INFO] [1674292855.770951243] [rclcpp]: signal_handler(signal_value=2)
[lifecycle_manager-10] terminate called after throwing an instance of 'std::runtime_error'
[lifecycle_manager-10]   what():  controller_server/change_state service client: interrupted while waiting for service
[waypoint_follower-9] [INFO] [1674292855.776586549] [rclcpp]: signal_handler(signal_value=2)
[waypoint_follower-9] [INFO] [1674292855.778748838] [waypoint_follower]: Destroying
[lifecycle_manager-4] [INFO] [1674292855.779398505] [rclcpp]: signal_handler(signal_value=2)
[lifecycle_manager-4] terminate called after throwing an instance of 'std::runtime_error'
[lifecycle_manager-4]   what():  amcl/change_state service client: interrupted while waiting for service
[map_server-2] [INFO] [1674292855.784102541] [rclcpp]: signal_handler(signal_value=2)
[map_server-2] [INFO] [1674292855.789112550] [map_server]: Destroying
[ERROR] [lifecycle_manager-10]: process has died [pid 2106, exit code -6, cmd '/opt/ros/galactic/lib/nav2_lifecycle_manager/lifecycle_manager --ros-args -r __node:=lifecycle_manager_navigation --params-file /tmp/launch_params_7pdaq4c6 --params-file /tmp/launch_params__wfc50_c --params-file /tmp/launch_params_smxogy4q'].
[ERROR] [lifecycle_manager-4]: process has died [pid 2094, exit code -6, cmd '/opt/ros/galactic/lib/nav2_lifecycle_manager/lifecycle_manager --ros-args -r __node:=lifecycle_manager_localization --params-file /tmp/launch_params_ll93htej --params-file /tmp/launch_params_1sgzqmx_ --params-file /tmp/launch_params__y0qo_ng'].
[INFO] [waypoint_follower-9]: process has finished cleanly [pid 2104]
[INFO] [map_server-2]: process has finished cleanly [pid 2090]

I guess something is going wrong with my environment and I have no idea how this can be fixed…
Do you have any suggestions?

Thank you for in advance.

Maybe if there is a way to reset my ros2_ws and re-initialize it, it would work…

Hi @NoN33d ,

I had a similar issue with another ROS course, the solution was to rebuild and source.

Have you tried deleting your build, install and log folders and rebuilding again using:

cd ~/ros2_ws && colcon build && source install/setup.bash

Let me know if this worked for you. Also remember to source install/setup.bash on every terminal.

Regards,
Girish

I did try but it didn’t solve it.

Hi @NoN33d ,

I have another idea / method that you can try.

  1. Open the course.
  2. Once IDE loads, download the src folder into your computer [Right click `src` and Download].
  3. Now delete build, install and log folders, if they are present, else go to next step.
  4. Delete src folder [once you have downloaded it].
  5. Delete the ros2_ws folder after deleting src folder.
  6. Create the ros2 workspace again: cd ~ && mkdir -p ros2_ws/src
  7. Go inside ros2_ws and build: cd ~/ros2_ws && colcon build
  8. Once previous step is done, copy your folders from the src folder that you downloaded, back into the src folder in the IDE.
  9. Re-build: cd ~/ros2_ws && colcon build && source install/setup.bash
  10. Try launching any package using ros2 launch ... command.

Let me know if these steps worked for you.

Regards,
Girish

Hello @NoN33d,

Here are two additional steps that I recommend following prior to the steps indicated by @girishkumar.kannan.

1.- Go to a new WebShell.
2.- Source the ROS2 distribution that you want to use (Galactic) using this command:
source /opt/ros/galactic/setup.bash

3.- Follow the steps indicated by @girishkumar.kannan

Hope this helps,

Roberto

Hello @girishkumar.kannan , hello @rzegers and thank you for the support.

I tried both solutions but they didn’t work.

To make things easier what I am trying to do is to simply open the rviz2, but it doesn’t work… It keeps giving me the same errors.

I remove ros2_ws, create a new folder and build it like @girishkumar.kannan said, source etc and then run “rviz2”, then I get the same errors.

Any ideas?

Thank you!

Hi @NoN33d ,

I took a deeper look in to your error messages (that you posted above) again.
I see that you have 2 lifecycle manager nodes, which is fine.
*But*, I also see that one of the node names is assigned as lifecycle_manager-10.
This means that this lifecycle manager is 10th node in the node list.

This will not work since only upto 8 nodes can be managed in one lifecycle manager. [This is my observation. I may be wrong. But I guess this is the reason.]

I just realized that by “Section 6”, you meant “Chapter / Unit 6”. This chapter deals with Multi-robot Navigation.

Even I think I received similar errors when I ran that chapter. But I think I know a solution.

Have the multi robot (single) launch file setup this way:

  1. Make sure you have one map_server node
  2. Make one amcl node for robot tb3_0
  3. Make one amcl node for robot tb3_1
  4. Make one lifecycle_manager node for nodes map_server, tb3_0/amcl, tb3_1/amcl
  5. Make one planner node for robot tb3_0
  6. Make one planner node for robot tb3_1
  7. Repeat steps 5 and 6 for controller, recovery and bt_navigator for both robots.
  8. Make one lifecycle_manager node for nodes tb3_0/planner, tb3_1/planner, tb3_0/controller, tb3_1/controller, tb3_0/recoveries, tb3_1/recoveries, tb3_0/bt_navigator, tb3_1/bt_navigator

This way you have 3 nodes in localization lifecycle manager and 8 nodes in pathplanning lifecycle manager.

Important: Make sure you have used namespace in your launch file and physically pre-pended the namespaces in the yaml and xml files.

I have got this working with above steps.

Let me know if this fixes your problem. I will be happy to share my launch file with you in case you still cannot get this working.

Regards,
Girish