-
Notifications
You must be signed in to change notification settings - Fork 287
Description
Description
We need to have the ability to create recording channels in advance, i.e., before calling Recorder::record () API call.
Also, it would be good to have discovered topics or recording channels created via direct record's API to be persistent between consecutive Recorder::record() and Recorder::stop () calls. The possible use case is for a distributed remote recording when the start and stop of the recording are initiated via service calls.
Related Issues
- This is a follow-up on the Direct API for the Rosbag2 recorder #2214
Completion Criteria
- The
rosbag2_transport::Recordercan create channels before callingRecorder::record()API. - The previously created channels via direct Recorder API calls shall be persistent between multiple
record()andstop()API calls.
Implementation Notes / Suggestions
In the current implementation, the exception thrown from the underlying rosbag2_cpp::wrtirer::create_topic(..) API when the rosbag2_cpp::wrtirer hasn't been opened yet or has already been closed.
We already maintain a topics list and the corresponding message definitions in the inner topics_names_to_info_ and topic_names_to_message_definitions_ writers' variables. However, we clean them up on writer::close() API calls.
The proposed solution is not to throw exceptions when trying to add new topics, but rather to keep them in the aforementioned internal variables and create topics in the underlying storage when the Writer::open() API is called.
Testing Notes / Suggestions
Unit tests need to be added on the rosbag2_cpp layer to verify completion criteria.