Add experimental child_frame & parent_frame to Transform3D#11730
Add experimental child_frame & parent_frame to Transform3D#11730
child_frame & parent_frame to Transform3D#11730Conversation
|
Web viewer built successfully.
View image diff on kitdiff. Note: This comment is updated whenever you push a commit. |
|
Latest documentation preview deployed successfully.
Note: This comment is updated whenever you push a commit. |
|
@rerun-bot full-check |
|
Started a full build: https://github.com/rerun-io/rerun/actions/runs/18956703515 |
There was a problem hiding this comment.
Pull Request Overview
This PR adds experimental support for explicit source and target frames to the Transform3D archetype, enabling ROS-style transform frame relationships. The new source_frame and target_frame fields allow transforms to explicitly specify which frames they connect, moving beyond the implicit entity hierarchy-based transform system.
Key changes:
- Added
source_frameandtarget_frameoptional components toTransform3D - Enhanced transform resolution cache to track frame relationships across entities and time
- Added fallback providers for the new frame components that derive from entity paths
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/ci/check_large_files.py | Added transform resolution cache file to exception list |
| rerun_py/rerun_sdk/rerun/archetypes/transform3d_ext.py | Added source_frame and target_frame parameters to Transform3D constructor |
| rerun_py/rerun_sdk/rerun/archetypes/transform3d.py | Updated Transform3D archetype with new frame components and documentation |
| rerun_cpp/src/rerun/archetypes/transform3d.hpp | Added C++ support for source_frame and target_frame components |
| rerun_cpp/src/rerun/archetypes/transform3d.cpp | Updated C++ implementation for new frame components |
| docs/snippets/snippets.toml | Added experimental transform3d_hierarchy_frames example exclusions |
| docs/snippets/all/archetypes/transform3d_hierarchy_frames.py | Added Python example demonstrating explicit frame relationships |
| docs/snippets/INDEX.md | Updated snippet index with new transform frame example |
| docs/content/reference/types/components/transform_frame_id.md | Updated documentation to reflect Transform3D usage |
| docs/content/reference/types/archetypes/transform3d.md | Added source_frame and target_frame to component list |
| crates/viewer/re_view_spatial/src/caches/transform_database_store.rs | Fixed doc link reference |
| crates/viewer/re_component_fallbacks/tests/snapshots/all_component_fallbacks__arch_fallback_rerun.archetypes.Transform3D.snap | Updated test snapshot with new fallback components |
| crates/viewer/re_component_fallbacks/src/component_fallbacks.rs | Added fallback providers for source_frame and target_frame |
| crates/store/re_types/src/transform_frame_id_hash.rs | Added from_str method for creating TransformFrameIdHash from strings |
| crates/store/re_types/src/reflection/mod.rs | Added reflection metadata for new frame components |
| crates/store/re_types/src/archetypes/transform3d_ext.rs | Updated IDENTITY constant with new frame fields |
| crates/store/re_types/src/archetypes/transform3d.rs | Added Rust implementation for source_frame and target_frame |
| crates/store/re_types/definitions/rerun/archetypes/transform3d.fbs | Added FlatBuffer definitions for new frame components |
| crates/store/re_tf/src/transform_resolution_cache.rs | Major rewrite to support arbitrary frame tracking and source-target relationships |
| crates/store/re_tf/src/lib.rs | Added entity_to_source_frame_tracking module |
| crates/store/re_tf/src/entity_to_source_frame_tracking.rs | New module for tracking frame relationships over time |
| crates/store/re_tf/benches/transform_resolution_cache_bench.rs | Fixed typo in benchmark function name |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
crates/store/re_types/definitions/rerun/archetypes/transform3d.fbs
Outdated
Show resolved
Hide resolved
ab97148 to
d67679d
Compare
| /// This means that if a [archetypes.Transform3D] is set on an entity called `/my/entity/path` then this will default to `tf#/my/entity/path`. | ||
| /// | ||
| /// To set the frame an entity is part of see [archetypes.CoordinateFrame]. | ||
| // TODO(RR-2777): Mark as stable when we're ready for it. |
There was a problem hiding this comment.
does the attr.rerun.state: unstable actuall work on fields? Use that?
oxkitsune
left a comment
There was a problem hiding this comment.
Few comments w.r.t. docs/comments to make it easier to follow, other than that LGTM!
| use std::ops::Range; | ||
| use vec1::smallvec_v1::SmallVec1; | ||
|
|
||
| /// Datastructures for tracking which transform relationships are specified by any moment in time for a given entity. |
There was a problem hiding this comment.
| /// Datastructures for tracking which transform relationships are specified by any moment in time for a given entity. | |
| /// Datastructures for tracking which transform relationships are specified at any moment in time for a given entity. |
| /// Insert a new range-start for a set of sources. | ||
| /// | ||
| /// Every time the start of a range is inserted, an existing range gets split in two! | ||
| /// The return value is the range previously not using `new_sources` but now is. |
There was a problem hiding this comment.
| /// The return value is the range previously not using `new_sources` but now is. | |
| /// The return value is the range that was not previously using `new_sources`, but is now. |
IIUC, the retrun value is the range that wasn't previously using the new_sources, but now is.
Wording it like this is a bit easier to understand.
| /// If any of the components yields an invalid transform, returns `None`. | ||
| // TODO(#3849): There's no way to discover invalid transforms right now (they can be intentional but often aren't). | ||
| fn query_and_resolve_tree_transform_at_entity( |
There was a problem hiding this comment.
I feel like this is a bit scary, similar to #8952 people could be depending on Affine3A::ZERO for invalid transforms.
I think this is the right thing to do, but might be worth to make a note of this somewhere in the changelog.
There was a problem hiding this comment.
agreed, the whole "what is an invalid transform" thing was a bit vague before still is :/
source_frame & target_frame to Transform3Dchild_frame & parent_frame to Transform3D
Related
What
EDIT: fields got renamed in #11770
Another crucial stepping stone towards ROS style transform support!
source&targetare singular right now in the API (since all ofTransform3Dis), but the underlying datastructures are already unit-tested against multiple sources (alas, not targets though; sources is where all the complexity is though anyways).The doc of these new fields explains what's going on here:
TransformForestdoes not yet walk arbitrary frames and is still bound to implicit frames. Addressing this is the next step after.As a consequence the added example is unfinished and a little bit "weird": we can define
Transform3Doutside of the entity hierarchy, but we can not yet collapse said entity hierarchy!This PR unfortunately makes queries a bit slower again as captured by existing benchmarks. Datastructure build-up is roughtly the same (I had fairly big swings on that one without doing anything)
Windows Ryzen 9 7950X3D comparing against a previous run on main (dab04a6) via
pixi run cargo bench -p re_tfStill a far cry from how slow it was before #11655