I am trying to run Nav2 together with mapping by slam_toolbox. I'm using a raspberry pi 4 to connect my hardware, it's running ROS2 humble and ubuntu server 22.04, everything runs on the raspberry except Nav2, slam_toolbox and rviz, I have those 3 running on a laptop that also runs ubuntu and ros2 humble, on both I have changed the rmw to cyclone dds. I'm running a real robot, not a simulation.
At this point I have slam_toolbox creating a map without issue, but when I try to start Nav2 it will hang waiting for transform from base_link to odom to become available.
I run slam_toolbox using:
ros2 launch slam_toolbox online_async_launch.py use_sim_time:=false
And I run Nav2 using:
ros2 launch nav2_bringup navigation_launch.py use_sim_time:=false
The output from the Nav2 terminal shows the following:
[controller_server-1] [INFO] [1721230720.044839204] [local_costmap.local_costmap]: Activating
[controller_server-1] [INFO] [1721230720.044865497] [local_costmap.local_costmap]: Checking transform
[controller_server-1] [INFO] [1721230720.044904311] [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
[controller_server-1] [INFO] [1721230720.544980929] [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
[controller_server-1] [INFO] [1721230721.047586723] [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
[controller_server-1] [INFO] [1721230721.544977966] [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
The Nav2 terminal output says to be waiting for the baselink->odom tf, but in the rqt_tf_tree this is present, also as far I understand without this tf slam_toolbox wouldn't be able to do any mapping. The second part of the message says; tf error: Invalid frame ID "base_link" passed to canTransform argument source_frame - frame does not exist. I don't really know what this error means nor how to solve it. I noticed that the map->odom and odom->baselink tf timestamps are not updating in the rqt_tf_tree, although mapping goes without an issue.
So my question is does anyone know how to solve this issue for Nav2?
Edit: did a new test running everything on the raspberry except rviz.
Running everything on the raspberry slam_toolbox still makes a map without issue, the output in the terminal of Nav2 changed though but still doesn't work, now the local_costmap seems to load although I cannot get it to show in Rviz. The repeating error now is found at global_costmap, and it looks like it's a timestamp issue of the laser but the reason/cause of that is unknown to me. The output of Nav2 terminal in this test:
[controller_server-1] [INFO] [1721314234.995420561]
[local_costmap.local_costmap]: Activating
[controller_server-1] [INFO] [1721314234.995593112]
[local_costmap.local_costmap]: Checking transform
[controller_server-1] [INFO] [1721314234.996547165]
[local_costmap.local_costmap]: start
[controller_server-1] [INFO] [1721314235.208655240]
[controller_server]: Creating bond (controller_server) to lifecycle manager.
[lifecycle_manager-8] [INFO] [1721314235.344393661]
[lifecycle_manager_navigation]: Server controller_server connected with bond.
[lifecycle_manager-8] [INFO] [1721314235.344661732]
[lifecycle_manager_navigation]: Activating smoother_server
[smoother_server-2] [INFO] [1721314235.346597599]
[smoother_server]: Activating
[smoother_server-2] [INFO] [1721314235.347152959]
[smoother_server]: Creating bond (smoother_server) to lifecycle manager.
[controller_server-1] [INFO] [1721314235.396229063]
[local_costmap.local_costmap]: Message Filter dropping message: frame 'laser' at time 1721314171.105 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
[lifecycle_manager-8] [INFO] [1721314235.479524953]
[lifecycle_manager_navigation]: Server smoother_server connected with bond.
[lifecycle_manager-8] [INFO] [1721314235.479762764]
[lifecycle_manager_navigation]: Activating planner_server
[planner_server-3] [INFO] [1721314235.481644725]
[planner_server]: Activating
[planner_server-3] [INFO] [1721314235.482108784]
[global_costmap.global_costmap]: Activating
[planner_server-3] [INFO] [1721314235.482245084]
[global_costmap.global_costmap]: Checking transform
[planner_server-3] [INFO] [1721314235.482732528]
[global_costmap.global_costmap]: Timed out waiting for transform from base_link to map to become available, tf error: Lookup would require extrapolation at time 1721314171.104652, but only time 1721314171.304651 is in the buffer, when looking up transform from frame [base_link] to frame [map]
[controller_server-1] [INFO] [1721314235.591332296]
[local_costmap.local_costmap]: Message Filter dropping message: frame 'laser' at time 1721314171.105 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
[controller_server-1] [INFO] [1721314235.777311239]
[local_costmap.local_costmap]: Message Filter dropping message: frame 'laser' at time 1721314171.105 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
[controller_server-1] [INFO] [1721314235.964545848]
[local_costmap.local_costmap]: Message Filter dropping message: frame 'laser' at time 1721314171.105 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
[planner_server-3] [INFO] [1721314235.982623179]
[global_costmap.global_costmap]: Timed out waiting for transform from base_link to map to become available, tf error: Lookup would require extrapolation at time 1721314171.104652, but only time 1721314171.304651 is in the buffer, when looking up transform from frame [base_link] to frame [map]
[controller_server-1] [INFO] [1721314236.156798899]
[local_costmap.local_costmap]: Message Filter dropping message: frame 'laser' at time 1721314171.105 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
[controller_server-1] [INFO] [1721314236.348084928]
[local_costmap.local_costmap]: Message Filter dropping message: frame 'laser' at time 1721314171.105 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
[planner_server-3] [INFO] [1721314236.482598413]
[global_costmap.global_costmap]: Timed out waiting for transform from base_link to map to become available, tf error: Lookup would require extrapolation at time 1721314171.104652, but only time 1721314171.304651 is in the buffer, when looking up transform from frame [base_link] to frame [map]
[controller_server-1] [INFO] [1721314236.539913504]
[local_costmap.local_costmap]: Message Filter dropping message: frame 'laser' at time 1721314171.105 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
Thanks in advance. If you need any more information just let me know and I will update the question.
ros2 topic echo /tf
to see if the transform is actually being published? $\endgroup$