ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

You need to make sure that TF has a valid and complete TF tree to transform from the kinect frame at the time stamp of the point you are transforming. That's the case when TF received a transform with a stamp greater or equal than the time stamp of the point you are trying to transform. The reason is that TF tries to interpolate positions and orientations, but does not extrapolate. Of course, for interpolation, TF needs at least two transforms, one after and one before the time stamp you are trying to transform.

The static_transform_publisher future-dates transforms to make sure that all data that uses ros::Time::now() can actually be transformed and to avoid unnecessary delays but it cannot be assumed that frames published by other nodes are future dated as well. For instance, when you have a moving frame (e.g. a PTU), you can only use the current position of the frame (i.e. ros::Time::now()) to publish a frame, everything in the future would be extrapolation again. For that reason, TF provides the method waitForTransform that allows to block until a timeout expires or the transformation into a frame becomes possible. Alternatively, tf::MessageFilter can be used to postpone a subscriber callback on a stamped message until the transformation into a specific frame is possible.