-
Notifications
You must be signed in to change notification settings - Fork 911
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
rosbag migration drops latching=1 field for latched topics. #679
Comments
I'd be happy to fix this, but a proper fix would make a few changes to the rosbag.Bag interface so I wanted to get feedback before spending time on it. The migration tool reads messages from the old bag, migrates them, then writes them to the new bag. There is no attempt to maintain the original connection information or an interface to create connection information without digging into Bag's private members. Instead, a new connection header is created for each topic name. To fix the issue properly, rosbag.Bag will need to be updated to provide mechanisms to receive messages with their connection info, and a way to setup a connection info and write messages associated with it. The least intrusive fix for reading messages would be to add an optional boolean parameter to read_messages (return_connection_info=False) to request that the connection info is also returned in the tuple for each message. A new method could be added called setup_connection() to create a new connection info when writing to a bag file where the latching and callerid properties could be specified. The method would return a unique identifier for that connection. Finally, write_messages() would receive a new optional parameter (connection=None) where you could pass in the unique identifier obtained from setup_connection(). If no connection is specified, write() would continue the default behavior of creating/reusing a new standard connection info. This approach should leave read_messages() and write() messages with the current behavior so that existing code doesn't break but would allow the migration tool (and any other users) to translate bags more faithfully. |
@elliotjo That sounds like a fine approach. I haven't reviewed the API in detail to determine if there is a better way to achieve this, but it sounds like you have a fairly good understanding of the issue. To be clear you're referring to the Python bag API right? Also, do you need a unique identifier to communicate the
So you should be able to just do |
When migrating a bag with latched topics, those topics will no longer be latched.
The text was updated successfully, but these errors were encountered: