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.0.0.tar.gz
.
File metadata
- Download URL: velodyne-decoder-2.0.0.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 872a49c519262cd9f7b8b779b042187584a376623123f1983f09a64d2823076b |
|
MD5 | a775ce16506253d17fdd69219057ed4a |
|
BLAKE2b-256 | 0fc309e12921ca9a7bc3a64e2caea521fcb39d049cfbe4d1f61270f2ab0a587e |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 204.5 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2415352fd18031bf093e443c149d259e8acd084cf435254ffb9c7d094005cc2d |
|
MD5 | d6d17e72f0a4558f064a58c8424b56c9 |
|
BLAKE2b-256 | b6c4002631ddbdc49dc6bff0ab781ba1d24d128ec94d00b5def03c8414aa2607 |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp39-cp39-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp39-cp39-manylinux2010_x86_64.whl
- Upload date:
- Size: 369.0 kB
- Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c500301d1bea95ef8a0462fd3c066c0bb6b997eb988a5063fbb887db27c448b |
|
MD5 | 6b3f8de4775218ed6a51c8b32c735e59 |
|
BLAKE2b-256 | 484831301487c35ca593886ddfcba29bbae57af5e87ad0c4961007e791ee79a1 |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 241.2 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 980cb48f9eab831fe8949d1c044831f42e629465b5deca60da55e58186e51e85 |
|
MD5 | 32ce051efb7aa562bf1287a8038dae2c |
|
BLAKE2b-256 | 8be2394f838059c5379615b88c209fd446f151c0068059ef0314cf0bcca1eecc |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 207.3 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7e296606132cb69f7fedbe7b99c6804de4921bef03e9c51669f48d0b8c3bcc0 |
|
MD5 | 428e111c7b44b26017ee72e0184f1084 |
|
BLAKE2b-256 | fba59fdb1b91bd1192c26cf7be98e5f97aa57098937ca88706945d58735f164c |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp38-cp38-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp38-cp38-manylinux2010_x86_64.whl
- Upload date:
- Size: 368.7 kB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffa6224a89081f3e40331571902ff2a826852799798219dc36b106b60678d749 |
|
MD5 | e1c82df684af55a3bbbb2d4c01a7179d |
|
BLAKE2b-256 | 1c8b375296db56c23ef547facf96f55a24d6b2c4ea0c9781326ca9c431237254 |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 241.1 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25ab068135d2da290bf723d96b387190f6dbc1c47ddbe6f0f8b8cc7893fdd1b2 |
|
MD5 | 3334718d40a5071080482f8f1a4093eb |
|
BLAKE2b-256 | 347b5d4319a7bb6d60f78fb175d3e212428c4865195c832078d486d36760971f |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 208.4 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8f7e30e39ef3f28b793be0fcf36c413065f76e272b5176dd814261a83fc69c1 |
|
MD5 | 457c2a68c8c8f0f5eb7d38466d9dd670 |
|
BLAKE2b-256 | c22311c7f9547c18130061597559213a1c805c16efcf019623df40d40e3d2718 |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp37-cp37m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp37-cp37m-manylinux2010_x86_64.whl
- Upload date:
- Size: 370.4 kB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34e52a9ad6ebf78582f2c7cf7071eb4b961c89fb6ec3e128b52326f24faaf415 |
|
MD5 | 19794bdfb3bf531fba0b6ac30a31c0b2 |
|
BLAKE2b-256 | cedc5bdcf002f68b06b20c30935335aa811a18cec18f7002cb2b8745f075613a |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 239.6 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a11f79f92d209a72ab85ac4ac0c32fd4763911ae573973a827829dab136f73aa |
|
MD5 | 6b0c756ba6a4a9ea5c74f72e313b6ed8 |
|
BLAKE2b-256 | 871ca97fefbc3b4a553e3a14741768d14ce99827aff54acbc1b1cba6f90729cd |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 208.5 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0549645ff5e0b5e5f7e48baf7a712abb07636fd1a057639bef0043072266e3e1 |
|
MD5 | 0e295410871db4f68115d5d2ee4b0e76 |
|
BLAKE2b-256 | 997ec3f5e2ae826d6387b92c09eac08bbeda090054dc2a374befa9289f307e00 |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp36-cp36m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp36-cp36m-manylinux2010_x86_64.whl
- Upload date:
- Size: 370.3 kB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77d48c6a49e63cd4b5b332d67aac8501d7d2c1fe68505839a2f4fb5fb4226200 |
|
MD5 | b2e9c1b2b8b83a05731b5f1b96df9439 |
|
BLAKE2b-256 | 48942694d775c3004abbffa5bbf405dc224983fe7887a7a54d68c3c9305d3fb3 |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 239.6 kB
- Tags: CPython 3.6m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b618d660ff973ec6e0c49884057aeee8e56dd331f25f391236dc53d51f8b9388 |
|
MD5 | d1af63826d8611f548ad921aff73c9e8 |
|
BLAKE2b-256 | 98b950c0885b1536cad3ae57c4aa8b54ca092cd0234f49cf0d5d3ecc12383860 |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 208.4 kB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58088a5d9feefe0bb6ad995e21a0dc0f4480b47fe1d76c0d519a2e1850284413 |
|
MD5 | 0f7d2158f73848a3bfba6a0197328bba |
|
BLAKE2b-256 | 785222e67a2c0bd79f5b0c286912c75f4223e3bfd0a2998e5a69aa17158cd9c8 |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp35-cp35m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp35-cp35m-manylinux2010_x86_64.whl
- Upload date:
- Size: 370.3 kB
- Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb1c55a3d8f1b447e56ec157b98282b6890f749ce5fa0280432a48f9632893dd |
|
MD5 | 9df4e7d89c3bd8d6df08f0094c60288e |
|
BLAKE2b-256 | 71fbaa37a7d632a75c4555bc6acab80aed60c93563b644cdff66218dcb19966e |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp27-cp27mu-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp27-cp27mu-manylinux2010_x86_64.whl
- Upload date:
- Size: 370.8 kB
- Tags: CPython 2.7mu, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4425f42986b62fb6e6d7dfe057dd3d47b064f8b1c52e06b672d4dd673a4c2091 |
|
MD5 | f9feb99ef26b473f89fbedafd4f7bfbb |
|
BLAKE2b-256 | e8cc9bcef4365b81149d1851804b444e85c7a8dfe7eefacad3263570095f70bc |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp27-cp27m-win_amd64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp27-cp27m-win_amd64.whl
- Upload date:
- Size: 209.2 kB
- Tags: CPython 2.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85ce85c0331eb92779cd1402e0b4199068bcd2bb8480a8f43f610d32171a7db3 |
|
MD5 | ac204ff11058a0fe93c51a9b1c4cf219 |
|
BLAKE2b-256 | 41ba88acc38f411cfa5a783441812de579e573504e3053e9d10634a4fa9b5477 |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp27-cp27m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp27-cp27m-manylinux2010_x86_64.whl
- Upload date:
- Size: 370.8 kB
- Tags: CPython 2.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb377e2d5f02151cb512875cf2e44f4594841d79bcd1207472f0e43bb010f386 |
|
MD5 | 67edf24ac839e3c808b41c9f74904fb4 |
|
BLAKE2b-256 | ad669f569a1dd1084fdb5edd44b34c9a4d91e7c12aec3bf283587ee0f0ff07c1 |
Provenance
File details
Details for the file velodyne_decoder-2.0.0-cp27-cp27m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: velodyne_decoder-2.0.0-cp27-cp27m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 239.9 kB
- Tags: CPython 2.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 654a9197f7483667e7f65451dc7cc263dd9a4ea38ee6dcf8670e1c157e8423f9 |
|
MD5 | 3da909cca787c407f9c5f91d4858e526 |
|
BLAKE2b-256 | 11f7b7f9c268d71f55921ea8d3020cddcfd8efe0185727a64745f6b2cc68e1b6 |