Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve snapshot feature #1

Open
wants to merge 3 commits into
base: iron
Choose a base branch
from

Conversation

dkorenkovnl
Copy link
Collaborator

@dkorenkovnl dkorenkovnl commented Mar 15, 2024

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";

@dkorenkovnl dkorenkovnl changed the title Improve storage for snapshot Improve snapshot feature Mar 15, 2024
@dkorenkovnl dkorenkovnl requested a review from Timple March 15, 2024 10:10
@Timple
Copy link
Member

Timple commented Mar 15, 2024

Can we limit by duration instead of size?

{
}

MCAPStorageSnapshot::~MCAPStorageSnapshot()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for destructors you can write:

MCAPStorageSnapshot::~MCAPStorageSnapshot() = default

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@dkorenkovnl dkorenkovnl force-pushed the iron_improve_snapshot_feature branch from 3830f06 to cc1f06c Compare March 15, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants