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

Archetype: Specifies the coordinate frame for an entity. More...

#include <rerun/archetypes/coordinate_frame.hpp>

Public Member Functions

 CoordinateFrame (CoordinateFrame &&other)=default
 
 CoordinateFrame (const CoordinateFrame &other)=default
 
CoordinateFrameoperator= (const CoordinateFrame &other)=default
 
CoordinateFrameoperator= (CoordinateFrame &&other)=default
 
 CoordinateFrame (rerun::components::TransformFrameId _frame_id)
 
CoordinateFrame with_frame_id (const rerun::components::TransformFrameId &_frame_id) &&
 The coordinate frame to use for the current entity.
 
CoordinateFrame with_many_frame_id (const Collection< rerun::components::TransformFrameId > &_frame_id) &&
 This method makes it possible to pack multiple frame_id 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 CoordinateFrame update_fields ()
 Update only some specific fields of a CoordinateFrame.
 
static CoordinateFrame clear_fields ()
 Clear all the fields of a CoordinateFrame.
 

Public Attributes

std::optional< ComponentBatchframe_id
 The coordinate frame to use for the current entity.
 

Static Public Attributes

static constexpr const char ArchetypeName [] = "rerun.archetypes.CoordinateFrame"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_frame_id
 ComponentDescriptor for the frame_id field.
 

Detailed Description

Archetype: Specifies the coordinate frame for an entity.

Experimental: Transform frames are still in early development!

If not specified, the coordinate frame uses an implicit frame derived from the entity path. The implicit frame's name is tf#/your/entity/path and has an identity transform connection to its parent path.

To learn more about transforms see Spaces & Transforms in the reference.

Example

Change coordinate frame to different built-in frames

image

#include <rerun.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_transform3d_hierarchy");
rec.spawn().exit_on_failure();
rec.set_time_sequence("time", 0);
rec.log(
"red_box",
rerun::Boxes3D::from_half_sizes({{0.5f, 0.5f, 0.5f}}
).with_colors({rerun::Color(255, 0, 0)}),
// Use Transform3D to place the box, so we actually change the underlying coordinate frame and not just the box's pose.
rerun::Transform3D::from_translation({2.0f, 0.0f, 0.0f})
);
rec.log(
"blue_box",
rerun::Boxes3D::from_half_sizes({{0.5f, 0.5f, 0.5f}}
).with_colors({rerun::Color(0, 0, 255)}),
// Use Transform3D to place the box, so we actually change the underlying coordinate frame and not just the box's pose.
rerun::Transform3D::from_translation({-2.0f, 0.0f, 0.0f})
);
rec.log("point", rerun::Points3D({{0.0f, 0.0f, 0.0f}}).with_radii({0.5f}));
// Change where the point is located by cycling through its coordinate frame.
const char* frame_ids[] = {"tf#/red_box", "tf#/blue_box"};
for (int t = 0; t <2; t++) {
rec.set_time_sequence("time", t + 1); // leave it untouched at t==0.
rec.log("point", rerun::CoordinateFrame(frame_ids[t]));
}
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:73
Archetype: Specifies the coordinate frame for an entity.
Definition coordinate_frame.hpp:67
Archetype: A 3D point cloud with positions and optional colors, radii, labels, etc.
Definition points3d.hpp:176
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.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_many_frame_id()

CoordinateFrame rerun::archetypes::CoordinateFrame::with_many_frame_id ( const Collection< rerun::components::TransformFrameId > &  _frame_id) &&
inline

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

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

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::CoordinateFrame::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::CoordinateFrame::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

◆ Descriptor_frame_id

constexpr auto rerun::archetypes::CoordinateFrame::Descriptor_frame_id
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "CoordinateFrame:frame_id",
Loggable<rerun::components::TransformFrameId>::ComponentType
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition coordinate_frame.hpp:73

ComponentDescriptor for the frame_id field.


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