Add design document: Support repeating transient-local (“latched”) messages in Rosbag2 recorder#2327
Conversation
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
59155e3 to
5b3ec91
Compare
tonynajjar
left a comment
There was a problem hiding this comment.
In general looks good. My PR goes in that direction but of course doesn't completely align with all the points of this design documents - can be a good starting point.
@MichaelOrlov after this is merged do you plan on making the implementation?
|
Hi, would it be possible to address this issue #2333 as well please? Related to latched topics and would be extremely useful. |
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
- Mostly addressed style and some punctuations. Signed-off-by: Michael Orlov <morlovmr@gmail.com>
christophebedard
left a comment
There was a problem hiding this comment.
I have some minor questions/comments. Generally seems OK, but I didn't have that much time to properly digest it, and I'd really like to get input from users who originally requested this.
| **Example:** | ||
| ``` | ||
| Split at T=1000.5s, /tf_static originally at T=0.1s | ||
| After prepend: /tf_static written with T=1000.5s | ||
| Next message at T=1000.6s | ||
| Playback: continuous timeline without hours-long gap | ||
| ``` |
There was a problem hiding this comment.
What happens if you replay everything? Will that original message get published at T=0.1s and T=1000.5s? This is fine for /tf_static, but not for all topics.
There was a problem hiding this comment.
Yes. By design, since a transient local message on a particular topic was explicitly chosen to be repeated during recording, the original message will appear in a playback stream on a T=0.1s and T=1000.5s.
That is a requested behavior. To be able to replay just one small split file independently.
I have mentioned above that this shouldn't be a default behavior, and the user shall explicitly select on what topics transient local messages will be repeated during recording.
| 3. **Timestamp adjustment:** When prepending transient-local messages during split or snapshot, | ||
| timestamps are overwritten to avoid playback gaps: | ||
| - **Split mode**: set to last message timestamp (T_last) from previous bag file. | ||
| - **Snapshot mode**: set to the earliest timestamp (T_earliest) from snapshot buffer range. |
There was a problem hiding this comment.
I'd like to get input on this behaviour from users who originally requested this feature.
|
@MichaelOrlov I gave implementing a shot according to this design document: #2342 |
According to the review feedback. Signed-off-by: Michael Orlov <morlovmr@gmail.com>
|
@christophebedard, @tonynajjar I've addressed review comments. Please reiterate on review. |
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
9ff87aa to
54e9da4
Compare
Wire transient-local message support through the recorder and CLI layers: - Recorder: expand topic names in repeat_transient_local_messages map, route to create_transient_local_topic() during subscription setup, set transient_local() QoS for matching topics - config_options_from_node_params: parse record.repeat_transient_local ROS parameter (format: 'topic' or 'topic=depth') - ros2 bag record CLI: add --repeat-transient-local argument with parse_repeat_transient_local_topics() validator - pybind11: expose repeat_transient_local_messages on RecordOptions - Tests: recorder integration test verifying create_transient_local_topic() is called with correct depth, CLI parser tests for valid/invalid input Part 3 of 3 for ros2#1159, ros2#1886 Design document: ros2#2327
Wire transient-local message support through the recorder and CLI layers: - Recorder: expand topic names in repeat_transient_local_messages map, route to create_transient_local_topic() during subscription setup, set transient_local() QoS for matching topics - config_options_from_node_params: parse record.repeat_transient_local ROS parameter (format: 'topic' or 'topic=depth') - ros2 bag record CLI: add --repeat-transient-local argument with parse_repeat_transient_local_topics() validator - pybind11: expose repeat_transient_local_messages on RecordOptions - Tests: recorder integration test verifying create_transient_local_topic() is called with correct depth, CLI parser tests for valid/invalid input Part 3 of 3 for ros2#1159, ros2#1886 Design document: ros2#2327
Add the core data structures for repeating transient-local messages on bag split and snapshot: - TransientLocalMessagesCache: per-topic FIFO queues with configurable depth, thread-safe push/retrieval, timestamp-sorted output - RecordOptions: new repeat_transient_local_messages map field with YAML serialization/deserialization support - Unit tests for cache behavior (eviction, sorting, unregistered topics) - YAML roundtrip test for RecordOptions Part 1 of 3 for ros2#1159, ros2#1886 Design document: ros2#2327 Signed-off-by: Tony Najjar <tony.najjar@dexory.com>
Extend the writer layer to support repeating transient-local messages
on bag split and snapshot:
- BaseWriterInterface: add create_transient_local_topic() virtual methods
(with and without MessageDefinition)
- SequentialWriter: integrate TransientLocalMessagesCache
- create_transient_local_topic(): register topic in cache + storage
- write(): dual-write messages to cache for transient-local topics
- prepend_transient_local_messages(): prepend cached messages on split
with timestamp adjustment to last message edge
- write_messages(): merge transient-local cache with snapshot buffer,
adjust timestamps, deduplicate, stable-sort
- Writer: forwarding wrappers for new methods
- Mock sequential writer: tracking for create_transient_local_topic()
- Integration tests for split and snapshot modes
Part 2 of 3 for ros2#1159, ros2#1886
Design document: ros2#2327
Wire transient-local message support through the recorder and CLI layers: - Recorder: expand topic names in repeat_transient_local_messages map, route to create_transient_local_topic() during subscription setup, set transient_local() QoS for matching topics - config_options_from_node_params: parse record.repeat_transient_local ROS parameter (format: 'topic' or 'topic=depth') - ros2 bag record CLI: add --repeat-transient-local argument with parse_repeat_transient_local_topics() validator - pybind11: expose repeat_transient_local_messages on RecordOptions - Tests: recorder integration test verifying create_transient_local_topic() is called with correct depth, CLI parser tests for valid/invalid input Part 3 of 3 for ros2#1159, ros2#1886 Design document: ros2#2327
) * feat: add TransientLocalMessagesCache and RecordOptions field Add the core data structures for repeating transient-local messages on bag split and snapshot: - TransientLocalMessagesCache: per-topic FIFO queues with configurable depth, thread-safe push/retrieval, timestamp-sorted output - RecordOptions: new repeat_transient_local_messages map field with YAML serialization/deserialization support - Unit tests for cache behavior (eviction, sorting, unregistered topics) - YAML roundtrip test for RecordOptions Part 1 of 3 for #1159, #1886 Design document: #2327 Signed-off-by: Tony Najjar <tony.najjar@dexory.com> * refactor: optimize message retrieval by reserving vector capacity Signed-off-by: Tony Najjar <tony.najjar@dexory.com> * feat: add YAML conversion support for unordered_map<string, size_t> Signed-off-by: Tony Najjar <tony.najjar@dexory.com> --------- Signed-off-by: Tony Najjar <tony.najjar@dexory.com>
Add the core data structures for repeating transient-local messages on bag split and snapshot: - TransientLocalMessagesCache: per-topic FIFO queues with configurable depth, thread-safe push/retrieval, timestamp-sorted output - RecordOptions: new repeat_transient_local_messages map field with YAML serialization/deserialization support - Unit tests for cache behavior (eviction, sorting, unregistered topics) - YAML roundtrip test for RecordOptions Part 1 of 3 for ros2#1159, ros2#1886 Design document: ros2#2327 Signed-off-by: Tony Najjar <tony.najjar@dexory.com>
Extend the writer layer to support repeating transient-local messages
on bag split and snapshot:
- BaseWriterInterface: add create_transient_local_topic() virtual methods
(with and without MessageDefinition)
- SequentialWriter: integrate TransientLocalMessagesCache
- create_transient_local_topic(): register topic in cache + storage
- write(): dual-write messages to cache for transient-local topics
- prepend_transient_local_messages(): prepend cached messages on split
with timestamp adjustment to last message edge
- write_messages(): merge transient-local cache with snapshot buffer,
adjust timestamps, deduplicate, stable-sort
- Writer: forwarding wrappers for new methods
- Mock sequential writer: tracking for create_transient_local_topic()
- Integration tests for split and snapshot modes
Part 2 of 3 for ros2#1159, ros2#1886
Design document: ros2#2327
Signed-off-by: Tony Najjar <tony.najjar@dexory.com>
…s2#2385) * feat: add TransientLocalMessagesCache and RecordOptions field Add the core data structures for repeating transient-local messages on bag split and snapshot: - TransientLocalMessagesCache: per-topic FIFO queues with configurable depth, thread-safe push/retrieval, timestamp-sorted output - RecordOptions: new repeat_transient_local_messages map field with YAML serialization/deserialization support - Unit tests for cache behavior (eviction, sorting, unregistered topics) - YAML roundtrip test for RecordOptions Part 1 of 3 for ros2#1159, ros2#1886 Design document: ros2#2327 Signed-off-by: Tony Najjar <tony.najjar@dexory.com> * refactor: optimize message retrieval by reserving vector capacity Signed-off-by: Tony Najjar <tony.najjar@dexory.com> * feat: add YAML conversion support for unordered_map<string, size_t> Signed-off-by: Tony Najjar <tony.najjar@dexory.com> --------- Signed-off-by: Tony Najjar <tony.najjar@dexory.com>
|
@christophebedard @fujitatomoya, a friendly ping here to wrap-up review of this PR with design. |
Description
Add design document: Support repeating transient-local (“latched”) messages in Rosbag2 recorder.
--repeat-latchedin ROS 2 (transient local) #1159Is this user-facing behavior change?
No.
Did you use Generative AI?
Ye. GitHub Copilot, GPT-5.0 and ClaudeCode 4.5
Additional Information
N/A