Skip to main content

VoxelGrid

A 3D grid of data

Schema

fieldtypedescription
timestampTimestampTimestamp of grid
frame_idstringFrame of reference
posePoseOrigin of grid's corner relative to frame of reference
row_countuint32Number of grid rows
column_countuint32Number of grid columns
cell_sizeVector3Size of single grid cell along x, y, and z axes, relative to pose
slice_strideuint32Number of bytes between depth slices in data
row_strideuint32Number of bytes between rows in data
cell_strideuint32Number of bytes between cells within a row in data
fieldsPackedElementField[]Fields in data. red, green, blue, and alpha are optional for customizing the grid's color.
databytesGrid cell data, interpreted using fields, in depth-major, row-major (Z-Y-X) order.

data

For the data element starting at byte offset i, the coordinates of its corner closest to the origin will be: z = i / slice_stride * cell_size.z y = (i % slice_stride) / row_stride * cell_size.y x = (i % row_stride) / cell_stride * cell_size.x

Reference implementations

Foxglove schemas are framework-agnostic, and can be implemented using any supported message encoding:

encodingschema
ROS 1foxglove_msgs/VoxelGrid
ROS 2foxglove_msgs/msg/VoxelGrid
JSONfoxglove.VoxelGrid
Protobuffoxglove.VoxelGrid
FlatBuffersfoxglove.VoxelGrid
OMG IDLfoxglove::VoxelGrid

You must use the schema names specified above for Foxglove to recognize the schema.