-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use_tf_static should be false by default #105
Comments
Was the bag file filtered at some point? It looks like rosbag forgets that topics are latched if the bag is filtered ros/ros_comm#685 . I'm not sure about disabling |
Right, that's my concern as well, and (I'm assuming) the reason it is currently set to true. Just looking a bit into the history, it looks like this was false in indigo, and then was changed to true for Jade and newer, probably to reduce the amount of data. So switching back has its own set of downsides here, which is why it isn't so clearcut (and also why there is a switch for it :). |
@sloretz @clalancette The concept of latching in combination with stamped messages also appears contradicting to me. I think a latched message should either have the timestamp of when it is published or have no timestamp at all. E.g. storing a message with a timestamp from before the logging actually started is implausible. In general, I prefer correctness (in having a valid complete robot state at any point in time) over storage efficiency. |
I can't reproduce the issue on melodic. It looks like rosbag correctly publishes a latched message. Creating the bag
Playing back the rosbag with
In another terminal the message was received on a subscriber created after playback started, so it is being latched.
It looks like the latched status is stored in the
|
Thank you for looking into this. In any case, even when replaying with active latching ( To make my case: |
By default
Are you asking how to use the rosbag API to check if there was a latched publisher on a topic? Rosbag player uses a
This sounds like a bug. Does the connection info for the
If I understand correctly, there is a bag file with static and dynamic transforms, and it needs to be played to give some tool the complete tf tree. It sounds like something interesting happens in the middle of the bag file, so playback is starting from the middle. Rosbag doesn't publish the static transforms because the start time is after when the static transforms were published. I disagree that this is the default use case for If the goal is having static transforms regardless when the bag was started, I recommend telling rosbag not to publish |
No. I meant that if I start reading the bagfile with a different
I am using the python API for rosbag, btw, and it looks like there are no wrappers for these connection info methods that you mentioned. However, the grepping approach ( I might be able to share a minimal example bagfile with this issue to help debugging. Nevertheless, even if these issues get resolved in the different parts of logging and replay, I wanted to point out the latching approach is fragile (at least from my perspective). E.g. by default rosbag play ignores the latching attribute of topics and it is very likely that the latching attribute gets lost when post-processing bagfiles. |
You've bounced into a known issue with multiple static tf publishers. ros/ros_comm#146 I've written a workaround package that basically muxes all ever published static TFs into one big message and republishes it, hoping it is the last publisher and gets latched. https://github.com/tradr-project/static_transform_mux . I haven't released this package because I hoped it might get merged into geometry2, but as the issue has been dead for about 2 years, I'll consider releasing it into melodic. What it doesn't help with is replaying the bagfile from later point than the original start time - then the static TFs get lost. |
How hard would it be to have the recording script inspecting all static_tfs at recording startup and provide the option to republish (all of) them as a simple tf at a configurable interval (e.g. 1Hz) ? |
Discovering the hard way this issue too, resulting in multiple unclean recorded bags |
@doisyg Give a try to the above mentioned static_transform_mux. You can first run it, then play the bag that contains the static transforms, and then you can play-record all the other bags and the static TFs will be there :) Or you can use the python interface to rosbag to find the transforms in a script and copy them to all bags. |
Closing based on the reasoning in #109 (comment) |
The behaviour of publishing fixed joints changed significantly since the introduction of
use_tf_static
. By default, fixed joint transforms are published once totf_static
with the earliest possible timestamp that robot transformations can have.When publishing joint positions and logging the robot state (as the set of its TFs) some time after the
robot_state_publisher
has been started, the resulting bagfile will contain static TFs from a time before the logging actually started and hence is not a correct representation of the robot state.Although the static transforms are latched (and hence logged), they are not latched by default when replaying a rosbag. As a consequence it is not possible to start any node that needs the full robot state (e.g. RViz) after the replay started.
When reading the TFs into a TF buffer (which caches TFs for 10s by default), this creates distinct TF trees and results in failed lookups:
In this particular case the static transforms were published at 1551109106.787312031 and the non-static transforms were published at 1551113242.391208649.
By publishing fixed joints as static TF periodically together with the non-static TF, the
robot_state_publisher
would provide a complete state of the robot at any point in time and the before mentioned issues would be circumvented.The text was updated successfully, but these errors were encountered: