morse-simulator / morse

The Modular OpenRobots Simulation Engine
http://morse-simulator.github.io/
Other
357 stars 156 forks source link

[mw/ros] Add support for static TF2 publisher (latched topic) #772

Closed crey0 closed 7 years ago

crey0 commented 7 years ago

Adding support for TF2 static publisher. As it uses a latched topic, and the transform is expected not to change, there is no need to broadcast it continuously.

See wiki.ros.org/tf2/Migration :

"Addition of /tf_static topic

For greater efficiency tf now has a static transform topic "/tf_static" This topic has the same format as "/tf" however it is expected that any transform on this topic can be considered true for all time. Internally any query for a static transform will return true.

It is expected that publishers on "/tf_static" publish using latched topics, the tf2_ros static_transform_publisher does this correctly. Note: avoid multiple latched static transform publishers on /tf_static in the same process, because with multiple latched publishers within the same node only one will latch correctly. "

dgerod commented 7 years ago

Could you add some tests? Please, see tests for TF.

Thanks.

crey0 commented 7 years ago

I added a test file for both static tf publishers, but did not change the CMakeLists, as other tests such as tf_test were not included.