-
Notifications
You must be signed in to change notification settings - Fork 248
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
Add play_next() API to the player class #762
Add play_next() API to the player class #762
Conversation
@emersonknapp FYI |
@emersonknapp It turns out that it's not so easy to implement this feature. Simple clock->jump() doesn't guarantee that next message will be played. I am also worry about undefined behavior when more than one message recorded with the same timestamp. Just want to let you know that I am still WIP on the core implementation for this feature. |
@emersonknapp It seems I've fixed problem with skipped message by topic filtration in Could you please briefly take a look on the implementation? If you don't have major concerns - I will focus on unit tests. Update: I removed constraints for messages recorded with the same timestamp and even added special unit test for this case. |
bd875c8
to
c4019f9
Compare
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
…e published. Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
…iltration. Also partially solved issue with undefined behaviour when more than one message recorded with the same timestamp. Signed-off-by: Michael Orlov <morlovmr@gmail.com>
c4019f9
to
b6853c6
Compare
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
…ying queue do reinterpret_cast to internal buffer when peeking element. Signed-off-by: Michael Orlov <morlovmr@gmail.com>
…eue_ flag for unit tests Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
…fter_play_next test Signed-off-by: Michael Orlov <morlovmr@gmail.com>
@emersonknapp @Karsten1987 Gentle ping for review. |
BUILD args: --packages-up-to rosbag2_cpp rosbag2_transport rosbag2_tests rosbag2 |
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.
Sorry for the slow feedback - let's try and iterate on this quickly this week.
It looks good, but I had some comments I'd like to address before we merge.
rosbag2_test_common/include/rosbag2_test_common/subscription_manager.hpp
Outdated
Show resolved
Hide resolved
rosbag2_test_common/include/rosbag2_test_common/subscription_manager.hpp
Outdated
Show resolved
Hide resolved
rosbag2_test_common/include/rosbag2_test_common/subscription_manager.hpp
Outdated
Show resolved
Hide resolved
…ayback mode. i.e. Player::play() hasn't been started Signed-off-by: Michael Orlov <morlovmr@gmail.com>
…he private publish_message(message) method Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
…r_matched Signed-off-by: Michael Orlov <morlovmr@gmail.com>
@emersonknapp I've addressed your comments and suggestions for changes. Please verify or do a second round of review. |
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.
This looks great - thanks for the revision! Feel free to merge after verifying green ci_launcher
Rerunning CI after making changes per review. BUILD args: --packages-up-to rosbag2_cpp rosbag2_transport rosbag2_tests rosbag2 |
@emersonknapp Thank you for the review and very useful suggestions. |
Awesome feature, thanks a bunch, I'm actively using it. Do you plan on doing the reverse too? Like play_previous()? Would it be difficult to implement? Say in general but also just for some buffer like the last 10 messages? Because in my use case and I assume the most common one, one has a tricky situation and wants to look at the data in detail while playback is paused. Then I step forward and encounter something special and then I would like to go back just 1 frame without having to replay the whole bag. |
We would love to support this feature in rosbag2 - but there isn't active development on it at the moment.
It may require a little design work to figure out how to make this work - we'll also need the same capability for arbitrary jump-in-time, or if we wanted to play bags backward. Currently the rosbag2_storage API only reads linearly in one direction, so the player is structured that way as well, in terms of how its reading/cacheing is set up. There is no technical limitation on the SQLite3 backend that enforces this, though, and I imagine many other possible backends would be fine as well. |
Hi @Kaju-Bubanja. I think your case with playing previous message will be covered with sequence of API calls:
The idea is that you will be able to advance internal player clock in some time point in the past and replay messages one by one. However |
Added implementation for play_next() API
Part of the #696
Ready for review.