ros / geometry

Packages for common geometric calculations including the ROS transform library, "tf". Also includes ROS bindings for "bullet" physics engine and "kdl" kinematics/dynamics package.
172 stars 274 forks source link

setTransformStatic not implemented and confusing #202

Closed ejalaa12 closed 4 years ago

ejalaa12 commented 4 years ago

In the TransformerROS class implemented in tf, the method for setting tf is implemented such as:

https://github.com/ros/geometry/blob/00a32d024af476bf50822e6df2fe2ec97765b1a9/tf/src/tf/listener.py#L62-L63

But it can be confusing when using static tfs. Since no setTransformStatic method exist, we would "naturally" fallback to the setTransform, which is wrong since it doesn't call _buffer.set_transform_static and result in a bad graph.

To be correct, when setting static tfs to a TransformerROS instance we would use something like this

transformer = TransformerROS()
transformer._buffer.set_transform_static(my_static_tf, "default_authority")

Otherwise, lookup might fail.

Hope you find this useful :)

tfoote commented 4 years ago

Thanks for proposing to fill in this API. However static transforms were added in tf2 and tf's API has been kept and built upon the tf2 implementation for backwards compatibility. However tf's whole API is deprecated in favor of tf2 so if you'd like to take advantage of the static transform please switch to use tf2.