Skip to content
Design System
GitHub

Point cloud

v0.24.1Beta

A LiDAR or depth point cloud (a decoded ROS PointCloud2) drawn with raw WebGL2 and no 3D library: coloured by height or intensity on the accent's single-hue ramp with its scale, a recessive ground grid, the robot at the origin and an axes gizmo in words; orbit, pan and zoom by pointer, touch and keyboard; loading, empty, error, stale and no-WebGL states.

API reference

Generated from the types. Every part also takes className.

PointCloud

labelrequired
stringNames the view for screen readers, with the summary: "Front lidar, Patrol dog 7F3A".
pointsrequired
Float32Array<ArrayBufferLike>The points, x, y, z interleaved, in metres, in a ROS frame (REP 103: x forward, y left, z up), as decoded from a sensor_msgs/PointCloud2. NaN points are skipped. Pass a new array for each scan: it is uploaded once, and an array changed in place is not seen.
intensity
Float32Array<ArrayBufferLike>One intensity per point, in the same order.
colorBy
"height" | "intensity" | "none"What the colour shows. Defaults to intensity when intensity is given, else height; intensity without the array falls back to height.
colorRange
[number, number]Fixes the colour scale's ends (metres for height), so colours mean the same from one scan to the next. Defaults to the cloud's own range.
pointSize
number = 2The points' size in CSS pixels.
grid
boolean = trueThe ground grid on z = 0, in hairlines.
axes
boolean = trueThe gizmo that says which way x, y and z point, in words.
robot
boolean | { length: number; width: number; }The robot's footprint at the origin, facing +x: true for 0.9 × 0.6 m, or its own length and width in metres.
loading
booleanBones in the view while the first cloud loads.
error
ReactNodeThe cloud could not be loaded: true for the default words, or your own message.
onRetry
() => voidShows a button under the error that tries again.
staleAfterMs
numberWith no new cloud for this long, the view says "Stale" with when the last one arrived, and dims. Off by default.
receivedAt
numberWhen the cloud was taken (the message's header stamp, in ms since the epoch). Without it, when points arrived.
aspectRatio
number = 16 / 9Width over height of the view. 16 / 9 by default.
labels
Partial<PointCloudLabels>