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

Autodetect MCAP in rosbag2_cpp open #1158

Closed
doisyg opened this issue Nov 11, 2022 · 2 comments · Fixed by #1167
Closed

Autodetect MCAP in rosbag2_cpp open #1158

doisyg opened this issue Nov 11, 2022 · 2 comments · Fixed by #1167
Labels
enhancement New feature or request

Comments

@doisyg
Copy link

doisyg commented Nov 11, 2022

Description

Ongoing discussion with @clalancette here: ros2/cartographer_ros#67
Should rosbag automatically detects the bag format in the open method here ?

/**
* Opens an existing bagfile and prepare it for reading messages.
* The bagfile must exist.
* This must be called before any other function is used.
*
* \note This will open URI with the default storage options
* * using sqlite3 storage backend
* * using no converter options, storing messages with the incoming serialization format
* \sa rmw_get_serialization_format.
* For specifications, please see \sa open, which let's you specify
* more storage and converter options.
*
* \param storage_uri URI of the storage to open.
**/
void open(const std::string & uri);

And if yes, how ? Doing it based the file extension ?

Related:

  • Same for python api ?
  • Same for ros2 bag play cli ? (instead of passing the -s flag)
@doisyg doisyg added the enhancement New feature or request label Nov 11, 2022
@MichaelOrlov
Copy link
Contributor

@doisyg @clalancette MCAP or SQLite3 bags auto detection has already been done in #1072
It's already works for ros2 bag play

As regards to the aforementioned void open(const std::string & uri); CPP and Python API - will need to make one line fix
in

storage_options.storage_id = "sqlite3";

remove entire line with storage_options.storage_id = "sqlite3"; initialization.
If storage_options.storage_id is an empty string - SequentialReader will try to auto-detect storage plugin by file extension.

@emersonknapp
Copy link
Collaborator

I just ran into this myself and have a solution in #1167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants