Rerun C++ SDK
Loading...
Searching...
No Matches
rerun::archetypes::VoxelGridMap Struct Reference

Archetype: A sparse 3D voxel grid map with grid indices and voxel dimensions. More...

#include <rerun/archetypes/voxel_grid_map.hpp>

Public Member Functions

 VoxelGridMap (VoxelGridMap &&other)=default
 
 VoxelGridMap (const VoxelGridMap &other)=default
 
VoxelGridMapoperator= (const VoxelGridMap &other)=default
 
VoxelGridMapoperator= (VoxelGridMap &&other)=default
 
 VoxelGridMap (Collection< rerun::components::VoxelIndex > _voxel_indices, rerun::components::VoxelSize _voxel_size)
 
VoxelGridMap with_voxel_indices (const Collection< rerun::components::VoxelIndex > &_voxel_indices) &&
 Indices of the voxels within the grid volume.
 
VoxelGridMap with_voxel_size (const rerun::components::VoxelSize &_voxel_size) &&
 The scene-unit dimensions of a single voxel cell.
 
VoxelGridMap with_many_voxel_size (const Collection< rerun::components::VoxelSize > &_voxel_size) &&
 This method makes it possible to pack multiple voxel_size in a single component batch.
 
VoxelGridMap with_values (const Collection< rerun::components::VoxelValue > &_values) &&
 Optional scalar occupancy or value data for each voxel.
 
VoxelGridMap with_colors (const Collection< rerun::components::Color > &_colors) &&
 Optional colors for each voxel.
 
VoxelGridMap with_translation (const rerun::components::Translation3D &_translation) &&
 Translation of the minimum corner of voxel [0, 0, 0].
 
VoxelGridMap with_many_translation (const Collection< rerun::components::Translation3D > &_translation) &&
 This method makes it possible to pack multiple translation in a single component batch.
 
VoxelGridMap with_rotation_axis_angle (const rerun::components::RotationAxisAngle &_rotation_axis_angle) &&
 Rotation of the grid via axis + angle.
 
VoxelGridMap with_many_rotation_axis_angle (const Collection< rerun::components::RotationAxisAngle > &_rotation_axis_angle) &&
 This method makes it possible to pack multiple rotation_axis_angle in a single component batch.
 
VoxelGridMap with_quaternion (const rerun::components::RotationQuat &_quaternion) &&
 Rotation of the grid via quaternion.
 
VoxelGridMap with_many_quaternion (const Collection< rerun::components::RotationQuat > &_quaternion) &&
 This method makes it possible to pack multiple quaternion in a single component batch.
 
VoxelGridMap with_opacity (const rerun::components::Opacity &_opacity) &&
 Opacity of the voxels after color or colormap application.
 
VoxelGridMap with_many_opacity (const Collection< rerun::components::Opacity > &_opacity) &&
 This method makes it possible to pack multiple opacity in a single component batch.
 
VoxelGridMap with_value_range (const rerun::components::ValueRange &_value_range) &&
 Scalar value range for color-mapping.
 
VoxelGridMap with_many_value_range (const Collection< rerun::components::ValueRange > &_value_range) &&
 This method makes it possible to pack multiple value_range in a single component batch.
 
VoxelGridMap with_colormap (const rerun::components::Colormap &_colormap) &&
 Colormap to use when values are present and explicit colors are not provided.
 
VoxelGridMap with_many_colormap (const Collection< rerun::components::Colormap > &_colormap) &&
 This method makes it possible to pack multiple colormap in a single component batch.
 
Collection< ComponentColumncolumns (const Collection< uint32_t > &lengths_)
 Partitions the component data into multiple sub-batches.
 
Collection< ComponentColumncolumns ()
 Partitions the component data into unit-length sub-batches.
 

Static Public Member Functions

static VoxelGridMap update_fields ()
 Update only some specific fields of a VoxelGridMap.
 
static VoxelGridMap clear_fields ()
 Clear all the fields of a VoxelGridMap.
 

Public Attributes

std::optional< ComponentBatchvoxel_indices
 Indices of the voxels within the grid volume.
 
std::optional< ComponentBatchvoxel_size
 The scene-unit dimensions of a single voxel cell.
 
std::optional< ComponentBatchvalues
 Optional scalar occupancy or value data for each voxel.
 
std::optional< ComponentBatchcolors
 Optional colors for each voxel.
 
std::optional< ComponentBatchtranslation
 Translation of the minimum corner of voxel [0, 0, 0].
 
std::optional< ComponentBatchrotation_axis_angle
 Rotation of the grid via axis + angle.
 
std::optional< ComponentBatchquaternion
 Rotation of the grid via quaternion.
 
std::optional< ComponentBatchopacity
 Opacity of the voxels after color or colormap application.
 
std::optional< ComponentBatchvalue_range
 Scalar value range for color-mapping.
 
std::optional< ComponentBatchcolormap
 Colormap to use when values are present and explicit colors are not provided.
 

Static Public Attributes

static constexpr const char ArchetypeName [] = "rerun.archetypes.VoxelGridMap"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_voxel_indices
 ComponentDescriptor for the voxel_indices field.
 
static constexpr auto Descriptor_voxel_size
 ComponentDescriptor for the voxel_size field.
 
static constexpr auto Descriptor_values
 ComponentDescriptor for the values field.
 
static constexpr auto Descriptor_colors
 ComponentDescriptor for the colors field.
 
static constexpr auto Descriptor_translation
 ComponentDescriptor for the translation field.
 
static constexpr auto Descriptor_rotation_axis_angle
 ComponentDescriptor for the rotation_axis_angle field.
 
static constexpr auto Descriptor_quaternion
 ComponentDescriptor for the quaternion field.
 
static constexpr auto Descriptor_opacity
 ComponentDescriptor for the opacity field.
 
static constexpr auto Descriptor_value_range
 ComponentDescriptor for the value_range field.
 
static constexpr auto Descriptor_colormap
 ComponentDescriptor for the colormap field.
 

Detailed Description

Archetype: A sparse 3D voxel grid map with grid indices and voxel dimensions.

This archetype is intended for 3D occupancy maps and other volumetric data represented as a sparse grid of voxels with scene-unit dimensions along the local X/Y/Z axes.

The minimum corner of the voxel with [0, 0, 0] index is located at the origin of the entity's coordinate frame and can have an additional offset from there through the optional translation and rotation fields.

A voxel center is at (index + 0.5) * voxel_size in local grid coordinates (i.e. relative to the minimum corner).

Example

Simple sparse voxel grid map

#include <rerun.hpp>
#include <array>
#include <vector>
int main(int argc, char* argv[]) {
const auto rec =
rerun::RecordingStream("rerun_example_voxel_grid_map_simple");
rec.spawn().exit_on_failure();
const std::vector<rerun::components::VoxelIndex> voxel_indices = {
};
const std::vector<rerun::components::VoxelValue> values = {
0.0f,
0.2f,
0.4f,
0.6f,
0.8f,
1.0f,
};
rec.log(
"world/voxels",
std::array<float, 3>{0.25f, 0.25f, 0.25f}
)
rerun::components::ValueRange(std::array<double, 2>{0.0, 1.0})
)
.with_translation({-0.5f, -0.5f, 0.0f})
);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:73
@ Turbo
Google's Turbo colormap map.
Archetype: A sparse 3D voxel grid map with grid indices and voxel dimensions.
Definition voxel_grid_map.hpp:86
VoxelGridMap with_colormap(const rerun::components::Colormap &_colormap) &&
Colormap to use when values are present and explicit colors are not provided.
Definition voxel_grid_map.hpp:389
std::optional< ComponentBatch > voxel_indices
Indices of the voxels within the grid volume.
Definition voxel_grid_map.hpp:88
VoxelGridMap with_translation(const rerun::components::Translation3D &_translation) &&
Translation of the minimum corner of voxel [0, 0, 0].
Definition voxel_grid_map.hpp:279
VoxelGridMap with_values(const Collection< rerun::components::VoxelValue > &_values) &&
Optional scalar occupancy or value data for each voxel.
Definition voxel_grid_map.hpp:260
std::optional< ComponentBatch > values
Optional scalar occupancy or value data for each voxel.
Definition voxel_grid_map.hpp:99
VoxelGridMap with_value_range(const rerun::components::ValueRange &_value_range) &&
Scalar value range for color-mapping.
Definition voxel_grid_map.hpp:368
Component: Range of expected or valid values, specifying a lower and upper bound.
Definition value_range.hpp:18
Component: Integer index of a voxel in a sparse 3D voxel grid.
Definition voxel_index.hpp:17

This type is unstable and may change significantly in a way that the data won't be backwards compatible.

Member Function Documentation

◆ with_voxel_size()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_voxel_size ( const rerun::components::VoxelSize _voxel_size) &&
inline

The scene-unit dimensions of a single voxel cell.

This defines the voxel size along the local grid X/Y/Z axes. Each dimension must be finite and positive.

◆ with_many_voxel_size()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_many_voxel_size ( const Collection< rerun::components::VoxelSize > &  _voxel_size) &&
inline

This method makes it possible to pack multiple voxel_size in a single component batch.

This only makes sense when used in conjunction with columns. with_voxel_size should be used when logging a single row's worth of data.

◆ with_values()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_values ( const Collection< rerun::components::VoxelValue > &  _values) &&
inline

Optional scalar occupancy or value data for each voxel.

If explicit colors are not provided, values are mapped through colormap and value_range.

◆ with_colors()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_colors ( const Collection< rerun::components::Color > &  _colors) &&
inline

Optional colors for each voxel.

If set, these colors take precedence over color-mapped scalar values.

◆ with_translation()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_translation ( const rerun::components::Translation3D _translation) &&
inline

Translation of the minimum corner of voxel [0, 0, 0].

Together with components::RotationAxisAngle or components::RotationQuat, this defines the pose of the grid relative to the map's parent coordinate frame.

If not set, the minimum corner is placed at the origin of the map's parent coordinate frame.

◆ with_many_translation()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_many_translation ( const Collection< rerun::components::Translation3D > &  _translation) &&
inline

This method makes it possible to pack multiple translation in a single component batch.

This only makes sense when used in conjunction with columns. with_translation should be used when logging a single row's worth of data.

◆ with_rotation_axis_angle()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_rotation_axis_angle ( const rerun::components::RotationAxisAngle _rotation_axis_angle) &&
inline

Rotation of the grid via axis + angle.

Together with components::Translation3D, this defines the pose of the grid relative to the map's parent coordinate frame.

Note: either this or components::RotationQuat can be set to specify the grid's rotation, but not both. If both this and components::RotationQuat are set, this is ignored in favor of the quaternion.

◆ with_many_rotation_axis_angle()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_many_rotation_axis_angle ( const Collection< rerun::components::RotationAxisAngle > &  _rotation_axis_angle) &&
inline

This method makes it possible to pack multiple rotation_axis_angle in a single component batch.

This only makes sense when used in conjunction with columns. with_rotation_axis_angle should be used when logging a single row's worth of data.

◆ with_quaternion()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_quaternion ( const rerun::components::RotationQuat _quaternion) &&
inline

Rotation of the grid via quaternion.

Together with components::Translation3D, this defines the pose of the grid relative to the map's parent coordinate frame.

◆ with_many_quaternion()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_many_quaternion ( const Collection< rerun::components::RotationQuat > &  _quaternion) &&
inline

This method makes it possible to pack multiple quaternion in a single component batch.

This only makes sense when used in conjunction with columns. with_quaternion should be used when logging a single row's worth of data.

◆ with_opacity()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_opacity ( const rerun::components::Opacity _opacity) &&
inline

Opacity of the voxels after color or colormap application.

Defaults to 1.0 (fully opaque).

◆ with_many_opacity()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_many_opacity ( const Collection< rerun::components::Opacity > &  _opacity) &&
inline

This method makes it possible to pack multiple opacity in a single component batch.

This only makes sense when used in conjunction with columns. with_opacity should be used when logging a single row's worth of data.

◆ with_value_range()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_value_range ( const rerun::components::ValueRange _value_range) &&
inline

Scalar value range for color-mapping.

Defaults to [0.0, 1.0].

◆ with_many_value_range()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_many_value_range ( const Collection< rerun::components::ValueRange > &  _value_range) &&
inline

This method makes it possible to pack multiple value_range in a single component batch.

This only makes sense when used in conjunction with columns. with_value_range should be used when logging a single row's worth of data.

◆ with_colormap()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_colormap ( const rerun::components::Colormap _colormap) &&
inline

Colormap to use when values are present and explicit colors are not provided.

Defaults to Turbo.

◆ with_many_colormap()

VoxelGridMap rerun::archetypes::VoxelGridMap::with_many_colormap ( const Collection< rerun::components::Colormap > &  _colormap) &&
inline

This method makes it possible to pack multiple colormap in a single component batch.

This only makes sense when used in conjunction with columns. with_colormap should be used when logging a single row's worth of data.

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::VoxelGridMap::columns ( const Collection< uint32_t > &  lengths_)

Partitions the component data into multiple sub-batches.

Specifically, this transforms the existing ComponentBatch data into ComponentColumns instead, via ComponentBatch::partitioned.

This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.

The specified lengths must sum to the total length of the component batch.

◆ columns() [2/2]

Collection< ComponentColumn > rerun::archetypes::VoxelGridMap::columns ( )

Partitions the component data into unit-length sub-batches.

This is semantically similar to calling columns with std::vector<uint32_t>(n, 1), where n is automatically guessed.

Member Data Documentation

◆ voxel_size

std::optional<ComponentBatch> rerun::archetypes::VoxelGridMap::voxel_size

The scene-unit dimensions of a single voxel cell.

This defines the voxel size along the local grid X/Y/Z axes. Each dimension must be finite and positive.

◆ values

std::optional<ComponentBatch> rerun::archetypes::VoxelGridMap::values

Optional scalar occupancy or value data for each voxel.

If explicit colors are not provided, values are mapped through colormap and value_range.

◆ colors

std::optional<ComponentBatch> rerun::archetypes::VoxelGridMap::colors

Optional colors for each voxel.

If set, these colors take precedence over color-mapped scalar values.

◆ translation

std::optional<ComponentBatch> rerun::archetypes::VoxelGridMap::translation

Translation of the minimum corner of voxel [0, 0, 0].

Together with components::RotationAxisAngle or components::RotationQuat, this defines the pose of the grid relative to the map's parent coordinate frame.

If not set, the minimum corner is placed at the origin of the map's parent coordinate frame.

◆ rotation_axis_angle

std::optional<ComponentBatch> rerun::archetypes::VoxelGridMap::rotation_axis_angle

Rotation of the grid via axis + angle.

Together with components::Translation3D, this defines the pose of the grid relative to the map's parent coordinate frame.

Note: either this or components::RotationQuat can be set to specify the grid's rotation, but not both. If both this and components::RotationQuat are set, this is ignored in favor of the quaternion.

◆ quaternion

std::optional<ComponentBatch> rerun::archetypes::VoxelGridMap::quaternion

Rotation of the grid via quaternion.

Together with components::Translation3D, this defines the pose of the grid relative to the map's parent coordinate frame.

◆ opacity

std::optional<ComponentBatch> rerun::archetypes::VoxelGridMap::opacity

Opacity of the voxels after color or colormap application.

Defaults to 1.0 (fully opaque).

◆ value_range

std::optional<ComponentBatch> rerun::archetypes::VoxelGridMap::value_range

Scalar value range for color-mapping.

Defaults to [0.0, 1.0].

◆ colormap

std::optional<ComponentBatch> rerun::archetypes::VoxelGridMap::colormap

Colormap to use when values are present and explicit colors are not provided.

Defaults to Turbo.

◆ Descriptor_voxel_indices

constexpr auto rerun::archetypes::VoxelGridMap::Descriptor_voxel_indices
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "VoxelGridMap:voxel_indices",
Loggable<rerun::components::VoxelIndex>::ComponentType
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition voxel_grid_map.hpp:146

ComponentDescriptor for the voxel_indices field.

◆ Descriptor_voxel_size

constexpr auto rerun::archetypes::VoxelGridMap::Descriptor_voxel_size
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "VoxelGridMap:voxel_size",
Loggable<rerun::components::VoxelSize>::ComponentType
)

ComponentDescriptor for the voxel_size field.

◆ Descriptor_values

constexpr auto rerun::archetypes::VoxelGridMap::Descriptor_values
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "VoxelGridMap:values",
Loggable<rerun::components::VoxelValue>::ComponentType
)

ComponentDescriptor for the values field.

◆ Descriptor_colors

constexpr auto rerun::archetypes::VoxelGridMap::Descriptor_colors
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "VoxelGridMap:colors", Loggable<rerun::components::Color>::ComponentType
)

ComponentDescriptor for the colors field.

◆ Descriptor_translation

constexpr auto rerun::archetypes::VoxelGridMap::Descriptor_translation
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "VoxelGridMap:translation",
Loggable<rerun::components::Translation3D>::ComponentType
)

ComponentDescriptor for the translation field.

◆ Descriptor_rotation_axis_angle

constexpr auto rerun::archetypes::VoxelGridMap::Descriptor_rotation_axis_angle
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "VoxelGridMap:rotation_axis_angle",
Loggable<rerun::components::RotationAxisAngle>::ComponentType
)

ComponentDescriptor for the rotation_axis_angle field.

◆ Descriptor_quaternion

constexpr auto rerun::archetypes::VoxelGridMap::Descriptor_quaternion
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "VoxelGridMap:quaternion",
Loggable<rerun::components::RotationQuat>::ComponentType
)

ComponentDescriptor for the quaternion field.

◆ Descriptor_opacity

constexpr auto rerun::archetypes::VoxelGridMap::Descriptor_opacity
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "VoxelGridMap:opacity",
Loggable<rerun::components::Opacity>::ComponentType
)

ComponentDescriptor for the opacity field.

◆ Descriptor_value_range

constexpr auto rerun::archetypes::VoxelGridMap::Descriptor_value_range
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "VoxelGridMap:value_range",
Loggable<rerun::components::ValueRange>::ComponentType
)

ComponentDescriptor for the value_range field.

◆ Descriptor_colormap

constexpr auto rerun::archetypes::VoxelGridMap::Descriptor_colormap
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "VoxelGridMap:colormap",
Loggable<rerun::components::Colormap>::ComponentType
)

ComponentDescriptor for the colormap field.


The documentation for this struct was generated from the following file: