diff --git a/crates/store/re_types/definitions/rerun/archetypes/pinhole.fbs b/crates/store/re_types/definitions/rerun/archetypes/pinhole.fbs index 534214830165..52f494a7c112 100644 --- a/crates/store/re_types/definitions/rerun/archetypes/pinhole.fbs +++ b/crates/store/re_types/definitions/rerun/archetypes/pinhole.fbs @@ -5,7 +5,7 @@ namespace rerun.archetypes; /// /// If [archetypes.Transform3D] is logged for the same child/parent relationship (e.g. for the camera extrinsics), it takes precedence over [archetypes.Pinhole]. /// -/// If you use explicit transform frames via the `child_frame` and `parent_frame` fields, you don't have to use [archetypes.CoordinateFrame] +/// If you use named transform frames via the `child_frame` and `parent_frame` fields, you don't have to use [archetypes.CoordinateFrame] /// as it is the case with other visualizations: for any entity with an [archetypes.Pinhole] the viewer will always visualize it /// directly without needing a [archetypes.CoordinateFrame] to refer to the pinhole's child/parent frame. /// diff --git a/crates/store/re_types/src/archetypes/pinhole.rs b/crates/store/re_types/src/archetypes/pinhole.rs index 9f0a4c3c57d9..b8ef956f8305 100644 --- a/crates/store/re_types/src/archetypes/pinhole.rs +++ b/crates/store/re_types/src/archetypes/pinhole.rs @@ -25,7 +25,7 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// /// If [`archetypes::Transform3D`][crate::archetypes::Transform3D] is logged for the same child/parent relationship (e.g. for the camera extrinsics), it takes precedence over [`archetypes::Pinhole`][crate::archetypes::Pinhole]. /// -/// If you use explicit transform frames via the `child_frame` and `parent_frame` fields, you don't have to use [`archetypes::CoordinateFrame`][crate::archetypes::CoordinateFrame] +/// If you use named transform frames via the `child_frame` and `parent_frame` fields, you don't have to use [`archetypes::CoordinateFrame`][crate::archetypes::CoordinateFrame] /// as it is the case with other visualizations: for any entity with an [`archetypes::Pinhole`][crate::archetypes::Pinhole] the viewer will always visualize it /// directly without needing a [`archetypes::CoordinateFrame`][crate::archetypes::CoordinateFrame] to refer to the pinhole's child/parent frame. /// diff --git a/crates/viewer/re_view_spatial/tests/topology_errors.rs b/crates/viewer/re_view_spatial/tests/topology_errors.rs index 77f84149d34d..b24a0e798f76 100644 --- a/crates/viewer/re_view_spatial/tests/topology_errors.rs +++ b/crates/viewer/re_view_spatial/tests/topology_errors.rs @@ -14,7 +14,7 @@ struct TestScenario { } fn setup_scene(test_context: &mut TestContext) { - // We're using explicit transform frames here because it can trigger more different errors, + // We're using named transform frames here because it can trigger more different errors, // but most things work with implicit transform frames just as well. // // Transform frame forest: diff --git a/docs/content/concepts/spaces-and-transforms.md b/docs/content/concepts/spaces-and-transforms.md index 8544cf7b6c58..e0dbb005b23c 100644 --- a/docs/content/concepts/spaces-and-transforms.md +++ b/docs/content/concepts/spaces-and-transforms.md @@ -1,119 +1,5 @@ --- title: Spaces and Transforms -order: 300 +hidden: true +redirect: concepts/transforms --- - -## The definition of a space - -Every entity in Rerun exists in some _space_. This is at the core of how Rerun organizes the visualizations of the data -that you have logged. In the [Rerun Viewer](../reference/viewer.md) you view data by configuring a _view_, which is a view -of a set of entities _as seen from a particular origin._ - -The origin of a space is, very loosely, a generalization of the idea of a "coordinate system" (sometimes known as a "coordinate frame") to arbitrary data. If a collection of -entities are part of the same space, it means they can be rendered together. - -For example: - -- For 2D and 3D geometric primitives this means they share the same coordinate system. -- For scalar plots it means they share the same plot axes. -- For text logs, it means they share the same conceptual stream. - -As explained below, a view _may_ display data belonging to multiple spaces, but there must be a well-defined -means of transforming the data from one space to another. - -Which entities belong to which spaces is a function of the transform system, which uses the following rules to define -the space connectivity: - -1. Every unique entity path defines a potentially unique space. -1. Unless otherwise specified, every path is trivially connected to its parent by the identity transform. -1. Logging a transform to a path defines the relationship between that path and its parent (replacing the identity - connection). -1. Only paths which are connected by the identity transform are effectively considered to be part of the same - space. All others are considered to be disjoint. - -Note that in the absence of transforms, all entity paths are fully connected by the identity transform, and therefore -share the same space. However, as soon as you begin to log transforms, you can end up with additional spaces. - -Consider the following scenario: - -```python -rr.log("world/mapped_keypoints", rr.Points3D(…)) -rr.log("world/robot/observed_features",rr.Points3D(…)) -rr.log("world/robot", rr.Transforms3D(…)) -``` - -There are 4 parent/child entity relationships represented in this hierarchy. - -- `(root)` -> `world` -- `world` -> `world/mapped_keypoints` -- `world` -> `world/robot` -- `world/robot` -> `world/robot/observed_features` - -The call: `rr.log("world/robot", rr.Transforms3D(…))` only applies to the relationship: `world` -> `world/robot` because the -logged transform (`world/robot`) describes the relationship between the entity and its _parent_ (`world`). All other -relationships are considered to be an identity transform. - -This leaves us with two spaces. In one space, we have the entities `world`, and `world/mapped_keypoints`. In the other -space we have the entities `world/robot` and `world/robot/observed_features`. - -Practically speaking, this means that the position values of the points from `world/mapped_keypoints` and the points -from `world/robot/observed_features` are not directly comparable. If you were to directly draw these points in a single -coordinate system the results would be meaningless. As noted above, Rerun can still display these entities in the same -view because it is able to automatically transform data between different spaces. - -## Space transformations - -In order to correctly display data from different spaces in the same view, Rerun uses the information from logged -transforms. Since most transforms are invertible, Rerun can usually transform data from a parent space to a child space -or vice versa. As long as there is a continuous chain of well-defined transforms, Rerun will apply the correct series -of transformations to the component data when building the scene. - -Rerun transforms are currently limited to connections between _spatial_ views of 2D or 3D data. There are 3 types of -transforms that can be logged: - -- Affine 3D transforms, which can define any combination of translation, rotation, and scale relationship between two paths (see - [`rr.Transform3D`](https://ref.rerun.io/docs/python/stable/common/archetypes/#rerun.archetypes.Transform3D)). -- Pinhole transforms define a 3D -> 2D camera projection (see - [`rr.Pinhole`](https://ref.rerun.io/docs/python/stable/common/archetypes/#rerun.archetypes.Pinhole)). - -In the future, Rerun will be adding support for additional types of transforms. - -- [#349: Log 2D -> 2D transformations in the transform hierarchy](https://github.com/rerun-io/rerun/issues/349) - -## Examples - -Say you have a 3D world with two cameras with known extrinsics (pose) and intrinsics (pinhole model and resolution). You want to log some things in the shared 3D space, and also log each camera image and some detection in these images. - -```python -# Log some data to the 3D world: -rr.log("world/points", rr.Points3D(…)) - -# Log first camera: -rr.log("world/camera/0", rr.Transform3D(translation=cam0_pose.pos, mat3x3=cam0_pose.rot)) -rr.log("world/camera/0/image", rr.Pinhole(…)) - -# Log second camera: -rr.log("world/camera/1", rr.Transform3D(translation=cam1_pose.pos, mat3x3=cam1_pose.rot)) -rr.log("world/camera/1/image", rr.Pinhole(…)) - -# Log some data to the image spaces of the first camera: -rr.log("world/camera/0/image", rr.Image(…)) -rr.log("world/camera/0/image/detection", rr.Boxes2D(…)) -``` - -Rerun will from this understand how the `world` space and the two image spaces (`world/camera/0/image` and `world/camera/1/image`) relate to each other, which allows you to explore their relationship in the Rerun Viewer. In the 3D view you will see the two cameras show up with their respective camera frustums (based on the intrinsics). If you hover your mouse in one of the image spaces, a corresponding ray will be shot through the 3D space. - -Note that none of the names in the paths are special. - -## View coordinates - -You can use [`rr.ViewCoordinates`](https://ref.rerun.io/docs/python/stable/common/archetypes/#rerun.archetypes.ViewCoordinates) to set your preferred view coordinate systems, giving semantic meaning to the XYZ axes of the space. - -For 3D spaces it can be used to log what the up-axis is in your coordinate system. This will help Rerun set a good default view of your 3D scene, as well as make the virtual eye interactions more natural. This can be done with `rr.log("/", rr.ViewCoordinates.RIGHT_HAND_Z_UP, static=True)`. -Note that in this example the archetype is logged at the root path, this will make it apply to all 3D views. Generally, a 3D view picks up view coordinates at or above its origin entity path. - -You can also use this `log_view_coordinates` for pinhole entities, but it is encouraged that you instead use [`rr.log(…, rr.Pinhole(camera_xyz=…))`](https://ref.rerun.io/docs/python/stable/common/archetypes/#rerun.archetypes.Pinhole) for this. The default coordinate system for pinhole entities is `RDF` (X=Right, Y=Down, Z=Forward). - -WARNING: unlike in 3D views where `rr.ViewCoordinates` only impacts how the rendered scene is oriented, applying `rr.ViewCoordinates` to a pinhole-camera will actually influence the projection transform chain. Under the hood this value inserts a hidden transform that re-orients the axis of projection. Different world-content will be projected into your camera with different orientations depending on how you choose this value. See for instance the `open_photogrammetry_format` example. - -For 2D spaces and other entities the view coordinates currently do nothing ([#1387](https://github.com/rerun-io/rerun/issues/1387)). diff --git a/docs/content/concepts/transforms.md b/docs/content/concepts/transforms.md new file mode 100644 index 000000000000..a1a3add95efa --- /dev/null +++ b/docs/content/concepts/transforms.md @@ -0,0 +1,258 @@ +--- +title: Transforms & Transform Frames +order: 300 +--- + + + +Rerun comes with built-in support for modeling spatial relationships between entities. +This page details how the [different archetypes](https://rerun.io/docs/reference/types/archetypes#transforms) involved interact with each other and explains how geometric transforms are set up in Rerun. + +## Transform hierarchies with entity paths + +The [`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d) archetype allows you to specify how one coordinate system relates to another through translation, rotation, and scaling. + +The simplest way to use transforms is through entity path hierarchies, where each transform describes the relationship between an entity and its parent path. +Note that by default, all entities are connected via identity transforms (to opt out of that, you have to use named transform frames, more on that later). + +snippet: concepts/transform3d_hierarchy_simple + +In this hierarchy: +- The `sun` entity exists at the origin of its own coordinate system +- The `sun/planet` transform places the planet 6 units along x away from the sun +- The `sun/planet/moon` transform places the moon 3 units along x away from the planet + +This creates a transform hierarchy where transforms propagate down the entity tree. The moon's final position in the sun's coordinate system is 9 units away (6 + 3), +because the transforms are applied sequentially. + +## Named transform frames + +While entity path hierarchies work well for many cases, sometimes you need more flexibility in organizing your transforms. +In particular for anyone familiar with ROS we recommend using named transform frames as it allows you to model +your data much closer to how it would be defined when using ROS' [tf2](https://wiki.ros.org/tf2) library. + +In a nutshell, by explicitly specifying transform frames, you can decouple the spatial relationships from the entity hierarchy. + +Instead of relying on the path relationships of entities, each entity is first associated with a named transform frame using +the [`CoordinateFrame`](https://rerun.io/docs/reference/types/archetypes/coordinate_frame) archetype. + +The relationship between transform frames is then determined by logging [`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d) +with `child_frame` and `parent_frame` parameters to define the geometric relationship between two transform frames. + +TODO: make tested cross language snippet +```python +import rerun as rr +import numpy as np + +rr.init("named_frames_example", spawn=True) +rr.log("/", rr.ViewCoordinates.RIGHT_HAND_Z_UP, static=True) + +# Define entities with named coordinate frames +rr.log("sun", rr.Ellipsoids3D(centers=[0, 0, 0], half_sizes=[1, 1, 1], colors=[255, 200, 10]), + rr.CoordinateFrame("sun_frame")) +rr.log("planet", rr.Ellipsoids3D(centers=[0, 0, 0], half_sizes=[0.4, 0.4, 0.4], colors=[40, 80, 200]), + rr.CoordinateFrame("planet_frame")) +rr.log("moon", rr.Ellipsoids3D(centers=[0, 0, 0], half_sizes=[0.15, 0.15, 0.15], colors=[180, 180, 180]), + rr.CoordinateFrame("moon_frame")) + +# Connect the viewer to the sun's coordinate frame +rr.log("/", rr.CoordinateFrame("sun_frame")) + +# Define frame relationships +rr.log("planet_transform", rr.Transform3D( + translation=[6.0, 0.0, 0.0], + child_frame="planet_frame", + parent_frame="sun_frame" +)) +rr.log("moon_transform", rr.Transform3D( + translation=[3.0, 0.0, 0.0], + child_frame="moon_frame", + parent_frame="planet_frame" +)) +``` + +Note that unlike in ROS, you can log your transform relationship on _any_ entity. +However, currently once an entity specified the relation between two frames, this relation may no longer be logged on any other entity. + +Named transform frames have several advantages over entity path based hierarchies: +* topology may change over time +* which entity is associated with which frame may change over time (it can also be [overridden via blueprint](..concepts/visualizers-and-overrides.md)) +* several entities may be associated with the same frame +* frees up entity paths for semantic rather than geometric organization + +## Entity hierarchy based transforms under the hood - implicit transform frames + +Under the hood, Rerun's entity path hierarchies actually use the same transform frame system as named frames. +For each entity path, an associated transform frame with the prefix `tf#` is automatically created: +for example, an entity `/world/robot` gets frame `tf#/world/robot`. + +Path based hierarchies are then established by defaults the Viewer uses (also referred to as fallbacks): +Given an entity `/world/robot`: +* if no `CoordinateFrame::frame` is specified, it automatically defaults to `tf#/world/robot` +* if no `Transform3D::child_frame` is specified, it automatically defaults to `tf#/world/robot` +* if no `Transform3D::parent_frame` is specified, it automatically defaults to the parent's implicit frame, `tf#/world` + +The only special properties these implicit frames have over their named counterparts is that they +have implicit identity relationships. + +### Example + +Given these entities: +TODO: xlanguage please +```python +rr.log("robot", rr.Transform3D(translation=[1, 0, 0])) +rr.log("robot/arm", rr.Transform3D(translation=[0, 1, 0])) +rr.log("robot/arm/gripper", rr.Points3D([0, 0, 0])) +``` + +Rerun will interpret this _as-if_ it was logged with the named transform frames like so: + +TODO: xlanguage please +```python +rr.log("robot", + rr.CoordinateFrame("tf#/robot"), + rr.Transform3D( + translation=[1, 0, 0], + child_frame="tf#/robot", + parent_frame="tf#/" + ) +) +rr.log("robot/arm", + rr.CoordinateFrame("tf#/robot/arm"), + rr.Transform3D( + translation=[0, 1, 0], + child_frame="tf#/robot/arm", + parent_frame="tf#/robot" + ) +) +rr.log("robot/arm/gripper", + rr.CoordinateFrame("tf#/robot/arm/gripper"), + rr.Points3D([0, 0, 0]) +) +``` + + + + + + + + +### Mixing named and implicit transform frames + +We generally do not recommend mixing named and implicit transform frames since it can get confusing, +but doing so works seamlessly and can be useful in some situations. + +Example: +TODO: xlanguage please. +```python +rr.log("robot", rr.Transform3D(translation=[1, 0, 0])) +rr.log("arm", + rr.Transform3D(translation=[0, 1, 0], parent_frame="tf#/robot", child_frame="arm_frame"), + rr.CoordinateFrame("arm_frame") +) +rr.log("gripper", rr.Points3D([0, 0, 0]), rr.CoordinateFrame("arm_frame")) +``` + + + + + + + + +## Pinhole projections + +In Rerun, pinhole cameras are not merely another archetype that can be visualized, +they are also treated as spatial relationships that define projections from 3D spaces to 2D subspaces. +This unified approach allows the to handle both traditional 3D-to-3D transforms and 3D-to-2D projections. + +The [`Pinhole`](https://rerun.io/docs/reference/types/archetypes/pinhole) archetype defines this projection relationship through its intrinsic matrix (`image_from_camera`) and resolution. +Both implicit & named coordinate frames are supported, exactly as on [`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d). + +With the right setup, pinholes allow a bunch of powerful visualizations: +* the pinhole glyph itself in 3D views +* 2D in 3D: all 2D content that is part of the pinhole's transform subtree +* 3D in 2D: if the pinhole is at the origin of the view, 3D objects can be projected through pinhole camera into the view. + * Both the [nuscenes](https://rerun.io/examples/robotics/nuscenes_dataset) and [arkit](https://rerun.io/examples/spatial-computing/arkit_scenes) examples make use of this + +If a transform frame relationship has both a pinhole projection & regular transforms (in this context often regarded as the camera extrinsics) +the regular transform is applied first. + +### Example: 3D scene with 2D projections + +Here's how to set up a 3D scene with pinhole cameras that create 2D projections: + +In this example, the 3D objects (box and points) are automatically projected into the 2D camera view, +demonstrating how Rerun's transform system handles the spatial relationship between 3D world coordinates +and 2D image coordinates through pinhole projections. + +snippet: archetypes/pinhole_projections + + + + + + + + + + +## View coordinates + +You can use the [`ViewCoordinates`](https://rerun.io/docs/reference/types/archetypes/view_coordinates) archetype to set your preferred view coordinate systems, giving semantic meaning to the XYZ axes of the space. + +For 3D spaces it can be used to log what the up-axis is in your coordinate system. This will help Rerun set a good default view of your 3D scene, as well as make the virtual eye interactions more natural. In Python this can be done with `rr.log("/", rr.ViewCoordinates.RIGHT_HAND_Z_UP, static=True)`. +Note that in this example the archetype is logged at the root path, this will make it apply to all 3D views. Generally, a 3D view picks up view coordinates at or above its origin entity path. + +[Pinholes](https://rerun.io/docs/reference/types/archetypes/view_coordinates) have a view coordinates field integrated as a shortcut. +The default coordinate system for pinhole entities is `RDF` (X=Right, Y=Down, Z=Forward). + +WARNING: unlike in 3D views where `rr.ViewCoordinates` only impacts how the rendered scene is oriented, applying `rr.ViewCoordinates` to a pinhole-camera will actually influence the projection transform chain. Under the hood this value inserts a hidden transform that re-orients the axis of projection. Different world-content will be projected into your camera with different orientations depending on how you choose this value. See for instance the [`open_photogrammetry_format`](https://rerun.io/examples/3d-reconstruction/open_photogrammetry_format) example. + +For 2D spaces and other entities, view coordinates currently have currently no effect ([#1387](https://github.com/rerun-io/rerun/issues/1387)). + +## Pose transforms + +[`InstancePoses3D`](https://rerun.io/docs/reference/types/archetypes/instance_poses3d) defines geometric poses relative to an entity's transform frame. +Unlike with [`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d), poses do not propagate through the transform hierarchy +and can store an arbitrary amount of transforms on the same entity. + +For an entity that has both [`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d) +(without `child_frame`/`parent_frame`) and `InstancePoses3D`, +the [`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d) is applied first +(affecting the entity and all its children), then [`InstancePoses3D`](https://rerun.io/docs/reference/types/archetypes/instance_poses3d) +is applied only to that specific entity. +(This is consistent with how entity hierarchy based transforms translate to transform frames.) + +### Instancing + +Rerun's [`InstancePoses3D`](https://rerun.io/docs/reference/types/archetypes/instance_poses3d) archetype is not only used +to model poses relative to an Entity's frame, but also for repeating (known as "instancing") visualizations on the same entity: +most visualizations will show once for each transform on [`InstancePoses3D`](https://rerun.io/docs/reference/types/archetypes/instance_poses3d) +in the respective place. + +snippet: archetypes/mesh3d_instancing + + + + + + + + + +In this example, the mesh at `"shape"` is instantiated four times with different translations and rotations. +The box at `"shape/box"` is not affected by its parent's instance poses and appears only once. + + diff --git a/docs/content/reference/types/archetypes/pinhole.md b/docs/content/reference/types/archetypes/pinhole.md index 8866d0373cd1..140560a87fc0 100644 --- a/docs/content/reference/types/archetypes/pinhole.md +++ b/docs/content/reference/types/archetypes/pinhole.md @@ -7,7 +7,7 @@ Camera perspective projection (a.k.a. intrinsics). If [`archetypes.Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d) is logged for the same child/parent relationship (e.g. for the camera extrinsics), it takes precedence over [`archetypes.Pinhole`](https://rerun.io/docs/reference/types/archetypes/pinhole). -If you use explicit transform frames via the `child_frame` and `parent_frame` fields, you don't have to use [`archetypes.CoordinateFrame`](https://rerun.io/docs/reference/types/archetypes/coordinate_frame) +If you use named transform frames via the `child_frame` and `parent_frame` fields, you don't have to use [`archetypes.CoordinateFrame`](https://rerun.io/docs/reference/types/archetypes/coordinate_frame) as it is the case with other visualizations: for any entity with an [`archetypes.Pinhole`](https://rerun.io/docs/reference/types/archetypes/pinhole) the viewer will always visualize it directly without needing a [`archetypes.CoordinateFrame`](https://rerun.io/docs/reference/types/archetypes/coordinate_frame) to refer to the pinhole's child/parent frame. diff --git a/docs/snippets/INDEX.md b/docs/snippets/INDEX.md index 739a97365976..fdfdc025f47f 100644 --- a/docs/snippets/INDEX.md +++ b/docs/snippets/INDEX.md @@ -94,14 +94,17 @@ _All snippets, organized by the [`Archetype`](https://rerun.io/docs/reference/ty | **[`Clear`](https://rerun.io/docs/reference/types/archetypes/clear)** | `archetypes⁠/⁠clear_recursive` | Log and then clear data recursively | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/clear_recursive.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/clear_recursive.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/clear_recursive.cpp) | | **[`Clear`](https://rerun.io/docs/reference/types/archetypes/clear)** | `archetypes⁠/⁠transform3d_partial_updates` | Update specific properties of a transform over time | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_partial_updates.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_partial_updates.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_partial_updates.cpp) | | **[`CoordinateFrame`](https://rerun.io/docs/reference/types/archetypes/coordinate_frame)** | `archetypes⁠/⁠coordinate_frame_builtin_frames` | Demonstrates using explicit `CoordinateFrame` with implicit transform frames only | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/coordinate_frame_builtin_frames.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/coordinate_frame_builtin_frames.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/coordinate_frame_builtin_frames.cpp) | -| **[`CoordinateFrame`](https://rerun.io/docs/reference/types/archetypes/coordinate_frame)** | `archetypes⁠/⁠transform3d_hierarchy_frames` | Logs a transform hierarchy using explicit transform frame relationships | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp) | +| **[`CoordinateFrame`](https://rerun.io/docs/reference/types/archetypes/coordinate_frame)** | `archetypes⁠/⁠transform3d_hierarchy_frames` | Logs a transform hierarchy using named transform frame relationships | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp) | +| **[`CoordinateFrame`](https://rerun.io/docs/reference/types/archetypes/coordinate_frame)** | `concepts⁠/⁠transform3d_hierarchy_named_frames` | Logs a simple transform hierarchy with named frames | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/transform3d_hierarchy_named_frames.py) | | | | **[`Cylinders3D`](https://rerun.io/docs/reference/types/archetypes/cylinders3d)** | `archetypes⁠/⁠cylinders3d_batch` | Log a batch of cylinders | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/cylinders3d_batch.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/cylinders3d_batch.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/cylinders3d_batch.cpp) | | **[`DepthImage`](https://rerun.io/docs/reference/types/archetypes/depth_image)** | `archetypes⁠/⁠depth_image_simple` | Create and log a depth image | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/depth_image_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/depth_image_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/depth_image_simple.cpp) | | **[`DepthImage`](https://rerun.io/docs/reference/types/archetypes/depth_image)** | `archetypes⁠/⁠depth_image_3d` | Create and log a depth image and pinhole camera | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/depth_image_3d.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/depth_image_3d.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/depth_image_3d.cpp) | | **[`Ellipsoids3D`](https://rerun.io/docs/reference/types/archetypes/ellipsoids3d)** | `archetypes⁠/⁠ellipsoids3d_simple` | Log random points and the corresponding covariance ellipsoid | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/ellipsoids3d_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/ellipsoids3d_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/ellipsoids3d_simple.cpp) | | **[`Ellipsoids3D`](https://rerun.io/docs/reference/types/archetypes/ellipsoids3d)** | `archetypes⁠/⁠ellipsoids3d_batch` | Log a batch of ellipsoids | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/ellipsoids3d_batch.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/ellipsoids3d_batch.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/ellipsoids3d_batch.cpp) | | **[`Ellipsoids3D`](https://rerun.io/docs/reference/types/archetypes/ellipsoids3d)** | `archetypes⁠/⁠transform3d_hierarchy` | Logs a transform hierarchy | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.cpp) | -| **[`Ellipsoids3D`](https://rerun.io/docs/reference/types/archetypes/ellipsoids3d)** | `archetypes⁠/⁠transform3d_hierarchy_frames` | Logs a transform hierarchy using explicit transform frame relationships | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp) | +| **[`Ellipsoids3D`](https://rerun.io/docs/reference/types/archetypes/ellipsoids3d)** | `archetypes⁠/⁠transform3d_hierarchy_frames` | Logs a transform hierarchy using named transform frame relationships | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp) | +| **[`Ellipsoids3D`](https://rerun.io/docs/reference/types/archetypes/ellipsoids3d)** | `concepts⁠/⁠transform3d_hierarchy_named_frames` | Logs a simple transform hierarchy with named frames | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/transform3d_hierarchy_named_frames.py) | | | +| **[`Ellipsoids3D`](https://rerun.io/docs/reference/types/archetypes/ellipsoids3d)** | `concepts⁠/⁠transform3d_hierarchy_simple` | Logs a simple transform hierarchy | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/transform3d_hierarchy_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/transform3d_hierarchy_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/transform3d_hierarchy_simple.cpp) | | **[`EncodedImage`](https://rerun.io/docs/reference/types/archetypes/encoded_image)** | `archetypes⁠/⁠encoded_image` | Create and log an image | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/encoded_image.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/encoded_image.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/encoded_image.cpp) | | **[`EncodedImage`](https://rerun.io/docs/reference/types/archetypes/encoded_image)** | `archetypes⁠/⁠image_advanced` | Log an image | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/image_advanced.py) | | | | **[`GeoLineStrings`](https://rerun.io/docs/reference/types/archetypes/geo_line_strings)** | `archetypes⁠/⁠geo_line_strings_simple` | Log a simple geospatial line string | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_line_strings_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_line_strings_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/geo_line_strings_simple.cpp) | @@ -132,7 +135,7 @@ _All snippets, organized by the [`Archetype`](https://rerun.io/docs/reference/ty | **[`LineStrips3D`](https://rerun.io/docs/reference/types/archetypes/line_strips3d)** | `archetypes⁠/⁠line_strips3d_segments_simple` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips3d_segments_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips3d_segments_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips3d_segments_simple.cpp) | | **[`LineStrips3D`](https://rerun.io/docs/reference/types/archetypes/line_strips3d)** | `archetypes⁠/⁠line_strips3d_batch` | Log a batch of 3D line strips | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips3d_batch.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips3d_batch.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/line_strips3d_batch.cpp) | | **[`LineStrips3D`](https://rerun.io/docs/reference/types/archetypes/line_strips3d)** | `archetypes⁠/⁠transform3d_hierarchy` | Logs a transform hierarchy | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.cpp) | -| **[`LineStrips3D`](https://rerun.io/docs/reference/types/archetypes/line_strips3d)** | `archetypes⁠/⁠transform3d_hierarchy_frames` | Logs a transform hierarchy using explicit transform frame relationships | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp) | +| **[`LineStrips3D`](https://rerun.io/docs/reference/types/archetypes/line_strips3d)** | `archetypes⁠/⁠transform3d_hierarchy_frames` | Logs a transform hierarchy using named transform frame relationships | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp) | | **[`McapChannel`](https://rerun.io/docs/reference/types/archetypes/mcap_channel)** | `archetypes⁠/⁠mcap_channel_simple` | Log a simple MCAP channel definition | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mcap_channel_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mcap_channel_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mcap_channel_simple.cpp) | | **[`McapMessage`](https://rerun.io/docs/reference/types/archetypes/mcap_message)** | `archetypes⁠/⁠mcap_message_simple` | Log a simple MCAP message with binary data | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mcap_message_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mcap_message_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mcap_message_simple.cpp) | | **[`McapSchema`](https://rerun.io/docs/reference/types/archetypes/mcap_schema)** | `archetypes⁠/⁠mcap_schema_simple` | Log a simple MCAP schema definition | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mcap_schema_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mcap_schema_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/mcap_schema_simple.cpp) | @@ -205,10 +208,12 @@ _All snippets, organized by the [`Archetype`](https://rerun.io/docs/reference/ty | **[`TextLog`](https://rerun.io/docs/reference/types/archetypes/text_log)** | `concepts⁠/⁠app-model⁠/⁠native-async` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/app-model/native-async.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/app-model/native-async.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/app-model/native-async.cpp) | | **[`TextLog`](https://rerun.io/docs/reference/types/archetypes/text_log)** | `concepts⁠/⁠app-model⁠/⁠native-sync` | | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/app-model/native-sync.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/app-model/native-sync.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/app-model/native-sync.cpp) | | **[`TextLog`](https://rerun.io/docs/reference/types/archetypes/text_log)** | `howto⁠/⁠micro_batching` | Shows how to configure micro-batching directly from code | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/howto/micro_batching.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/howto/micro_batching.rs) | | +| **[`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d)** | `concepts⁠/⁠transform3d_hierarchy_simple` | Logs a simple transform hierarchy | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/transform3d_hierarchy_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/transform3d_hierarchy_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/transform3d_hierarchy_simple.cpp) | +| **[`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d)** | `concepts⁠/⁠transform3d_hierarchy_named_frames` | Logs a simple transform hierarchy with named frames | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/transform3d_hierarchy_named_frames.py) | | | | **[`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d)** | `archetypes⁠/⁠transform3d_simple` | Log different transforms between three arrows | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_simple.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_simple.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_simple.cpp) | | **[`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d)** | `archetypes⁠/⁠transform3d_row_updates` | Update a transform over time | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_row_updates.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_row_updates.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_row_updates.cpp) | | **[`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d)** | `archetypes⁠/⁠transform3d_partial_updates` | Update specific properties of a transform over time | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_partial_updates.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_partial_updates.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_partial_updates.cpp) | -| **[`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d)** | `archetypes⁠/⁠transform3d_hierarchy_frames` | Logs a transform hierarchy using explicit transform frame relationships | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp) | +| **[`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d)** | `archetypes⁠/⁠transform3d_hierarchy_frames` | Logs a transform hierarchy using named transform frame relationships | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp) | | **[`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d)** | `archetypes⁠/⁠transform3d_hierarchy` | Logs a transform hierarchy | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.cpp) | | **[`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d)** | `archetypes⁠/⁠transform3d_column_updates` | Update a transform over time, in a single operation | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_column_updates.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_column_updates.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_column_updates.cpp) | | **[`Transform3D`](https://rerun.io/docs/reference/types/archetypes/transform3d)** | `archetypes⁠/⁠transform3d_axes` | Log different transforms with visualized coordinates axes | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_axes.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_axes.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_axes.cpp) | @@ -226,7 +231,8 @@ _All snippets, organized by the [`Archetype`](https://rerun.io/docs/reference/ty | **[`ViewCoordinates`](https://rerun.io/docs/reference/types/archetypes/view_coordinates)** | `archetypes⁠/⁠pinhole_perspective` | Logs a point cloud and a perspective camera looking at it | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/pinhole_perspective.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/pinhole_perspective.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/pinhole_perspective.cpp) | | **[`ViewCoordinates`](https://rerun.io/docs/reference/types/archetypes/view_coordinates)** | `archetypes⁠/⁠pinhole_projections` | Demonstrates pinhole camera projections with Rerun blueprints | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/pinhole_projections.py) | | | | **[`ViewCoordinates`](https://rerun.io/docs/reference/types/archetypes/view_coordinates)** | `archetypes⁠/⁠transform3d_hierarchy` | Logs a transform hierarchy | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy.cpp) | -| **[`ViewCoordinates`](https://rerun.io/docs/reference/types/archetypes/view_coordinates)** | `archetypes⁠/⁠transform3d_hierarchy_frames` | Logs a transform hierarchy using explicit transform frame relationships | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp) | +| **[`ViewCoordinates`](https://rerun.io/docs/reference/types/archetypes/view_coordinates)** | `archetypes⁠/⁠transform3d_hierarchy_frames` | Logs a transform hierarchy using named transform frame relationships | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py) | [🦀](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs) | [🌊](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp) | +| **[`ViewCoordinates`](https://rerun.io/docs/reference/types/archetypes/view_coordinates)** | `concepts⁠/⁠transform3d_hierarchy_named_frames` | Logs a simple transform hierarchy with named frames | [🐍](https://github.com/rerun-io/rerun/blob/main/docs/snippets/all/concepts/transform3d_hierarchy_named_frames.py) | | | ### Views (blueprint) diff --git a/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp b/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp index 9867ff0df19f..a2a65ac59322 100644 --- a/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp +++ b/docs/snippets/all/archetypes/transform3d_hierarchy_frames.cpp @@ -1,4 +1,4 @@ -// Logs a transform hierarchy using explicit transform frame relationships. +// Logs a transform hierarchy using named transform frame relationships. #include diff --git a/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py b/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py index 7510ff985fab..9aa3ab4acff2 100644 --- a/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py +++ b/docs/snippets/all/archetypes/transform3d_hierarchy_frames.py @@ -1,4 +1,4 @@ -"""Logs a transform hierarchy using explicit transform frame relationships.""" +"""Logs a transform hierarchy using named transform frame relationships.""" import numpy as np import rerun as rr diff --git a/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs b/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs index 94b61664bf0c..4ba1d2ccc24f 100644 --- a/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs +++ b/docs/snippets/all/archetypes/transform3d_hierarchy_frames.rs @@ -1,4 +1,4 @@ -//! Logs a transform hierarchy using explicit transform frame relationships. +//! Logs a transform hierarchy using named transform frame relationships. fn main() -> Result<(), Box> { let rec = diff --git a/docs/snippets/all/concepts/transform3d_hierarchy_named_frames.py b/docs/snippets/all/concepts/transform3d_hierarchy_named_frames.py new file mode 100644 index 000000000000..caf9a8a15017 --- /dev/null +++ b/docs/snippets/all/concepts/transform3d_hierarchy_named_frames.py @@ -0,0 +1,30 @@ +"""Logs a simple transform hierarchy with named frames.""" + +import rerun as rr +import numpy as np + +rr.init("explicit_frames_example", spawn=True) +rr.log("/", rr.ViewCoordinates.RIGHT_HAND_Z_UP, static=True) + +# Define entities with explicit coordinate frames +rr.log("sun", rr.Ellipsoids3D(centers=[0, 0, 0], half_sizes=[1, 1, 1], colors=[255, 200, 10]), + rr.CoordinateFrame("sun_frame")) +rr.log("planet", rr.Ellipsoids3D(centers=[0, 0, 0], half_sizes=[0.4, 0.4, 0.4], colors=[40, 80, 200]), + rr.CoordinateFrame("planet_frame")) +rr.log("moon", rr.Ellipsoids3D(centers=[0, 0, 0], half_sizes=[0.15, 0.15, 0.15], colors=[180, 180, 180]), + rr.CoordinateFrame("moon_frame")) + +# Connect the viewer to the sun's coordinate frame +rr.log("/", rr.CoordinateFrame("sun_frame")) + +# Define explicit frame relationships +rr.log("planet_transform", rr.Transform3D( + translation=[6.0, 0.0, 0.0], + child_frame="planet_frame", + parent_frame="sun_frame" +)) +rr.log("moon_transform", rr.Transform3D( + translation=[3.0, 0.0, 0.0], + child_frame="moon_frame", + parent_frame="planet_frame" +)) diff --git a/docs/snippets/all/concepts/transform3d_hierarchy_simple.cpp b/docs/snippets/all/concepts/transform3d_hierarchy_simple.cpp new file mode 100644 index 000000000000..b09667a2be34 --- /dev/null +++ b/docs/snippets/all/concepts/transform3d_hierarchy_simple.cpp @@ -0,0 +1,42 @@ +//! Logs a simple transform hierarchy. + +#include + +int main() { + const auto rec = rerun::RecordingStream("rerun_example_transform3d_hierarchy_simple"); + rec.spawn().exit_on_failure(); + + // Log entities at their hierarchy positions + rec.log( + "sun", + rerun::Ellipsoids3D::from_centers_and_half_sizes({{0.0f, 0.0f, 0.0f}}, {{1.0f, 1.0f, 1.0f}}) + .with_colors(rerun::Color(255, 200, 10)) + ); + + rec.log( + "sun/planet", + rerun::Ellipsoids3D::from_centers_and_half_sizes({{0.0f, 0.0f, 0.0f}}, {{0.4f, 0.4f, 0.4f}}) + .with_colors(rerun::Color(40, 80, 200)) + ); + + rec.log( + "sun/planet/moon", + rerun::Ellipsoids3D::from_centers_and_half_sizes( + {{0.0f, 0.0f, 0.0f}}, + {{0.15f, 0.15f, 0.15f}} + ).with_colors(rerun::Color(180, 180, 180)) + ); + + // Define transforms - each describes the relationship to its parent + rec.log( + "sun/planet", + rerun::Transform3D::from_translation({6.0f, 0.0f, 0.0f}) + ); // Planet 6 units from sun + + rec.log( + "sun/planet/moon", + rerun::Transform3D::from_translation({3.0f, 0.0f, 0.0f}) + ); // Moon 3 units from planet + + return 0; +} diff --git a/docs/snippets/all/concepts/transform3d_hierarchy_simple.py b/docs/snippets/all/concepts/transform3d_hierarchy_simple.py new file mode 100644 index 000000000000..71c81a7d6f05 --- /dev/null +++ b/docs/snippets/all/concepts/transform3d_hierarchy_simple.py @@ -0,0 +1,14 @@ +"""Logs a simple transform hierarchy.""" + +import rerun as rr + +rr.init("rerun_example_transform3d_hierarchy_simple", spawn=True) + +# Log entities at their hierarchy positions +rr.log("sun", rr.Ellipsoids3D(centers=[0, 0, 0], half_sizes=[1, 1, 1], colors=[255, 200, 10])) +rr.log("sun/planet", rr.Ellipsoids3D(centers=[0, 0, 0], half_sizes=[0.4, 0.4, 0.4], colors=[40, 80, 200])) +rr.log("sun/planet/moon", rr.Ellipsoids3D(centers=[0, 0, 0], half_sizes=[0.15, 0.15, 0.15], colors=[180, 180, 180])) + +# Define transforms - each describes the relationship to its parent +rr.log("sun/planet", rr.Transform3D(translation=[6.0, 0.0, 0.0])) # Planet 6 units from sun +rr.log("sun/planet/moon", rr.Transform3D(translation=[3.0, 0.0, 0.0])) # Moon 3 units from planet diff --git a/docs/snippets/all/concepts/transform3d_hierarchy_simple.rs b/docs/snippets/all/concepts/transform3d_hierarchy_simple.rs new file mode 100644 index 000000000000..72c9ec2583ab --- /dev/null +++ b/docs/snippets/all/concepts/transform3d_hierarchy_simple.rs @@ -0,0 +1,37 @@ +//! Logs a simple transform hierarchy. + +fn main() -> Result<(), Box> { + let rec = + rerun::RecordingStreamBuilder::new("rerun_example_transform3d_hierarchy_simple").spawn()?; + + // Log entities at their hierarchy positions + rec.log( + "sun", + &rerun::Ellipsoids3D::from_centers_and_half_sizes([[0.0, 0.0, 0.0]], [[1.0, 1.0, 1.0]]) + .with_colors([rerun::Color::from_rgb(255, 200, 10)]), + )?; + + rec.log( + "sun/planet", + &rerun::Ellipsoids3D::from_centers_and_half_sizes([[0.0, 0.0, 0.0]], [[0.4, 0.4, 0.4]]) + .with_colors([rerun::Color::from_rgb(40, 80, 200)]), + )?; + + rec.log( + "sun/planet/moon", + &rerun::Ellipsoids3D::from_centers_and_half_sizes([[0.0, 0.0, 0.0]], [[0.15, 0.15, 0.15]]) + .with_colors([rerun::Color::from_rgb(180, 180, 180)]), + )?; + + // Define transforms - each describes the relationship to its parent + rec.log( + "sun/planet", + &rerun::Transform3D::from_translation([6.0, 0.0, 0.0]), + )?; // Planet 6 units from sun + rec.log( + "sun/planet/moon", + &rerun::Transform3D::from_translation([3.0, 0.0, 0.0]), + )?; // Moon 3 units from planet + + Ok(()) +} diff --git a/rerun_cpp/src/rerun/archetypes/pinhole.hpp b/rerun_cpp/src/rerun/archetypes/pinhole.hpp index 9e6adeb6bae2..62988252548c 100644 --- a/rerun_cpp/src/rerun/archetypes/pinhole.hpp +++ b/rerun_cpp/src/rerun/archetypes/pinhole.hpp @@ -27,7 +27,7 @@ namespace rerun::archetypes { /// /// If `archetypes::Transform3D` is logged for the same child/parent relationship (e.g. for the camera extrinsics), it takes precedence over `archetypes::Pinhole`. /// - /// If you use explicit transform frames via the `child_frame` and `parent_frame` fields, you don't have to use `archetypes::CoordinateFrame` + /// If you use named transform frames via the `child_frame` and `parent_frame` fields, you don't have to use `archetypes::CoordinateFrame` /// as it is the case with other visualizations: for any entity with an `archetypes::Pinhole` the viewer will always visualize it /// directly without needing a `archetypes::CoordinateFrame` to refer to the pinhole's child/parent frame. /// diff --git a/rerun_py/rerun_sdk/rerun/archetypes/pinhole.py b/rerun_py/rerun_sdk/rerun/archetypes/pinhole.py index 6af3fa4e3a5f..be03046268e9 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/pinhole.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/pinhole.py @@ -27,7 +27,7 @@ class Pinhole(PinholeExt, Archetype): If [`archetypes.Transform3D`][rerun.archetypes.Transform3D] is logged for the same child/parent relationship (e.g. for the camera extrinsics), it takes precedence over [`archetypes.Pinhole`][rerun.archetypes.Pinhole]. - If you use explicit transform frames via the `child_frame` and `parent_frame` fields, you don't have to use [`archetypes.CoordinateFrame`][rerun.archetypes.CoordinateFrame] + If you use named transform frames via the `child_frame` and `parent_frame` fields, you don't have to use [`archetypes.CoordinateFrame`][rerun.archetypes.CoordinateFrame] as it is the case with other visualizations: for any entity with an [`archetypes.Pinhole`][rerun.archetypes.Pinhole] the viewer will always visualize it directly without needing a [`archetypes.CoordinateFrame`][rerun.archetypes.CoordinateFrame] to refer to the pinhole's child/parent frame.