Most Velodyne lidar drivers are needlessly complex, or specifically written for a particular middleware (e.g. ROS). This repo contains minimal, lightweight code to build shared libraries to interface to and decode packets from the Velodyne HDL (and VLP-16) family of lidars.
- PacketDriver: builds to PacketDriver.so, a library to read (via boost::asio) Velodyne packets streamed to UDP port 2368.
- PacketDecoder: builds to PacketDecoder.so, a library to decode (convert to x, y, z, intensity, etc.) Velodyne packets.
- PacketFileSender: builds to PacketFileSender, an executable to stream packets from a pcap file to UDP port 2368 (slightly modified code from VTK)
- PacketFileReader: a header file to read packets from a pcap file (code from VTK)
- PacketFileWriter: a header file to write packets to a pcap file (code from VTK)
- PacketBundler: builds to PacketBundler.so, a library to bundle streamed Velodyne packets into enough for a frame (a full 360 degree sweep) - useful if your middleware cannot handle the rate of Velodyne packet streaming (~1.8kHz)
- PacketBundleDecoder: bulds to PacketBundleDecoder.so, a library to decode a bundle of Velodyne packets
Under the tests directory you can find example code on how to use the PacketDriver and PacketDecoder libraries, as well as the PacketFileWriter header.
sudo apt-get install libpcap-dev
sudo apt-get install libboost-all-dev
mkdir build
cd build
cmake ..
make
export PATH="PATH:/..../path/to/build
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/..../path/to/build"
export LIBRARY_PATH="$LIBRARY_PATH:/..../path/to/build"
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/..../path/to/source"
PacketFileSender pcap_file.pcap
test_PacketDriver
test_PacketDecoder
test_PacketWriter
test_PacketBundler
test_PacketBundleDecoder