Discussion - Nav2 Introduction (Making a Mobile Robot Pt 16)

Blog post coming soon

This is the discussion topic for the video and blog post linked above. Please keep all replies relevant to the content, otherwise create a new topic.


I’m having troubles making the robot turn when i send a goal in rviz, the robot do well going straight but he struggles when he turn, I tried tunning PID parameters and it goes better but not enough, I want to know if is there others parameters

Hey Marcelo, I’m sorry it took so long to reply. I don’t have a perfect answer but my thoughts are below and I hope they help :slight_smile:

My first suggestion would be to make sure you have a good understanding of how your robot responds to command velocities. E.g. if you send reasonable requests for forward and turn with the joystick (or manually publishing messages), can it achieve them ok? If not there are a few things to test and chase down there. Is that what you meant by the PID parameters?

To do that you should have a bit of a vibe for what you expect the robot/motors to be able to achieve.

Assuming the control side of things is ok, it then comes down to Nav2 which I have less experience in.
I’d recommend combing through the nav2_params.yaml (assuming you copied that the same as me) and looking for parameters that aren’t correct for your robot.

Particularly, I’d take a look at the controller_server section, then FollowPath under that, where you should see the following:

      min_vel_x: 0.0
      min_vel_y: 0.0
      max_vel_x: 0.26
      max_vel_y: 0.0
      max_vel_theta: 1.0
      min_speed_xy: 0.0
      max_speed_xy: 0.26
      min_speed_theta: 0.0
      # Add high threshold velocity for turtlebot 3 issue.
      # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75
      acc_lim_x: 2.5
      acc_lim_y: 0.0
      acc_lim_theta: 3.2
      decel_lim_x: -2.5
      decel_lim_y: 0.0
      decel_lim_theta: -3.2

If those values seem wrong to you, have a go at changing them!

P.S. I also shot you a message through Patreon so please check that out when you get a chance. I find the Patreon message system to be a bit clunky sometimes and it’s easy to miss messages.

Hi there, I’ve been having a mission of a time figuring out why I can’t seem to get any of the /map transforms published properly. I’m intermittently getting these errors breaking my system. I haven’t managed to find a predictable way to reproduce or prevent them.

During the frustration, I’ve virtually copied the master branch of the main articubot_one repo so everything is character by character, and I still get the same issue more often than not. The order I try to run things is as follows in their respective tabs:

  1. Rviz2
ros2 run rviz2 rviz2 -d src/romobot_one/config/view_bot.rviz
  1. Launch gazebo sim and rsp
ros2 launch romobot_one launch_sim.launch.py world:=./src/romobot_one/worlds/playground.world
  1. Nav2 map_server
ros2 run nav2_map_server map_server --ros-args -p yaml_filename:= my_map_save.yaml -pp use_sim_time:=true
ros2 run nav2_util lifecycle_bringup map_server
  1. Launch slam_toolbox
ros2 launch slam_toolbox online_async_launch.py params_file:= ./src/romobot_one/config/nav2_params.yaml use_sim_time:=true

I’ve tried many different permutations or the order, and different combinations based on my understanding of how everything fits together… but none seem to have yielded any positive results yet.

These are the errors I see in pretty much any node running with use_sim_time:= true

[INFO] [1676807194.631958852] [rviz]: Message Filter dropping message: frame 'laser_frame' at time 285.782 for reason 'Unknown'
[INFO] [1676807194.728035720] [rviz]: Message Filter dropping message: frame 'laser_frame' at time 285.882 for reason 'Unknown'
[INFO] [1676807194.823335104] [rviz]: Message Filter dropping message: frame 'laser_frame' at time 285.982 for reason 'Unknown'
[INFO] [1676807194.920022561] [rviz]: Message Filter dropping message: frame 'laser_frame' at time 286.082 for reason 'Unknown'
[INFO] [1676807195.015308779] [rviz]: Message Filter dropping message: frame 'laser_frame' at time 286.182 for reason 'Unknown'
[INFO] [1676807195.143357334] [rviz]: Message Filter dropping message: frame 'laser_frame' at time 286.282 for reason 'Unknown'
[INFO] [1676807195.239618141] [rviz]: Message Filter dropping message: frame 'laser_frame' at time 286.382 for reason 'Unknown'
[INFO] [1676807195.336032970] [rviz]: Message Filter dropping message: frame 'laser_frame' at time 286.482 for reason 'Unknown'

Looking at the tf_tree, when this is happening there is no transform between map->odom->base_link. Which seems to be breaking everything else. Sometimes it seems like the /map topic isn’t even being published (according to RVIZ2) although I can see it with ros2 topic list/echo.

Should the slam toolbox be running while trying to run the amcl? It hasn’t seemed to make any difference to this error either way at the moment.

This is driving me a bit nuts because I’m super keen to get to the waypoint autonomy section :smiley: Is there something I may be missing that could be causing this?

Any hints or thoughts on this would be greatly appreciated,

1 Like

I’m still learning the nav2 stuff but I can comment on a couple of things in your post.

Slam Toolbox does the localization, no need for AMCL.
Slam Toolbox launches the map server.
Slam toolbox publishes the map->odom transform. If you can get this to work, you’ll see a map on rviz.
You also need to provide a transform odom->base_link from you own hardware or gazebo in a sim. This will make the robot move relative to the map.
If you’re getting the message dropping error, it means your transform (map->odom->base_link isn’t complete.

Hope this helps.


I’m Having similar issues but no in simulation only in irl

planner_server-2] [INFO] [1682009323.212146288] [global_costmap.global_costmap]: Timed out waiting for transform from base_link to map to become available, tf error: Lookup would require extrapolation into the past. Requested time 0.200000 but the earliest data is at time 1682009321.772360, when looking up transform from frame [base_link] to frame [map]

Just repeats till I kill it

Solved! Sim_time was always on the mapper_params_online_async.yaml added the false and started working perfectly fine :grin:

I’m glad you got it sorted! Sorry I wasn’t able to help sooner - I’ve been a bit out of action the last few weeks.

The way use_sim_time is currently set in that sort of thing is very messy compared to ROS 1. I think sometimes it is always forced to true in params files, and then expected to be overridden in the launch, but that doesn’t always happen, and can be very confusing to troubleshoot.

1 Like


I’m trying to follow the Nav2 video but when I try to run the 2D goal pose more than once, I get an error and the robot stops moving in simulation.

Then I have to kill the node and restart. When I kill it the output in the terminal is as follows:

[bt_navigator-4] [ERROR] [1684336892.844125985] [bt_navigator]: Action server failed while executing action callback: “send_goal failed”
[bt_navigator-4] [WARN] [1684336892.844211995] [bt_navigator]: [navigate_to_pose] [ActionServer] Aborting handle.
[controller_server-1] [INFO] [1684336902.771172788] [controller_server]: Reached the goal!
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[bt_navigator-4] [INFO] [1684337180.617898506] [rclcpp]: signal_handler(signal_value=2)
[INFO] [recoveries_server-3]: process has finished cleanly [pid 5556]
[waypoint_follower-5] [INFO] [1684337180.617850656] [rclcpp]: signal_handler(signal_value=2)
[recoveries_server-3] [INFO] [1684337180.618065338] [rclcpp]: signal_handler(signal_value=2)
[controller_server-1] [INFO] [1684337180.618100778] [rclcpp]: signal_handler(signal_value=2)
[planner_server-2] [INFO] [1684337180.618400120] [rclcpp]: signal_handler(signal_value=2)
[lifecycle_manager-6] [INFO] [1684337180.621821988] [rclcpp]: signal_handler(signal_value=2)
[lifecycle_manager-6] [INFO] [1684337180.653032649] [lifecycle_manager_navigation]: Destroying
[waypoint_follower-5] [INFO] [1684337180.623598182] [waypoint_follower]: Destroying
[bt_navigator-4] [INFO] [1684337180.653596284] [bt_navigator]: Destroying
[INFO] [planner_server-2]: process has finished cleanly [pid 5554]
[INFO] [controller_server-1]: process has finished cleanly [pid 5552]
[bt_navigator-4] terminate called after throwing an instance of ‘rclcpp::exceptions::RCLError’
[bt_navigator-4] what(): Failed to create interrupt guard condition in Executor constructor: the given context is not valid, either rcl_init() was not called or rcl_shutdown() was called., at /tmp/binarydeb/ros-foxy-rcl-1.1.14/src/rcl/guard_condition.c:67
[INFO] [lifecycle_manager-6]: process has finished cleanly [pid 5571]
[INFO] [waypoint_follower-5]: process has finished cleanly [pid 5560]
[ERROR] [bt_navigator-4]: process has died [pid 5558, exit code -6, cmd ‘/opt/ros/foxy/lib/nav2_bt_navigator/bt_navigator --ros-args -r __node:=bt_navigator --params-file /tmp/tmpxxvnf_28 -r /tf:=tf -r /tf_static:=tf_static’].

I’m not sure how to go about fixing this, any guesse?

Thank you

Hi Rawshan, I have exactly the same problem as you. Wish someone will provide solution to this problem

Hey, so when I implemented it onto the real robot, it worked fine, but it was just on the simulations where it was messing up.

I am currently struggling with positioning the robot. At the moment the map is about 70-90 deg rotated relative to the laser scan. I already tried 2d pose estimate but to no effect.
Any idea what might be the solution for this?

Oh and I am using humble.

[ERROR] [twist_mux-2]: process has died [pid 10622, exit code -11, cmd '/opt/ros/foxy/lib/twist_mux/twist_mux --ros-args --params-file /home/destiny/robot_ws/install/articubot_one/share/articubot_one/config/twist_mux.yaml -r /cmd_vel_out:=/diff_cont/cmd_vel_unstamped'].

Keep getting this error while running the robot controller launch file. it breaks the controller

Twist mux is not working on the Pi.
I tried running
ros2 run twist_mux twist_mux --ros-args --params-file ./src/articubot_one/config/twist_mux.yaml -r cmd_vel_out:=diff_cont/cmd_vel_unstamped'

but it also crashes

Hi, The issue somehow fixed itself. I am not sure if the Pi just needed a restart or it could have been because i had the display connected. I read online that twist_mux had some crashing issues with previous ros versions. not sure what rellly happened.

Hi Josh,

I try to follow what you do in this tutorial but got some errors.
I’m using ubuntu 22.04 with ros2 humble on both robot and dev machine, on robot I use Raspberry Pi 3 and Ydlidar X4 pro.

When I run launch_robot.launch.py / ydlidar_node_driver file / twist mux on robot and slam toolbox / teleop keyboard (I didn't use joystick so) / rviz2 on dev machine , everything seems to run fine with some few minor problems but overall it work as expected. But when I run ros2 launch nav2_bringup navigation_launch.py use_sim_time:=false I got an errors.

[controller_server-1] [INFO] [167245.8282.969990068] [local_costmap.local_costmap]: Timed out waiting for transform from base_link to odom to become available, tf error: Invalid frame ID "base_link" passed to canTransform argument source_frame - frame does not exist

It seems like this cause my robotmodel to break because after this I look back to rviz2 and get RobotModel Error but when I kill this node my model is comeback.In your case I see that you got this error too but then can run normally, but in my case it get stuck in this error.

I also have some few minor problem that I don’t sure that is it relate to this error.

  • when I publish LIDAR I got a stream of error like[rviz2]: Lookup would require extrapolation into the future. Requested time 1691163528.870999 but the latest data is at time 1691163528.869494, when looking up transform from frame [laser_frame] to frame [odom] but overall LaserScanner is alright and correct in Rviz2

  • when I run slam_toolbox I got a map but the robot is quite jumpy, so my map look quite a bit wrong


Okay after some workout I manage to fix this.

I think the main cause of this is that message stuck because of timeout as this issue.So I use CycloneDDS and the problem is gone.You can run sudo apt install ros-foxy-rmw-cyclonedds-cpp then export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp to your .bashrc.

Also the few minor problem like Lidar and Slam act funny,I don’t sure why but when I lower my frame rate in Rviz2 from 30 to 10 the error is gone and Slam working correctly. Maybe because network over Wifi?

Hi !
when i try to localization with slam tool box but it have some error like that

[async_slam_toolbox_node-1] [INFO] [1692116019.616897045] [slam_toolbox]: CeresSolver: Using SCHUR_JACOBI preconditioner.
[async_slam_toolbox_node-1] [ERROR] [1692116019.619807749] [slam_toolbox]: serialization::Read: Failed to open requested file: /home/ros2_ws/fdr_pre_save_serial.
[async_slam_toolbox_node-1] [ERROR] [1692116019.619839508] [slam_toolbox]: DeserializePoseGraph: Failed to read file: /home/ros2_ws/fdr_pre_save_serial.

How can i solve with it ?

Hello! I am having a problem with my custom robot in Humble, I followed the tutorial, but if I add new obstacles to the simulation the global costmap doesnt updates, I posted all the info in the Robotics Stack Exchange page: https://robotics.stackexchange.com/questions/104198/nav2-obstacle-avoidance-not-working-in-humble

Im new to ros and want some help i have made a new 4 wheel bot and i had the same issue with this articubot_one also i will add the error code below (using ros2 Humble)

GitHub - The-Kriz/rog_ros_bot this is my repo (i have not added the nav here but i downloaded the one from the git hub repo by joshnewans

kriz@kriz-ROG:~/dev_ws$ ros2 launch rog_ros_bot navigation_launch.py use_sim_time:=true
[INFO] [launch]: All log files can be found below /home/kriz/.ros/log/2023-10-15-21-44-36-710040-kriz-ROG-39339
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [controller_server-1]: process started with pid [39340]
[INFO] [smoother_server-2]: process started with pid [39342]
[INFO] [planner_server-3]: process started with pid [39344]
[INFO] [behavior_server-4]: process started with pid [39346]
[INFO] [bt_navigator-5]: process started with pid [39348]
[INFO] [waypoint_follower-6]: process started with pid [39350]
[INFO] [velocity_smoother-7]: process started with pid [39352]
[INFO] [lifecycle_manager-8]: process started with pid [39354]
[planner_server-3] /opt/ros/humble/lib/nav2_planner/planner_server: symbol lookup error: /opt/ros/humble/lib/libnav2_costmap_2d_core.so: undefined symbol: _ZN9nav2_util13LifecycleNode18on_rcl_preshutdownEv
[ERROR] [planner_server-3]: process has died [pid 39344, exit code 127, cmd ‘/opt/ros/humble/lib/nav2_planner/planner_server --ros-args --log-level info --ros-args -r __node:=planner_server --params-file /tmp/launch_params_qzo3jz44 -r /tf:=tf -r /tf_static:=tf_static’].
[smoother_server-2] /opt/ros/humble/lib/nav2_smoother/smoother_server: symbol lookup error: /opt/ros/humble/lib/libnav2_costmap_2d_core.so: undefined symbol: _ZN9nav2_util13LifecycleNode18on_rcl_preshutdownEv
[controller_server-1] /opt/ros/humble/lib/nav2_controller/controller_server: symbol lookup error: /opt/ros/humble/lib/libnav2_costmap_2d_core.so: undefined symbol: _ZN9nav2_util13LifecycleNode18on_rcl_preshutdownEv
[ERROR] [smoother_server-2]: process has died [pid 39342, exit code 127, cmd ‘/opt/ros/humble/lib/nav2_smoother/smoother_server --ros-args --log-level info --ros-args -r __node:=smoother_server --params-file /tmp/launch_params_qzo3jz44 -r /tf:=tf -r /tf_static:=tf_static’].
[ERROR] [controller_server-1]: process has died [pid 39340, exit code 127, cmd ‘/opt/ros/humble/lib/nav2_controller/controller_server --ros-args --log-level info --ros-args --params-file /tmp/launch_params_qzo3jz44 -r /tf:=tf -r /tf_static:=tf_static -r cmd_vel:=cmd_vel_nav’].
[waypoint_follower-6] /opt/ros/humble/lib/nav2_waypoint_follower/waypoint_follower: symbol lookup error: /opt/ros/humble/lib/libwaypoint_follower_core.so: undefined symbol: _ZN9nav2_util13LifecycleNode18on_rcl_preshutdownEv
[velocity_smoother-7] /opt/ros/humble/lib/nav2_velocity_smoother/velocity_smoother: symbol lookup error: /opt/ros/humble/lib/libvelocity_smoother_core.so: undefined symbol: _ZN9nav2_util13LifecycleNode18on_rcl_preshutdownEv
[behavior_server-4] /opt/ros/humble/lib/nav2_behaviors/behavior_server: symbol lookup error: /opt/ros/humble/lib/libnav2_costmap_2d_core.so: undefined symbol: _ZN9nav2_util13LifecycleNode18on_rcl_preshutdownEv
[ERROR] [waypoint_follower-6]: process has died [pid 39350, exit code 127, cmd ‘/opt/ros/humble/lib/nav2_waypoint_follower/waypoint_follower --ros-args --log-level info --ros-args -r __node:=waypoint_follower --params-file /tmp/launch_params_qzo3jz44 -r /tf:=tf -r /tf_static:=tf_static’].
[ERROR] [velocity_smoother-7]: process has died [pid 39352, exit code 127, cmd ‘/opt/ros/humble/lib/nav2_velocity_smoother/velocity_smoother --ros-args --log-level info --ros-args -r __node:=velocity_smoother --params-file /tmp/launch_params_qzo3jz44 -r /tf:=tf -r /tf_static:=tf_static -r cmd_vel:=cmd_vel_nav -r cmd_vel_smoothed:=cmd_vel’].
[ERROR] [behavior_server-4]: process has died [pid 39346, exit code 127, cmd ‘/opt/ros/humble/lib/nav2_behaviors/behavior_server --ros-args --log-level info --ros-args -r __node:=behavior_server --params-file /tmp/launch_params_qzo3jz44 -r /tf:=tf -r /tf_static:=tf_static’].
[bt_navigator-5] /opt/ros/humble/lib/nav2_bt_navigator/bt_navigator: symbol lookup error: /opt/ros/humble/lib/libbt_navigator_core.so: undefined symbol: _ZN9nav2_util13LifecycleNode18on_rcl_preshutdownEv
[ERROR] [bt_navigator-5]: process has died [pid 39348, exit code 127, cmd ‘/opt/ros/humble/lib/nav2_bt_navigator/bt_navigator --ros-args --log-level info --ros-args -r __node:=bt_navigator --params-file /tmp/launch_params_qzo3jz44 -r /tf:=tf -r /tf_static:=tf_static’].
[lifecycle_manager-8] [INFO] [1697386477.360577883] [lifecycle_manager_navigation]: Creating
[lifecycle_manager-8] [INFO] [1697386477.362888427] [lifecycle_manager_navigation]: Creating and initializing lifecycle service clients
[lifecycle_manager-8] [INFO] [1697386479.364152961] [lifecycle_manager_navigation]: Waiting for service controller_server/get_state…
[lifecycle_manager-8] [INFO] [1697386481.364271261] [lifecycle_manager_navigation]: Waiting for service controller_server/get_state…
[lifecycle_manager-8] [INFO] [1697386483.364403410] [lifecycle_manager_navigation]: Waiting for service controller_server/get_state…
[lifecycle_manager-8] [INFO] [1697386485.364559028] [lifecycle_manager_navigation]: Waiting for service controller_server/get_state…

When I am running : ros2 launch articubot_one launch_sim.launch.py

I was told that:

[ERROR] [launch]: Caught exception in launch (see debug for traceback): executable ‘spawner.py’ not found on the libexec directory ‘/opt/ros/humble/lib/controller_manager’

I have searched on the Internet but the problem is still here, so I really want to know how to solve this.

Thans a lot !