cyber_recorder ROS Like Improvements
cyber_recoder is new and it seems based on an old rosbag implementation. It could benefit from borrowing a few ideas from newer rosbag implementations and design.
-
It looks like
RecordReader::ReadMessagealways does a linear search for messages. If the bags are large, it seems that it will take a long time to reach the desired location. Why not use a SQLite3 backend like rosbag2? -
ROS1 rosbag player supports latched messages playback from arbitrary starting times. The implementation has two parts. First, the recorder writes latched messages to each split file. Second, the reader finds the latched messages and publishes them accordingly. ROS1 rosbag has a reference implementation: https://github.com/ros/ros_comm/commit/22817eebf59bab1db136765f4839d5b2830a6f3c. In RTPS a latched message is like a publisher with durability QOS set to transient local. There's a design proposal with QOS for ROS2: https://github.com/ros2/ros2/issues/464.
Answer Question 1:
Yes, RecordReader::ReadMessage always does a linear search. But If the start and end time is provided, data chunk that do not meet the time range are skipped directly. This will be much faster. If the bags are large, it would be a better practice to cut the bag into smaller bags beforehand. Our design goal is to maximize data recording capabilities, direct file operations are our design choice.
Answer Question 2: Latched messages is already supported in communication module of Cyber RT. The record player had not provide latched messages playback right now. We will consider this requirement in the future.
Closing this issue as it appears to be resolved. Feel free to reopen if you have additional questions. Thanks!