nav2 troubles all over the place!! Please help (if you can!) :-)
Hello,
I am trying to use nav2 on a real robot, which is running Foxy. The robot hardware and sensors and ROS2 controllers start and run with no problems 95% of the time.
However, nav2 starts and runs 5% of the time, so that I can run SLAM and navigate the robot and map the environment. The rest of 95%, some random thing prevents nav2 from running.
I have included my launch file at the end. But, I am describing the problems first. Here are the problems that randomly arise when I am trying to start nav2. Note that at each trial, the problem is different.
I have the following topics that are published correctly:
prompt$ ros2 topic list
/cmd_vel
/diagnostics
/diffbot_base_controller/cmd_vel_unstamped
/dynamic_joint_states
/forward_position_controller/commands
/imu
/joint_states
/joy
/joy/set_feedback
/left/camera_info
/left/image_rect
/motor_control
/motor_status
/odom
/odometry/filtered
/parameter_events
/right/camera_info
/right/image_rect
/robot_description
/rosout
/scan
/set_pose
/stereo/camera_info
/stereo/converted_depth
/stereo/depth
/stereo/points
/tf
/tf_static
Problem type 1: slam_toolbox cannot register the Lidar.
When I bringup nav2 using my launch file, here is what I get:
prompt$ ros2 launch robot_user_robot_nav nav2_bringup_tb3_revised_launch.py slam:=True
[INFO] [launch]: All log files can be found below /home/robot_user/.ros/log/2023-06-27-15-16-54-669455-robot_user-Xavier-19352
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [sync_slam_toolbox_node-1]: process started with pid [19354]
[INFO] [map_saver_server-2]: process started with pid [19356]
[INFO] [lifecycle_manager-3]: process started with pid [19358]
[INFO] [controller_server-4]: process started with pid [19360]
[INFO] [planner_server-5]: process started with pid [19362]
[INFO] [recoveries_server-6]: process started with pid [19364]
[INFO] [bt_navigator-7]: process started with pid [19366]
[INFO] [waypoint_follower-8]: process started with pid [19368]
[INFO] [lifecycle_manager-9]: process started with pid [19377]
[lifecycle_manager-3] [INFO] [1687897016.045531301] [lifecycle_manager_slam]: Creating
[lifecycle_manager-3] [INFO] [1687897016.079812558] [lifecycle_manager_slam]: Creating and initializing lifecycle service clients
[lifecycle_manager-3] [INFO] [1687897016.153660836] [lifecycle_manager_slam]: Starting managed nodes bringup...
[lifecycle_manager-3] [INFO] [1687897016.153758984] [lifecycle_manager_slam]: Configuring map_saver
[bt_navigator-7] [INFO] [1687897016.290348085] [bt_navigator]:
[bt_navigator-7] bt_navigator lifecycle node launched.
[bt_navigator-7] Waiting on external lifecycle transitions to activate
[bt_navigator-7] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[bt_navigator-7] [INFO] [1687897016.290661730] [bt_navigator]: Creating
[planner_server-5] [INFO] [1687897016.328064562] [planner_server]:
[planner_server-5] planner_server lifecycle node launched.
[planner_server-5] Waiting on external lifecycle transitions to activate
[planner_server-5] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[planner_server-5] [INFO] [1687897016.331484742] [planner_server]: Creating
[recoveries_server-6] [INFO] [1687897016.527387413] [recoveries_server]:
[recoveries_server-6] recoveries_server lifecycle node launched.
[recoveries_server-6] Waiting on external lifecycle transitions to activate
[recoveries_server-6] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[map_saver_server-2] [INFO] [1687897016.592736828] [map_saver]:
[map_saver_server-2] map_saver lifecycle node launched.
[map_saver_server-2] Waiting on external lifecycle transitions to activate
[map_saver_server-2] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[map_saver_server-2] [INFO] [1687897016.592960133] [map_saver]: Creating
[lifecycle_manager-9] [INFO] [1687897016.618960328] [lifecycle_manager_navigation]: Creating
[sync_slam_toolbox_node-1] [INFO] [1687897016.675506131] [slam_toolbox]: Node using stack size 160000000
[controller_server-4] [INFO] [1687897016.693737191] [controller_server]:
[controller_server-4] controller_server lifecycle node launched.
[controller_server-4] Waiting on external lifecycle transitions to activate
[controller_server-4] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[map_saver_server-2] [INFO] [1687897016.718958248] [map_saver]: Configuring
[controller_server-4] [INFO] [1687897016 ...
Just a quick comment: Foxy is EOL. Nav2 on Foxy does not see any updates, and is in fact already quite far behind Humble and Rolling. If you can, I would recommend upgrading. Don't do it in place (so don't remove your Foxy setup), but get a second SSD / SD card / something so you can install
22.04
and Humble on it. Or if you can / are comfortable with it: use Docker.If the same problems occur with newer versions, it would at least be possible to revert to your older system.
I will give that a try by using a second SSD card. I haven't used Docker before. Thanks.