Skip to content

Make topics persistent between Recorder record() and stop() API calls #2234

@MichaelOrlov

Description

@MichaelOrlov

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

Completion Criteria

  1. The rosbag2_transport::Recorder can create channels before calling Recorder::record() API.
  2. The previously created channels via direct Recorder API calls shall be persistent between multiple record() and stop() 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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions