| title | Convert .mat files to MCAP |
|---|---|
| short_description | Visualize Matlab files for NASA Valkyrie box pickup task |
This folder contains an example on how to generate MCAP files from .mat files typically used in MATLAB or Octave.
In this case, each variable is treated individually, one MCAP file is generated for each variable, for the sake of the example. However, multiple channels can be written to the same MCAP file. Please see also ROSCon Spain MCAP tutorial.
- The required file is already included in this repo, but if you want you can download the dataset from NASA Valkyrie Box Pickup.
-
Using Octave, save
box_pickup_ihmc.matas CSV. The scriptmat_to_csv.mwill load the.matfile and generate.csvfiles without headers. -
Run the script
csv_header.pyto add the header to each CSV file.
- Generate one
.mcapfile per.csvfile using the scriptscsv_to_mcap.pyorcsv_to_ros2_mcap.pyfor ROS 2 type messages.
- Using
ros2 bag converttool, merge all the.mcapfiles into one with the help of the scriptrosbag.bashand the configuration filemerge_mcap.yaml.
ros2 bag convert $(bash rosbag.bash) -o merge_mcap.yaml