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.

1 Like

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.

1 Like

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