ouster-lidar / ouster-ros

Official ROS drivers for Ouster sensors (OS0, OS1, OS2, OSDome)
https://ouster.com
Other
107 stars 129 forks source link

convert pcap to rosbag #13

Open tianshiz opened 2 years ago

tianshiz commented 2 years ago

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?

kairenw commented 2 years ago

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.

Ali-Darzi commented 2 years ago

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.

nighthawk2032 commented 1 year ago

@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)

jeychandar commented 1 year ago

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 :)

CantLooseToAMoose commented 1 month ago

@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.