Decoder for raw Velodyne packet data
Project description
velodyne_decoder
Python package and C++ library for Velodyne packet decoding. Point cloud extraction from PCAP and ROS bag files is supported out of the box.
The decoded point clouds are provided either as a structured NumPy array:
array([(8.327308, -2.161341, 0.3599853, 85., 17, -0.04960084),
(8.323784, -2.9578836, 0.27016047, 102., 15, -0.04959854),
(8.184404, -2.845847, -0.8741639, 39., 2, -0.04959623), ...,
(8.369528, -2.8161895, 2.307987, 17., 31, 0.00064051),
(8.377898, -3.2570598, 1.7714221, 104., 30, 0.00064282),
(8.358282, -2.8030438, 0.31229734, 104., 16, 0.00064282)],
dtype={'names': ['x', 'y', 'z', 'intensity', 'ring', 'time'],
'formats': ['<f4', '<f4', '<f4', '<f4', '<u2', '<f4'], 'offsets': [0, 4, 8, 16, 20, 24], 'itemsize': 32})
or as a contiguous array of floats (default):
array([[8.327308, -2.161341, 0.3599853, 85., 17., -0.04960084],
[8.323784, -2.9578836, 0.27016047, 102., 15., -0.04959854],
[8.184404, -2.845847, -0.8741639, 39., 2., -0.04959623],
...,
[8.369528, -2.8161895, 2.307987, 17., 31., 0.00064051],
[8.377898, -3.2570598, 1.7714221, 104., 30., 0.00064282],
[8.358282, -2.8030438, 0.31229734, 104., 16., 0.00064282]], dtype=float32)
The layout of the structs matches the layout of PointXYZIRT
point cloud points output by the ROS driver.
Installation
Wheels are available from PyPI for Linux, MacOS and Windows. Python versions 2.7 and 3.6+ are supported.
pip install velodyne-decoder
Alternatively, you can build and install the development version from source.
sudo apt-get install cmake build-essential python3-dev
pip install git+https://github.com/valgur/velodyne_decoder.git
Usage
Decoding Velodyne data from a ROS bag
import velodyne_decoder as vd
config = vd.Config(model='VLP-32C')
bagfile = 'xyz.bag'
lidar_topics = ['/velodyne_packets']
cloud_arrays = []
for stamp, points, topic in vd.read_bag(bagfile, config, lidar_topics):
cloud_arrays.append(points)
The rosbag
library must be installed. If needed, you can install it without setting up the entire ROS stack with
pip install rosbag --extra-index-url https://rospypi.github.io/simple/
To extract all VelodyneScan
messages in the bag you can leave the list of topics unspecified.
The header timestamp from the scan messages will be returned by default. To use the message arrival time instead
set use_header_time=False
.
To return arrays of structs instead of the default contiguous arrays, set as_pcl_structs=True
.
Decoding Velodyne data from a PCAP file
import velodyne_decoder as vd
config = vd.Config(model='VLP-16', rpm=600)
pcap_file = 'vlp16.pcap'
cloud_arrays = []
for stamp, points in vd.read_pcap(pcap_file, config):
cloud_arrays.append(points)
config.model
and config.rpm
must be set.
To return arrays of structs instead of the default contiguous arrays, set as_pcl_structs=True
.
Configuration
The main parameter config.model
must always be set. For a list of supported model IDs see
>> > velodyne_decoder.Config.SUPPORTED_MODELS
['HDL-32E', 'HDL-64E', 'HDL-64E_S2', 'HDL-64E_S3', 'VLP-16', 'VLP-32C', 'VLS-128']
Note that timing info is available for only a subset of the models:
>> > velodyne_decoder.Config.TIMINGS_AVAILABLE
['HDL-32E', 'VLP-16', 'VLP-32C', 'VLS-128']
Other available options are:
calibration_file
– the beam calibration details from Velodyne are used by default based on the model ID. If you however wish to use a more specific calibration, you can specify one in the YAML format used by the ROS driver.min_range
andmax_range
– only return points between these range values.min_angle
andmax_angle
– only return points between these azimuth angles.
Options only applicable to PCAP decoding:
rpm
– the device rotation speed in revolutions per minute.gps_time
– use the timestamp from the packet's data if true, packet's arrival time otherwise (default).timestamp_first_packet
– whether the timestamps are set based on the first or last packet in the scan
Authors
- Martin Valgur (@valgur)
The core functionality has been adapted from the ROS velodyne driver.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file velodyne-decoder-2.1.0.tar.gz
.
File metadata
- Download URL: velodyne-decoder-2.1.0.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4a05f6604d063e6590baa69680cb7b59281732f75ab636ddc8535eefdb49d0e |
|
MD5 | 91d710ecea7155b1d8442e3390a06590 |
|
BLAKE2b-256 | 0509ba4b379911e6650e60e2121d40edf3468338530d8a831ce3f2e81d6b9399 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 205.0 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b8f5863b79e644b1c58a7e2fe75d2f521dd060767ae98bf70ef1e2e727c8429 |
|
MD5 | bb673e0cf83f9f8cc3be2211912e2c41 |
|
BLAKE2b-256 | 7b18e7ac761c6f4c14f3531105bdb814cb5335077ccf6334024960db24420cbe |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp39-cp39-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp39-cp39-manylinux2010_x86_64.whl
- Upload date:
- Size: 380.2 kB
- Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fb0be8a9e16c6fb8ef93bafd74b8f9cd1985b5add1fb0312eb98b0def127b2f |
|
MD5 | 74ff7787e61a35481dc8271b90d7d840 |
|
BLAKE2b-256 | f5c5a6222f4bb6a7e8ad3da8c08b101b5d7f980a371e933485def6bac1dc8de4 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 258.5 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc3e5bf6b5fd29b6ea86b95994dd1f5bff8b504e01ca0c6987aeb3e8a5584fce |
|
MD5 | ea21619720289d058ebf66a5f0819e0f |
|
BLAKE2b-256 | 954873d70f7beacc851c0a769070b39b318ab1dced0e5a907f2656c5d4e44f21 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 208.0 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bffbe83116d3913be63ada81c7bce8970191f52cec6095ba095da840992dee1 |
|
MD5 | 5c398b761760d25b201d2c1dd1fd0fae |
|
BLAKE2b-256 | 2d3aeaa15e3571964a80f9a418798583ef17d5f1d04ba89ec597ce42e7028b69 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp38-cp38-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp38-cp38-manylinux2010_x86_64.whl
- Upload date:
- Size: 380.0 kB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e6cc8c98d7842723d32e75f152e6a915824ec6c58a8911f387a6730f5bab52f |
|
MD5 | 9edcbeb27884e332d3fa0ada93087d35 |
|
BLAKE2b-256 | 37b72e5cf76bed5e88b2813f720c2acb2a3ad066fec5fd6216fd451eb6635413 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 258.5 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3919396b50141f9c8ee528c82050cf6f6c912f65ee5b9df74260ec76d6ffcc1c |
|
MD5 | 86062825f80c32e239c947ece28c5de8 |
|
BLAKE2b-256 | 124e2a643fd24e774a63ce219115d44e95f1fa30188c10da79e205c99f47d90c |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 209.0 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07f517f7b57bdbecfb3e296c2ea1e9fa03c272951ace69002ee660134a8acae8 |
|
MD5 | 222de260b859b09371aaf46aec306587 |
|
BLAKE2b-256 | ae3305061c03e2d98c17285b74de18fd2e01d15fc39e969e48f8f4fc128e2956 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp37-cp37m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp37-cp37m-manylinux2010_x86_64.whl
- Upload date:
- Size: 381.8 kB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef2d9038cdccfb024091562e7b78990d3c50e2ed17085ad08b3572e01381e6e7 |
|
MD5 | 2dc305c39a47cd5f51c785fe83d33782 |
|
BLAKE2b-256 | 3d231292712709c2bb4c2f954fcf3ff04dd7bd56b98cfc90175a0113a892e754 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 257.2 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7dca351dc302fc84a75781eb248306ea3c7c0bf4a7075f59879a7cead4305a6 |
|
MD5 | dd445a64fab99bfcdffb3ee34362ae9d |
|
BLAKE2b-256 | 6c57b6c4e0068b36598094e4469006c28264daf4069c1b236f886c05b3f1b2d8 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 209.0 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe17b8ced1fc568080f302b355183772182a946dfbeb1c845e0bd03b04522e0e |
|
MD5 | 526843495000dff53f00f3fcb40948d4 |
|
BLAKE2b-256 | 9bad163903491b8cf83859279e4bb6c54d290d826482d9f32126ee8d1739e4fe |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp36-cp36m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp36-cp36m-manylinux2010_x86_64.whl
- Upload date:
- Size: 381.7 kB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c27a7d3dab16814e92b821c8441ebb6fe0dbfb57f1077fc8430fde892657cef |
|
MD5 | 069132ee5bd28ee75d82e154bb0eea36 |
|
BLAKE2b-256 | a04109fc4b793b5910b8c833370cfa3fc615f4ecc24194c3dcd8931e195db0d8 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp36-cp36m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp36-cp36m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 257.2 kB
- Tags: CPython 3.6m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 762bdf36b19c25dc7e0714d7c4780c856a177e5e74dcc295971e0632258dd318 |
|
MD5 | df5a6587918453679eb2ad0b884e821e |
|
BLAKE2b-256 | ecbf7c817690a7315c15f831d4903c15db51d70abcfa86086c3be9d731e9d28a |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 209.0 kB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cca6793dd37bc63255a11faaacdea462c1f951f4ccaa3ce0b1d63d3ccf94ddc |
|
MD5 | d0295cc29e3839a86a8a4cf518968bd7 |
|
BLAKE2b-256 | 49340c9aabd3872fe73abee459082f78e088c6b955f8f4a2124faac817f27850 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp35-cp35m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp35-cp35m-manylinux2010_x86_64.whl
- Upload date:
- Size: 381.7 kB
- Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10f66c57d885516578f277469ceec4604e27bea5b7280927700e08a24cc6eaec |
|
MD5 | e60de92ee5f03ae7f11c789561b548ad |
|
BLAKE2b-256 | 9ed6107568595dcbba9cd9d6a0a39c1c444df178d92e187506879fd19e8e4ec9 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp27-cp27mu-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp27-cp27mu-manylinux2010_x86_64.whl
- Upload date:
- Size: 381.9 kB
- Tags: CPython 2.7mu, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94b6aa47967316740b2af69b77a941a7bdf38455f178fc61679c222d76e4f3ca |
|
MD5 | 0952d37fcdbd2b342d3500a269706e38 |
|
BLAKE2b-256 | 35d60e4514403528c8707df7c0e4f4f7941c4c2e8f1d98b60d8548d32901d6c4 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp27-cp27m-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp27-cp27m-win_amd64.whl
- Upload date:
- Size: 209.6 kB
- Tags: CPython 2.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3edb4dbc1767ca78ac10a69ad254a53e003a80138bd0ccf063bdcecf57f29f0a |
|
MD5 | aa152ba11a91dd6191ccf933c9b6756e |
|
BLAKE2b-256 | 262c840bf7d75286d516635c577f7330defb0c8c107c93c4fe2fa62facd0a0e1 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp27-cp27m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp27-cp27m-manylinux2010_x86_64.whl
- Upload date:
- Size: 381.9 kB
- Tags: CPython 2.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1e6d099dfc9920f495de6c586a6ee34439e0fc7db8f2b113f62fd5a2b21aae0 |
|
MD5 | ee73f32ee070c692afa0891e1f131404 |
|
BLAKE2b-256 | fbb80962af2eb2d727c8fcac6e9e0bb75e4b26c0e78d0c27d1d60f681cf26f16 |
Provenance
File details
Details for the file velodyne_decoder-2.1.0-cp27-cp27m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.1.0-cp27-cp27m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 257.5 kB
- Tags: CPython 2.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb8c3190b17252c72d04a25db07a0b652e2b97498ad1b21e421150ee95878030 |
|
MD5 | ceac7804952333140468b627bda21cd1 |
|
BLAKE2b-256 | 0a7d258c132154b32a2f48f352f7b0c4b0b9c792940a58e20a72ece2a1eb8329 |