Skip to content
esc
Start typing to search the docs
Navigate Open

Archetypes

An archetype is a named set of semantically related components. Points3D, for example, groups positions, colors, and radii into a point cloud. The name is stored with the data, and the Viewer uses it to choose how to show that data by default.

rr.log("lidar", rr.Points3D(positions, colors=colors))

You log an archetype, and Rerun stores one component per field you set. Here the lidar entity gets two: Points3D:positions and Points3D:colors.

The archetype reference lists every built-in archetype.

What the archetype name does

When logging

The archetype name becomes part of the column name. Points3D:colors and Boxes3D:colors are both Color, but they are separate columns, so different archetypes can share an entity.

In the Viewer

The archetype name selects the default visualizer, as long as the entity has the archetype's required fields. An entity logged with rr.Points3D is drawn by the Points3D visualizer in a 3D view without any setup. Data under another name is still available to that visualizer if its Arrow datatype matches, but in most views you add the visualizer yourself in the UI or the blueprint. The exception is a time series view, which plots floating-point values logged under your own names. See Plot any scalar. The streams panel and the selection panel group an entity's components by archetype.

In queries

The archetype name is part of each column name: /lidar:Points3D:positions is the entity path, the archetype, and the field.

Each archetype page sorts its fields into three groups. Required fields are the core of the archetype, such as the positions of a Points3D. The Viewer picks a default for any recommended or optional field you do not log.

Nothing checks these groups when you log. You can log only the colors of a Points3D with rr.Points3D.from_fields(colors=…), and the Viewer combines them with the latest positions. See Send partial updates over time.

Not every archetype is something you see

Most archetypes are data that a visualizer draws. Some play a supporting role instead:

RoleExamples
PlacementTransform3D, CoordinateFrame, InstancePoses3D, ViewCoordinates. Pinhole places data too, and is also drawn as a camera frustum. See Transforms & Coordinate Frames.
StylingSeriesLines and SeriesPoints style the Scalars on the same entity. StateConfiguration styles the StateChange on the same entity.
InterpretationAnnotationContext holds the labels and colors for class IDs and keypoint IDs.
BookkeepingClear, RecordingInfo, and the MCAP archetypes.

Most archetypes only affect the entity they are logged to. A few also reach the entities below it in the entity path hierarchy, so that you log them once for a whole subtree:

Choosing an archetype for your data

The archetype your data is stored under decides how the Viewer shows it by default and what its columns are called.

A built-in archetype fits

The Viewer handles a built-in archetype without any setup.

When several fit, use the one that says the most about your data. A pressure reading fits both Scalars and Measurements, but only Measurements has fields for its variance and unit.

No built-in archetype fits

Log the data under your own names. A built-in archetype that means something else would label the columns with its own name and types.

DynamicArchetype groups values under an archetype name you choose, and AnyValues logs them without one:

You logColumn
rr.Points3D(positions)Points3D:positions
rr.DynamicArchetype(archetype="GripperState", components={"position": 0.03})GripperState:position
rr.AnyValues(confidence=0.9)confidence

See Send user-defined data for both helpers.

You can query these columns like any other. A time series view plots floating-point values without a mapping. To draw anything else in a view, point a visualizer at it with a component mapping. To convert them into a built-in archetype, see Lenses.

Only part of it fits

Log that part with the built-in archetype and the rest next to it on the same entity, for example a confidence per point next to a Points3D.