- Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Describe the bug
FrameTransformer uses only the body name (last component of the prim path) as the unique key to identify and track bodies. This causes target frames with the same body name but different hierarchical paths to collide, resulting in only one body being tracked while all frames with matching body names return identical (incorrect) transforms.
Example: When configuring a FrameTransformer to track both Robot/left_hand and Robot_1/left_hand:
- Both resolve to
body_name = "left_hand" - Only the first registered body is actually tracked in the physics view
- Both
left_handandleft_hand_1target frames return identical transforms (the transform of whichever body was registered first)
Affected use cases:
- Multi-robot scenarios with identical robot types
- Single articulation with duplicate body names at different hierarchy levels (e.g.,
arm/linkvsleg/link)
Steps to reproduce
from isaaclab.sensors import FrameTransformerCfg, OffsetCfg # Configure FrameTransformer to track same-named bodies from two robots frame_transformer = FrameTransformerCfg( prim_path="{ENV_REGEX_NS}/Robot/torso_base", target_frames=[ # Robot's left hand FrameTransformerCfg.FrameCfg( name="left_hand", prim_path="{ENV_REGEX_NS}/Robot/left_hand", ), # Robot_1's left hand (same body name, different robot) FrameTransformerCfg.FrameCfg( name="left_hand_1", prim_path="{ENV_REGEX_NS}/Robot_1/left_hand", ), ], ) # After running simulation: # env.scene["frame_transformer"].data.target_pos_source for "left_hand" # and "left_hand_1" will return IDENTICAL values, even though the robots # are at different positions.Root cause in code:
IsaacLab/source/isaaclab/isaaclab/sensors/frame_transformer/frame_transformer.py
Line 205 in 64ecea2
| body_name = matching_prim_path.rsplit("/", 1)[-1] |
System Info
- Commit: 64ecea2
- Isaac Sim Version: 5.1.0.0
- OS: Ubuntu 22.04
- GPU: RTX 3060
- CUDA: 13.0
- GPU Driver: 580.95.05
Additional context
The bug is in the _initialize_impl method of FrameTransformer class. The body_name variable is used as the key for body_names_to_frames dictionary, but it only contains the leaf name of the prim path, not the full relative path.
When a second body with the same leaf name is encountered, it adds the frame name to the existing entry but does NOT update the prim_path, causing only the first body to be tracked.
Checklist
- I have checked that there is no similar issue in the repo (required)
- I have checked that the issue is not in running Isaac Sim itself and is related to the repo
Acceptance Criteria
- Bodies with the same name but different hierarchical paths are tracked separately
- Each target frame returns the correct transform for its specified body
- Existing functionality for single-robot scenarios remains unchanged
- Unit test added to verify the fix