Open jespersmith opened 4 days ago
IMO this sounds reasonable and more reliable behavior.
Ignore topics with unknown serialization formats: ros2 bag play should play back topics with compatible formats (like cdr) and skip topics with unknown formats.
probably it should not ignore, but it can print the warning that this topic data is unknown serialization formats or something like that.
I agree that it is nice to have feature/behavior. As regards the implementation proposal. It should be generic and not specific to some storage plugin. Therefore only option 2 is valid in this case.
- Option 2: Modify the behavior of the --topics flag in ros2 bag play to validate only the specified topics.
PRs are welcome.
I made a first pass on Option 2) https://github.com/ros2/rosbag2/pull/1851
To avoid touching code outside sequential_reader, I ignore all unsupported options (printing a warning), because the topic filter is set after open().
Summary
When logging data with a custom logger, I store both ROS2 data and additional custom data in MCAP files. Currently, attempting to play back these files with
ros2 bag play
results in an error due to mixed serialization formats. It would be useful if we could selectively play back compatible topics without encountering this issue.Current Behavior
Attempting playback with
ros2 bag play
returns the error:Even if specific topics are specified with the
--topics
flag,ros2 bag play
checks all topics, rather than just those specified.Desired Behavior
ros2 bag play
should play back topics with compatible formats (likecdr
) and skip topics with unknown formats.--topics
flag, only these topics should be validated and played back, ignoring the others.Completion Criteria
--topics
should be the only ones validated for serialization format.Suggested Implementation
Option 1: Update
mcap_storage.cpp
to generate metadata only for topics with "known" formats, ensuring playback compatibility.Option 2: Modify the behavior of the
--topics
flag inros2 bag play
to validate only the specified topics.Testing
cdr
messages and messages in an unknown format.ros2 bag play
:--topics
flag, without checking non-specified topics.