Inquiry Regarding Use of --meta Option in ouster-cli with Existing Bag Files

,

I recently discovered that ouster-sdk version 0.14 supports playback of bag files, which is a very helpful feature. I wanted to test this with a previously recorded bag file, but I noticed that the file does not contain any embedded metadata. Upon inspecting the file, I found the following topic structure:

types:       sensor_msgs/Imu         [6a62c6daae103f4ff57a132d6f95cec2]
             sensor_msgs/PointCloud2 [1158d486dd51d683ce2f1be655c3c181]
topics:      /ouster/imu      6149 msgs    : sensor_msgs/Imu        
             /ouster/points    615 msgs    : sensor_msgs/PointCloud2

I do have the corresponding metadata file in JSON format (i.e., test.json) alongside the bag file (test.bag), and I noticed that ouster-cli includes a --meta (or -m) option. However, I have not been able to successfully use this option, and I’m unsure about the correct usage.

Could you please advise on how to properly utilize the --meta option with an existing .bag file and a separate metadata .json file?

Any guidance you can provide would be greatly appreciated.

Thank you very much for your support.

Best regards,

Hi @victo, I do think that there was an issue with the handling of --meta in SDK version 0.14 which should be addressed in the upcoming 0.15 release.

Normally you should be able to simply do the following to use legacy ouster-ros bag files (i.e. ones without embedded metadata):

ouster-cli source --meta /path/to/sensor-metadata.json /path/to/bagfile.bag command

where command can be any chain-able operation such as the save or the viz command, ..

For the time being (until the release of the new sdk) if you are familiar with ROS, you could try to bake in the json file into the bag file using our ouster-ros driver, simply do the following:

Open a first terminal and spin a bag record command as follows:
Terminal 1)

rosbag record -O /path/to/save.bag /ouster/metadata /ouster/imu_packets /ouster/lidar_packets

In a 2nd terminal use ouster-ros to replay the bag file using the following command:
Terminal 2)

roslaunch ouster_ros replay.launch metadata:=/path/to/sensor-metadata.json bag_file:=/path/to/bagfile.bag

This should produce a bag file named /path/to/save.bag which readily has the metadata topic baked into it and should be possible to readily replay using the current ouster-cli command.

@Samahu
Thank you very much for your kind and detailed response.

I tried the method you suggested using the --meta option with ouster-cli, but unfortunately, I’m still encountering errors.

I also followed the instructions to create a new bag file from ROS, as recommended. However, I noticed that the topic in the bag file I’m currently testing is /ouster/points, whereas the example command assumes the topic is /ouster/lidar_packets. Because of this mismatch, the example command did not work as expected.

I attempted to modify the command to use /ouster/points instead, and although it allowed me to generate the metadata file, I still encountered errors when running ouster-cli with the updated files.

In any case, I really appreciate your support and guidance throughout this process.

The /ouster/points contains PointCloud2 message which is different from the topic /ouster/lidar_packets which has the raw packets. In the record command I mentioned specifically you need to capture the following topics:

rosbag record -O /path/to/save.bag \
    /ouster/metadata \
    /ouster/imu_packets \
    /ouster/lidar_packets

It is ok to have other topics in the bag file but you need these three topics in the bag file.

Thank you again for your kind and detailed support.

I now understand that in order to use the following rosbag record command:

rosbag record -O /path/to/save.bag \
    /ouster/metadata \
    /ouster/imu_packets \
    /ouster/lidar_packets

the bag file must already include the following topics:

topics:      /ouster/imu_packets  
             /ouster/lidar_packets

I was wondering whether launching with the latest ouster-ros driver would result in the /ouster/lidar_packets topic being recorded automatically when using rosbag record.
Thanks to your explanation, I now understand that the /ouster/lidar_packets topic must be included in the bag file.
I appreciate your help in clarifying this point.

I see where the problem is, we currently don’t support the playback of PointCloud2 messages via ouster-cli, only bag files with raw packets. That may change in the future however so stay tuned. For the time being you can replay these files directly through rosbag and rviz or use the ouster-ros driver the back bag file. The benefit of using the ouster-ros driver that it can parse the metadata json and then publish the TF frames associated with the sensors so you can use select them in RVIZ in the global frame to view the data in the appropriate frame.