Skip to main content

Module ros

Module ros 

Source
Expand description

ROS integration — compress and decompress PointCloud2Msg using the Cloudini format.

Enable the ros feature in your Cargo.toml:

[dependencies]
cloudini = { version = "*", features = ["ros"] }

§Compressing a cloud

use cloudini::ros::{CompressExt, CompressionConfig, PointCloud2Msg};
use ros_pointcloud2::points::PointXYZ;

// one line — 1 mm resolution, ZSTD compression
let compressed = cloud_msg.compress(CompressionConfig::lossy_zstd(0.001)).unwrap();

// ship `compressed` over the network or store it

§Decompressing

use cloudini::ros::{CompressExt, CompressionConfig, PointCloud2Msg};
use ros_pointcloud2::points::PointXYZ;

let cloud_msg = compressed.decompress().unwrap();
// cloud_msg is a PointCloud2Msg ready for downstream processing

§Re-exported types

Common ros_pointcloud2 types are re-exported here so you only need one import: PointCloud2Msg, HeaderMsg, PointFieldMsg, TimeMsg, FieldDatatype, CloudDimensions, Endian, Denseness.

Structs§

ArchivedCompressedPointCloud2
An archived CompressedPointCloud2
CloudDimensions
Dimensions of the point cloud as width and height.
CompressedPointCloud2
The point_cloud_interfaces/msg/CompressedPointCloud2 ROS message type.
CompressedPointCloud2Resolver
The resolver for an archived CompressedPointCloud2
CompressionConfig
Controls how a PointCloud2Msg is encoded and compressed.
HeaderMsg
Represents the header of a ROS message.
PointCloud2Msg
The intermediate point cloud type.
PointFieldMsg
Describing a point encoded in the byte buffer of a PointCloud2 message. See the official message description for more information.
TimeMsg
Describing a point encoded in the byte buffer of a PointCloud2 message. See the official message description for more information. Time representation for ROS messages.

Enums§

Denseness
Density flag for the message. Writing sparse point clouds is not supported.
Endian
Endianess encoding hint for the message.
FieldDatatype
Datatypes from the PointFieldMsg.

Traits§

CompressExt
Extension trait that adds .compress() directly to PointCloud2Msg.