PointCloud2 lib for non ROS environments
Project description
PointCloud2
PointCloud2 lib for non ROS environment.
Usage
>>> import numpy as np
>>> from pointcloud2 import create_cloud, read_points, PointField
>>> fields = [
... PointField('x', 0, PointField.FLOAT32, 1),
... PointField('y', 4, PointField.FLOAT32, 1),
... PointField('z', 8, PointField.FLOAT32, 1),
... PointField('rgb', 12, PointField.UINT32, 1),
... ]
>>> points = np.array([
... [1, 0, 0, 255],
... [0, 1, 0, 255],
... [0, 0, 1, 255],
... ], dtype=np.float32)
>>> cloud = create_cloud(header=None, fields=fields, points=points)
>>> cloud.height, cloud.width, cloud.point_step, cloud.row_step, len(cloud.data)
(1, 3, 16, 48, 48)
>>> read_points(cloud)
array([(1., 0., 0., 255), (0., 1., 0., 255), (0., 0., 1., 255)],
dtype=[('x', '<f4'), ('y', '<f4'), ('z', '<f4'), ('rgb', '<u4')])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pointcloud2-0.2.1.tar.gz
(7.8 kB
view hashes)
Built Distribution
Close
Hashes for pointcloud2-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35c2f87460620db2ebb4d261ad1f193be157075a351800fb74899bb6e854e81f |
|
MD5 | a9f3f5411cb845789887b00424da9955 |
|
BLAKE2b-256 | aa7119a0144002153a683a84ee445dc815a5990190541e6651178c60419569d5 |