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

Different tf tree while running the bagfile from start and middle

asked 2019-12-26 07:33:11 -0600

warriorUSP gravatar image

So, I have this wierd bug that, whenever I tried to play this particular bagfile from the start then I have all the correct tf frames present in the tf tree, but when I tried to play the bagile from the middle then certain tf frames got lost. Bagfile played from the start:
image description
Bagfile played from the middle (using rosbag play <bafile> -s 150): image description
So I wanted to know why the frames below realsense link got lost when playing the bagfile from the middle? Is it particular to the bagfile recorded (I got the bagfile from the client I am working for) or some rosbag bug?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-12-26 22:43:48 -0600

Orhan gravatar image

updated 2019-12-27 01:38:52 -0600

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#Add...

edit flag offensive delete link more

Comments

1

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).

gvdhoorn gravatar image gvdhoorn  ( 2019-12-27 03:51:35 -0600 )edit

Thanks. It's more clear now.

Orhan gravatar image Orhan  ( 2019-12-27 05:29:20 -0600 )edit

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)?

warriorUSP gravatar image warriorUSP  ( 2019-12-27 05:54:38 -0600 )edit
1

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"/>

Orhan gravatar image Orhan  ( 2019-12-27 06:21:02 -0600 )edit

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.

warriorUSP gravatar image warriorUSP  ( 2019-12-27 07:48:14 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2019-12-26 07:33:11 -0600

Seen: 1,182 times

Last updated: Dec 27 '19