How to Convert PCAP to ROS Bag for Ouster Sensors
This article describes the method for converting a network capture file (pcap) into a rosbag file that can be played back in the /ouster_example/ouster_ros ROS node.
Installing Dependencies
Install libpcap-dev
libtins-dev
$ sudo apt update
$ sudo apt install libpcap-dev libtins-dev
Installing pcap-to-bag
Clone the pcap-to-bag repository
$ git clone git@github.com:Krishtof-Korda/pcap-to-bag.git
Make a catkin_workspace
$ mkdir -p myworkspace/src && cd myworkspace
Symlink the pcap-to-bag folder into your ouster_example catkin_workspace
$ ln -s /path/to/ouster_example ./src/ && ln -s /path/to/pcap-to-bag ./src/
Build the catkin_workspace which includes ouster_example and pcap-to-bag
$ catkin_make -DCMAKE_BUILD_TYPE=Release
Converting a PCAP
After building, the
pcap_to_bag
executable will be in this folder:myworkspace/devel/lib/pcap_to_bag/
You can run the executable using
$ ./pcap_to_bag name_of_pcap.pcap name_of_bag.bag number_of_laser_channels
e.g. for a 128 channel sensor
$ ./pcap_to_bag my.pcap my.bag 128