Skip to content

Conversation

@mergify
Copy link

@mergify mergify bot commented Sep 23, 2025

Description

Make the player respect the original messages' order with the same timestamp.
Note: The messages with the same recv_timestamps are a common situation when doing a recording with sim_time

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


This is an automatic backport of pull request #2172 done by Mergify.

…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)
@MichaelOrlov MichaelOrlov self-assigned this Sep 23, 2025
@MichaelOrlov MichaelOrlov changed the title Make the player respect the original messages' order with the same timestamp (backport #2172) [kilted] Make the player respect the original messages' order with the same timestamp (backport #2172) Sep 23, 2025
Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with green CI.

@MichaelOrlov
Copy link
Contributor

@ros-pull-request-builder retest this please

@MichaelOrlov
Copy link
Contributor

Pulls: #2187
Gist: https://gist.githubusercontent.com/MichaelOrlov/2f8dde2e16b12b60b7046c1f1a85fcc6/raw/11e7bf1fad886a76b43b2192ce96caee53884ea3/ros2.repos
BUILD args: --packages-above-and-dependencies rosbag2_transport rosbag2_tests
TEST args: --packages-above rosbag2_transport rosbag2_tests
ROS Distro: kilted
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/17044

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@MichaelOrlov MichaelOrlov merged commit 67c8804 into kilted Sep 24, 2025
12 checks passed
@MichaelOrlov MichaelOrlov deleted the mergify/bp/kilted/pr-2172 branch September 24, 2025 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants