ouster-ros icon indicating copy to clipboard operation
ouster-ros copied to clipboard

convert pcap to rosbag

Open tianshiz opened this issue 3 years ago • 5 comments

I see in the sdk that we can convert a pcap to csv. But is there a way to do this and convert to a rosbag with sensor_msg/PointCloud2 and sensor_msg/imu msg format? If not, how do we take the row by row extracted in the csv demo and extract the imu and lidar data separately?

tianshiz avatar Oct 30 '21 00:10 tianshiz

Hi @tianshiz,

Unfortunately, we do not currently support converting pcaps to rosbag with those message types. I recommend using the ouster_ros driver if you wish to capture bags.

The csv demo only records the lidar data currently. If you'd like to batch lidar packets and capture imu packets, and record their values to csv, I suggest that you work with the packets directly using a PacketSource on the python side.

kairenw avatar Nov 29 '21 20:11 kairenw

Conversion of Pcap to rosbag is doable using this code to use it, clone the repo to the source folder of you Catkin workspace, the same workspace as ouster_example. After building, use ./pcap_to_bag to convert pcap to rosbag. To keep the output file size as small as possible, the output of os_node (which are imu_packets and lidar_packets) can be found in the rosbag file. To have the output of os_cloud_node (imu and PointCloud), the ouster_ros master should be running on another terminal. It will act as a translator that listens to the os_node.

Ali-Darzi avatar Jun 01 '22 17:06 Ali-Darzi

@Ali-Darzi seems the code you were referring to does work, and seems to convert the ouster .pcap to .bag file properly.. maybe I am missing something, but rosbag play {the_created_bag_file} doesn't enable me to create visualization on the RVIZ.. what am I doing wrong? is something missing in the process I am running? (I can play other sampled .bag files and create their visualization on RVIZ properly)

nighthawk2032 avatar Jan 01 '23 15:01 nighthawk2032

Hey I wish ouster os1-32 with internal IMU should work but was happening is I convert pcap to rosbag and replay that using replay launch and record that bag. It seems that the visualization mapping is not working properly. It jitters a lot. I am not sure what was the problem. Could anyone help me out with this issue. Thanks in advance :)

jeychandar avatar May 03 '23 10:05 jeychandar

@Ali-Darzi

Conversion of Pcap to rosbag is doable using this code to use it, clone the repo to the source folder of you Catkin workspace, the same workspace as ouster_example. After building, use ./pcap_to_bag to convert pcap to rosbag. To keep the output file size as small as possible, the output of os_node (which are imu_packets and lidar_packets) can be found in the rosbag file. To have the output of os_cloud_node (imu and PointCloud), the ouster_ros master should be running on another terminal. It will act as a translator that listens to the os_node.

Can you go into further detail on how to translate the created bag file to the right topic format? I am no expert in this field. Which launch file would i use for the "translation"? When I try to use replay.launch only the original topics do get replayed.

CantLooseToAMoose avatar May 27 '24 07:05 CantLooseToAMoose