Look at those speeds. They're 10000 Hz. Which shows that they're not dynamic. They're being published in /tf_static
topic.
Well, they're not actually being published that fast. And They're being published only once in the beginning. That's why they're not appearing if you play the bag from middle. So there's no problem or bug.
"It is expected that publishers on "/tf_static" publish using latched topics, the tf2_ros static_transform_publisher does this correctly."
More info about this topic: http://wiki.ros.org/tf2/Migration#Addition_of_.2BAC8-tf_static_topic
Originally posted by Orhan with karma: 856 on 2019-12-26
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by gvdhoorn on 2019-12-27:
I would actually add that even when not using TF static, what the OP observes is very much possible when using bag files and not playing them from the start.
TF is a distributed state system, where all participants in the nodegraph maintain their own local "view" on the tree. If a participant does not receive certain messages, it will not "know" about those transforms. When visualising the tree from the point-of-view of such a participant, you'll see missing edges and nodes (ie: transforms and frames).
TF static does not help here, because transforms on that topic are only broadcast once (or at least, it uses latched publishers), but incomplete views/partial state is inherent to the way TF works (but it's also not a problem and can even be used as an advantage).
Comment by Orhan on 2019-12-27:
Thanks. It's more clear now.
Comment by warriorUSP on 2019-12-27:
Thanks a lot for the clearification of latched topics and working of /tf_static. But I would like to ask that, if I want to use some ros package which requires those frames (here, frames below /realsense_link), and want to use the bagfile from the middle, then what would be the ideal way to go?
Should I store those static transforms from the start in some node and publish from there, then isnt this feature limiting the use of bagfile, which was possible earlier (though at the expense of computation)?
Comment by Orhan on 2019-12-27:
If you play those bags by hand or in an automated setup repeatedly, and if you don't want to waste 150 seconds for each, yes, you can write a node (or just a single launch file) that publishes those frames once after you play the bag file from the moment you want (Just to run when playing bag files). I think they thought like, the expense of computation in the robot is more important than the expense of computation of debugging. Example : <node pkg="tf2_ros" type="static_transform_publisher" name="debug_realsense_tf_fix_broadcaster" args="0.0 0.0 0.0 0 0 0.0 1.0 realsense_link realsense_color_frame"/>
Comment by warriorUSP on 2019-12-27:
Ok thanks, I got what you are saying, maybe in future they can publish that /tf_static
topic, from whenever bagfile starts playing instead of just publishing at the beginning only.