I am running Ubuntu 20.04 (kernel 5.11.0) on a x64 AMD Dell Inspiron. I use ROS release Noetic with the following relevant package versions:
ros-noetic-simulators/focal,now 1.5.0-1focal.20211007.220413 amd64 [installed,automatic] ros-noetic-slam-gmapping/focal,now 1.4.2-1focal.20211007.214554 amd64 [installed] ros-noetic-stage/focal,now 4.3.0-1focal.20210423.222334 amd64 [installed,automatic] ros-noetic-stage-ros/focal,now 1.8.0-1focal.20210922.193922 amd64 [installed,automatic] ros-noetic-tf/focal,now 1.13.2-1focal.20210922.193350 amd64 [installed,automatic] ros-noetic-tf-conversions/focal,now 1.13.2-1focal.20210922.204930 amd64 [installed,automatic] ros-noetic-tf2/focal,now 0.7.5-1focal.20210423.225547 amd64 [installed,automatic] ros-noetic-tf2-eigen/focal,now 0.7.5-1focal.20210423.225948 amd64 [installed,automatic] ros-noetic-tf2-geometry-msgs/focal,now 0.7.5-1focal.20210922.190831 amd64 [installed,automatic] ros-noetic-tf2-kdl/focal,now 0.7.5-1focal.20210922.190836 amd64 [installed,automatic] ros-noetic-tf2-msgs/focal,now 0.7.5-1focal.20210423.225302 amd64 [installed,automatic] ros-noetic-tf2-py/focal,now 0.7.5-1focal.20210922.180952 amd64 [installed,automatic] ros-noetic-tf2-ros/focal,now 0.7.5-1focal.20210922.190247 amd64 [installed,automatic]
Here is my launch script. I am ultimately trying to use
gmapping together. For now, nevermind my navigation stack configuration, I followed this tutorial. I am having problems with misaligned clocks between the stage simulator and gmapping. See the transform tree below:
Notice how the oldest transform for
map -> odom by gmapping is very large (I suspect a Unix timestamp) versus every other transform published by stage which are relative to the elapsed time. This difference is causing the navigation stack to give me the following error(s):
[ WARN] [1637419863.630355767]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: Lookup would require extrapolation 1637419854.238633871s into the past. Requested time 4.700000000 but the earliest data is at time 1637419858.938633680, when looking up transform from frame [base_link] to frame [map]. canTransform returned after 0.10044 timeout was 0.1.
How do I fix the transforms published by gmapping in this case?
I have found a hack solution for a working-ish system by adding the following to the launch file:
<param name="/use_sim_time" value="true" /> <param name="~transform_publish_period" value="0.1" />
The first line launches a
/clock server as a time reference that all nodes must use. This seems necessary since stage is using relative simulator time and gmapping is using real wall time. See this article. The second line changes how frequently gmapping publishes the
map -> odom transformation. The default 0.05 caused every node to constantly print:
Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame odom at time 2.550000 according to authority unknown_publisher at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
[ WARN] [1637431235.428923806, 2.500000000]: TF_REPEATED_DATA ignoring data with redundant timestamp for frame odom at time 2.550000 according to authority unknown_publisher
Increasing to 0.1s causes only one warning in the beginning. I now have an issue with my program that I'm writing not being able to see the transform, i.e.
tf.canTransform('/base_link', '/map', rospy.Time()) returns
False, until a few seconds after it starts.
Post score: 1