apollo icon indicating copy to clipboard operation
apollo copied to clipboard

cyber_recorder ROS Like Improvements

Open Fla3inH0tCheet0s opened this issue 7 years ago • 3 comments

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.

  1. It looks like RecordReader::ReadMessage always 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?

  2. 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.

Fla3inH0tCheet0s avatar Apr 13 '19 03:04 Fla3inH0tCheet0s

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.

baowanyu avatar Apr 19 '19 09:04 baowanyu

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.

baowanyu avatar Apr 19 '19 10:04 baowanyu

Closing this issue as it appears to be resolved. Feel free to reopen if you have additional questions. Thanks!

natashadsouza avatar Apr 19 '19 21:04 natashadsouza