Looking at your rqt_tf_tree
, I assume the /base2kinect
node that is publishing the transform is a static_transform_publisher
from the tf library:
http://wiki.ros.org/tf#static_transform_publisher
This uses the tf1 library, which requires you to put a publishing period and uses the /tf
topic. Instead, use the tf2 version of the static transform publisher:
http://wiki.ros.org/tf2_ros#static_transform_publisher
This works the same as the tf1 version, but doesn't take a publishing period as the final argument, as it uses the new /tf_static
topic which is used for fixed frame transformations. Replacing your tf1 static publisher with this tf2 static publisher should solve your time extrapolation error.
EDIT:
Alternatively, you could add the transform from base_link
to kinect_link
as a fixed joint in your URDF file.
Originally posted by robustify with karma: 956 on 2020-07-13
This answer was ACCEPTED on the original site
Post score: 5
Original comments
Comment by Dragonslayer on 2020-07-13:
Is tf2 a ROS2 package, or/and what are the benefits of using it with ROS1?
Comment by MarkusHHN on 2020-07-13:
thank you it works!
Comment by robustify on 2020-07-13:
tf2
is a major improvement and feature enhancement to tf
that has been around since ROS Hydro. The tf2
migration guide has the details: http://wiki.ros.org/tf2/Migration. The /tf_static
topic is one of the new features, which avoids these timing issues with fixed transforms. In the rqt_tf_tree
, when you see a publish rate of 10000 Hz, this means it is a static transform published on /tf_static
.