PointCloud
points is (N, 3) float32 in header.frame_id; each channel has leading dimension N.
Full docstring
Channels keep their own dtype: `rgb` (N, 3) uint8, `intensity` (N,), `normals` (N, 3) ... WHY float32 points: half the memory of float64, and it is what PointCloud2 carries.
Preview
The figure robot_msgs.viz.plot(example) draws for the example below.

Fields
| Name | Type | Default |
|---|---|---|
points | Array | required |
channels | Mapping[str, Array] | {} |
header | Header | Header() |
Example
One instance from the package's own test catalog; the output is its real repr().
PointCloud(points=float32[100×3], channels={'rgb': uint8[100×3]}, header=Header(stamp=1761600000.25, frame_id='camera_color_optical_frame'))to_dict() as JSON
{
"_type": "sensor/PointCloud",
"points": {
"dtype": "<f4",
"shape": [100, 3],
"data": [0.9499886631965637, 0.591343343257904, 1.8206182718276978, 1.3160899877548218, -0.1465705782175064, 1.6935900449752808, 1.2241992950439453, -0.40974128246307373, 0.35544049739837646, 1.1388827562332153, 0.28662607073783875, 1.06144380569458, 0.44097617268562317, 0.7493008375167847, -0.2722027003765106, 0.4252520203590393, "… 284 more values"]
},
"channels": {
"rgb": {
"dtype": "|u1",
"shape": [100, 3],
"data": [248, 144, 15, 226, 89, 33, 204, 111, 83, 249, 230, 191, 40, 163, 158, 46, "… 284 more values"]
}
},
"header": {
"_type": "std/Header",
"stamp": 1761600000.25,
"frame_id": "camera_color_optical_frame",
"meta": {}
}
}Long arrays are cut after 16 values and say so with “…”.
Functions
Constructors
Classmethods and staticmethods: ways to build one.
from_depth(
depth: Image,
camera_info: CameraInfo,
rgb: Image | None = None,
) -> PointCloudBack-project a depth image through the pinhole model, row-major pixel order.
Methods
Return new values; messages are never mutated.
cropped(min_xyz: Array, max_xyz: Array) -> PointCloudPoints inside the axis-aligned box (edges included), channels filtered alike.
downsampled(voxel_size: float) -> PointCloudOne point per voxel_size cube: the first point (in cloud order) that falls in it.
transformed(transform: Transform) -> PointCloudRotate then translate the points. Channels are unchanged; set the new header.
to_dict
from Msgto_dict() -> dict[str, Any]JSON-safe dict with a "_type" key; arrays keep their dtype and shape.