-
Notifications
You must be signed in to change notification settings - Fork 255
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
[jazzy] Add support for replaying multiple bags (backport #1848) #1873
Conversation
Signed-off-by: Christophe Bedard <[email protected]> (cherry picked from commit 125db50) # Conflicts: # shared_queues_vendor/CHANGELOG.rst # shared_queues_vendor/package.xml
Cherry-pick of 125db50 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Signed-off-by: Michael Orlov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice: I reverted the deletion of the shared_queue_vendor
package. Deleting a package in a stable release can break someone's dependencies.
@ros-pull-request-builder retest this please |
@ros-pull-request-builder retest this please |
Pulls: #1873 |
This PR adds support for replaying multiple bags with
ros2 bag play
and the underlying classes (rosbag2_transport::Player
/rosbag2_py::Player
).To replay multiple bags, use the new
-i,--input
CLI option.Like with the
ros2 bag convert
option, the-i,--input
option takes an URI to the bag folder or dedicated bag file and an optional explicit storage ID. This option can be used multiple times to be able to specify multiple bags. We keep thebag_path
positional argument for backward compatibility and simplicity of usage in cases where users need to play just one bag file. However, the standalone--storage
CLI option has been deprecated. In the future, users will need to use-i bag [storage_id]
if they need to specify the storage ID explicitly.The
rosbag2_transport::Player
now uses astd::priority_queue
, which required changing the logic and interaction betweenPlayerImpl::play_messages_from_queue()
andPlayerImpl::play_next()
. In short, message publication is now all handled byPlayerImpl::play_messages_from_queue()
.PlayerImpl::play_next()
simply tells it to play the next message and then waits for the result. While the queue is not lock-free anymore, this change does simplify the interaction betweenPlayerImpl::play_messages_from_queue()
andPlayerImpl::play_next()
a bit. Note: the priority queue depth is defined by the--read-ahead-queue-size
CLI option, which is set to 1000 elements by default.Messages are played in order, based on their
recv_timestamp
(recorder reception timestamp). However, with the priority queue, this could eventually be changed (e.g., throughPlayOptions
) to thesend_timestamp
(original publication timestamp).Other notes for reviewers:
ros2 bag convert
, I added the-i, --input
option that takes a bag URI and an optional explicit storage ID. This option can be used multiple times for multiple bags.bag_path
positional argument (but made it optional) because it is quite nice to be able to just doros2 bag play my-bag
. However, I deprecated the storage ID option (--storage
); users will have to use-i, --input
to specify an explicit storage ID for an input bag.jazzy
branch. Some APIs needed to be added (mainly constructors) to support N input bags.This is an automatic backport of pull request Add support for replaying multiple bags #1848 done by Mergify.