Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For enabling snapshot feature you need to run bag node with the following parameters
ros2 bag record --max-cache-size 100000 --snapshot-mode /topic_you_want_to_record
The key --max-cache-size 100000 makes SequentialWriter to use rosbag2_cpp::cache::CircularMessageCache
and rosbag2_cpp::cache::CacheConsumer to process messages.
The key --snapshot-mode will enable rosbag2_interfaces::srv::Snapshot service.
The disadvantages of current implementation is that we are still writing data to the same file.
This PR will provide functionality of saving snapshot to separate file each time when we are calling
rosbag2_interfaces::srv::Snapshot service
For enabling new feature you need to provide the following parameters
storage_options_.max_bagfile_size = 1024*100;
storage_options_.storage_id = "mcap_snapshot";