Skip to content

Conversation

@Wumpf
Copy link
Member

@Wumpf Wumpf commented Nov 28, 2025

Related

What

InstancePoses3D is now again tracked on a per entity basis rather than being tied to a specific frame. This allows you to have many different poses that are all relative to the same frame.

Example for illustrating purposes: (in a follow-up PR this example will be made available x-sdk)

"""Shows using InstancePoses3D with explicit coordinate frames and mesh instancing."""

import math
import rerun as rr

rr.init("rerun_example_instance_poses3d_frames", spawn=True)

# Animate a coordinate frame called "world_frame" moving in a circle around the origin.
for i in range(100):
    rr.set_time("frame", sequence=i)
    rr.log(
        "tf",
        rr.Transform3D(
            translation=[[math.cos(i * 0.1) * 2.0, math.sin(i * 0.1) * 2.0, 0]],
            parent_frame="tf#/",  # Connect to the default root frame.
            child_frame="world_frame",
        ),
    )

# Add content to visualize.
rr.log(
    "mesh",
    rr.Mesh3D(
        vertex_positions=[[1, 1, 1], [-1, -1, 1], [-1, 1, -1], [1, -1, -1]],
        triangle_indices=[[0, 2, 1], [0, 3, 1], [0, 3, 2], [1, 3, 2]],
        vertex_colors=[[255, 0, 0], [0, 255, 0], [0, 0, 255], [255, 255, 0]],
    ),
    rr.CoordinateFrame("world_frame"),
    static=True,
)
rr.log(
    "some_markers",
    rr.TransformAxes3D(axis_length=0.5, show_frame=True),
    rr.CoordinateFrame("world_frame"),
    static=True,
)

# Add static poses for markers. These are relative to the "world_frame" defined above.
rr.log(
    "some_markers",
    rr.InstancePoses3D(
        translations=[[1, 0, 1], [0, 1, 1], [0, -1, 1], [-1, 0, 1], [1, 1, 1], [-1, -1, 1], [1, -1, 1], [-1, 1, 1]]
    ),
    static=True,
)

# Add animated poses for the meshes. These are relative to the "world_frame" defined above.
for i in range(100):
    rr.set_time("frame", sequence=i)
    scale = math.sin(i * 0.2) * 0.3 + 1.0
    rr.log(
        "mesh",
        rr.InstancePoses3D(translations=[[3, 0, 0], [0, 3, 0], [0, -3, 0], [-3, 0, 0]], scales=[[scale, scale, scale]]),
    )
image

Under the hood this means that we have to separate out tracking of poses to be entirely entity driven and combine them very late in the process: in fact the re_tf::TransformForest no longer has any knowledge of these non-tree pose transforms. Instead, the per-view TransformTreeContext is what picks them up and builds the TransformInfo object that is used by visualizers - note that this PR simply moves out TransformInfo from re_tf, leaving behind a much simpler TreeTransform construct!

@github-actions
Copy link

github-actions bot commented Nov 28, 2025

Latest documentation preview deployed successfully.

Result Commit Link
578f7a7 https://landing-fyncilmc3-rerun.vercel.app/docs

Note: This comment is updated whenever you push a commit.

@github-actions
Copy link

github-actions bot commented Nov 28, 2025

Web viewer built successfully.

Result Commit Link Manifest
578f7a7 https://rerun.io/viewer/pr/12021 +nightly +main

View image diff on kitdiff.

Note: This comment is updated whenever you push a commit.

@Wumpf Wumpf force-pushed the andreas/tf/pose-transform-refresh branch from 1565631 to 27e7111 Compare November 28, 2025 17:42
@Wumpf Wumpf added 📺 re_viewer affects re_viewer itself 🍏 primitives Relating to Rerun primitives labels Dec 1, 2025
@grtlr grtlr self-requested a review December 2, 2025 13:04
Copy link
Member

@grtlr grtlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, one of the last 🧩!

I just have some minor comments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit unrelated, but: Would it make sense to set the SpatialInformation::show_axes view property for these tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure why not. But as pointed out before I'd rather keep those tests as isolated as possible. So a new show_axes property should get its own test suite

@Wumpf Wumpf force-pushed the andreas/tf/pose-transform-refresh branch from 52ed62a to 578f7a7 Compare December 2, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

include in changelog 🍏 primitives Relating to Rerun primitives 📺 re_viewer affects re_viewer itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants