rosbag2 icon indicating copy to clipboard operation
rosbag2 copied to clipboard

How to read a mcap file recorded with OMGIDL encoding using rosbag2

Open karthiknit opened this issue 1 year ago • 2 comments

@MichaelOrlov I have a mcap file that contains data for foxglove::SceneUpdate message type with OMGIDL encoding. IDL file for this type is available here- https://github.com/foxglove/schemas/tree/main/schemas/omgidl/foxglove. Is it possible to read the mcap file in such a scenario using rosbag2? Also, Is there anyway to convert omgidl encoded mcap file to ros2msg or ros2idl encoded mcap file.

For information on different encodings in mcap see here - https://docs.foxglove.dev/docs/connecting-to-data/frameworks/custom#schema-encodings

karthiknit avatar Oct 02 '24 22:10 karthiknit

@karthiknit I am not familiar with Foxglove OMGIDL encoding. How is it different from the ros2idl? The ros2idl is also a subset of the OMGIDL. In theory, you should be able to open the recorded mcap file with the rosbag2:cpp or rosbag_py API. However, to be able to playback such a file, you will need to have built and sourced typesupports generated from message definitions stored in the local file system.

cc: @defunctzombie

MichaelOrlov avatar Oct 03 '24 00:10 MichaelOrlov

Have you tried to read the file? It is unclear from your question if you simply want to read the file with one of the APIs or want to ros2 bag play the file. My advice would be to try the specific workflow you want and see what works and what doesn't and come back with specific questions about those workflows.

Also, Is there anyway to convert omgidl encoded mcap file to ros2msg or ros2idl encoded mcap file.

In theory yes since you can read the file using one of the many mcap language libraries and produce a new mcap file. What you would need to do specifically depends on what is in your original file and what expectations you have of "reading the file with rosbag2".

defunctzombie avatar Oct 03 '24 14:10 defunctzombie

  • Closing as a stale issue with no response from the author.

MichaelOrlov avatar May 01 '25 23:05 MichaelOrlov