Current StaticTransformBroadcaster not update the late-comming rviz

asked 2019-04-25 04:15:53 -0600

EwingKang gravatar image

So I was playing around with the Intel RealSense and their ros2 package. And I've noticed that if any rviz2 is added after the launch of the camera node, they won't see the camera definition frame. (e.g. camera_link->camera_color_frame, and etc)

I looked into the code, and found that their staticTransformBroadcaster is only called once for each tf at the beginning of the node

This got me thinking, what should be the behavior of that tf2_ros::StaticTransformBroadcaster be? The current static_transform_publisher node within the tf2_ros package automatically publishes static tf to topic /tf_static every 5 seconds.
Seems to me that if I want to publish a static TF in my node, I should only need to call the broadcaster once, and the tf2_ros will handle the rest. If I want to publish a varying TF, I'll use tf2::TransformBroadcaster instead.

Not sure if this is counts as a bug or question or anything, Maybe ust want to hear your thoughts.

edit retag flag offensive close merge delete


So, to solve the issue, I hacked their code so the staticTransformBroadcaster is called within a 5-sec timer callback.

EwingKang gravatar image EwingKang  ( 2019-05-01 01:58:56 -0600 )edit