-
Notifications
You must be signed in to change notification settings - Fork 289
Make the player respect the original messages' order with the same timestamp #2172
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
Make the player respect the original messages' order with the same timestamp #2172
Conversation
- Add insertion sequence number to the LockedPriorityQueue to ensure that it can provide stable runtime sort algorithm. Signed-off-by: Michael Orlov <morlovmr@gmail.com>
d91dd30 to
bf14ecd
Compare
|
cc: @DaleKoenig |
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
* Bugfix: Player can't play with read_ahead_queue_size equal 1 Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Add missing deserialize_test_message() from #2172 Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Address review comments Co-Authored by: Christophe Bedard <bedard.christophe@gmail.com> Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> Signed-off-by: Michael Orlov <morlovmr@gmail.com> --------- Signed-off-by: Michael Orlov <morlovmr@gmail.com> Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
* Bugfix: Player can't play with read_ahead_queue_size equal 1 Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Add missing deserialize_test_message() from #2172 Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Address review comments Co-Authored by: Christophe Bedard <bedard.christophe@gmail.com> Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> Signed-off-by: Michael Orlov <morlovmr@gmail.com> --------- Signed-off-by: Michael Orlov <morlovmr@gmail.com> Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> (cherry picked from commit 951d175)
* Bugfix: Player can't play with read_ahead_queue_size equal 1 Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Add missing deserialize_test_message() from #2172 Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Address review comments Co-Authored by: Christophe Bedard <bedard.christophe@gmail.com> Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> Signed-off-by: Michael Orlov <morlovmr@gmail.com> --------- Signed-off-by: Michael Orlov <morlovmr@gmail.com> Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> (cherry picked from commit 951d175) # Conflicts: # rosbag2_transport/test/rosbag2_transport/rosbag2_transport_test_fixture.hpp
|
Pulls: #2172 |
|
I found the job that was retriggered for ci_linux-aarch64, but the ci_windows job wasn't automatically retriggered, so I did it manually. |
…2179) * Bugfix: Player can't play with read_ahead_queue_size equal 1 * Add missing deserialize_test_message() from #2172 * Address review comments Co-Authored by: Christophe Bedard <bedard.christophe@gmail.com> --------- (cherry picked from commit 951d175) Signed-off-by: Michael Orlov <morlovmr@gmail.com> Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Michael Orlov <morlovmr@gmail.com> Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
…(backport #2174) (#2180) * Bugfix: Player can't play with read_ahead_queue_size equal 1 (#2174) * Bugfix: Player can't play with read_ahead_queue_size equal 1 Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Add missing deserialize_test_message() from #2172 Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Address review comments Co-Authored by: Christophe Bedard <bedard.christophe@gmail.com> Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> Signed-off-by: Michael Orlov <morlovmr@gmail.com> --------- Signed-off-by: Michael Orlov <morlovmr@gmail.com> Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com> (cherry picked from commit 951d175) # Conflicts: # rosbag2_transport/test/rosbag2_transport/rosbag2_transport_test_fixture.hpp * Address merge conflicts Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Adjust test for absence of the "play_options_.message_order" Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Michael Orlov <morlovmr@gmail.com>
|
https://github.com/Mergifyio backport kilted jazzy |
✅ Backports have been created
|
…mestamp (#2172) * Make player respect original msgs order with the same timestamp - Add insertion sequence number to the LockedPriorityQueue to ensure that it can provide stable runtime sort algorithm. Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Simplify comparator's API by hiding inner sequence number inside queue Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <morlovmr@gmail.com> Signed-off-by: Michael Orlov <michael.orlov@apex.ai> (cherry picked from commit 6b462de)
…mestamp (#2172) * Make player respect original msgs order with the same timestamp - Add insertion sequence number to the LockedPriorityQueue to ensure that it can provide stable runtime sort algorithm. Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Simplify comparator's API by hiding inner sequence number inside queue Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <morlovmr@gmail.com> Signed-off-by: Michael Orlov <michael.orlov@apex.ai> (cherry picked from commit 6b462de) # Conflicts: # rosbag2_transport/src/rosbag2_transport/player.cpp
…mestamp (#2172) (#2187) * Make player respect original msgs order with the same timestamp - Add insertion sequence number to the LockedPriorityQueue to ensure that it can provide stable runtime sort algorithm. * Simplify comparator's API by hiding inner sequence number inside queue --------- (cherry picked from commit 6b462de) Signed-off-by: Michael Orlov <morlovmr@gmail.com> Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Michael Orlov <morlovmr@gmail.com>
… same timestamp (backport #2172) (#2188) * Make the player respect the original messages' order with the same timestamp (#2172) * Make player respect original msgs order with the same timestamp - Add insertion sequence number to the LockedPriorityQueue to ensure that it can provide stable runtime sort algorithm. Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Simplify comparator's API by hiding inner sequence number inside queue Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <morlovmr@gmail.com> Signed-off-by: Michael Orlov <michael.orlov@apex.ai> (cherry picked from commit 6b462de) # Conflicts: # rosbag2_transport/src/rosbag2_transport/player.cpp * Address merge conflicts and code difference Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Michael Orlov <morlovmr@gmail.com>
Description
Make the player respect the original messages' order with the same timestamp.
Note: The messages with the same
recv_timestampsare a common situation when doing a recording withsim_timeAdded insertion sequence number to the LockedPriorityQueue to ensure that it can provide a stable runtime sort algorithm.
Fixes Player does not preserve the order of messages with the same timestamp #2173
Is this user-facing behavior change?
Yes. Playback will respect the originally saved messages' order even if messages have the same timestamps.
However, playback from multiple bags can't preserve the original order of messages with the same timestamps in different bags because we don't know which one was first during recording, although the order is at least the same for each playback.
Did you use Generative AI?
Yes, I am using GitHub Copilot, GPT-4.1 in my workflow.
Additional Information
N/A