point_cloud_transport package¶
Generic API working with possibly compressed pointclouds¶
Encoding and decoding of point clouds compressed with any point cloud transport.
Example usage:
from point_cloud_transport import decode, encode
from sensor_msgs.msg import PointCloud2
raw = PointCloud2()
... # fill the cloud
compressed, err = encode(raw, "draco")
if compressed is None:
rospy.logerr("Error encoding point cloud: " + err)
return False
# work with the compressed instance in variable compressed
# beware, for decoding, we do not specify "raw", but the codec used for encoding
raw2, err = decode(compressed, "draco")
if raw2 is None:
rospy.logerr("Error decoding point cloud: " + err)
return False
# work with the PointCloud2 instance in variable raw2