-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fixes FrameTransformer to handle same body names at different hierarchy levels #4168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fixes FrameTransformer to handle same body names at different hierarchy levels #4168
Conversation
Greptile OverviewGreptile SummaryFixes critical bug where Key changes:
Impact:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant FrameTransformerCfg
participant FrameTransformer
participant PhysicsView
participant BodyDict as body_names_to_frames Dict
User->>FrameTransformerCfg: Configure target frames<br/>(Robot/LF_SHANK, Robot_1/LF_SHANK)
User->>FrameTransformer: Initialize sensor
Note over FrameTransformer: _initialize_impl()
FrameTransformer->>FrameTransformer: Iterate through target frames
FrameTransformer->>FrameTransformer: Resolve prim path<br/>/World/envs/env_0/Robot/LF_SHANK
FrameTransformer->>FrameTransformer: Extract relative path using regex<br/>env_\d+/(.*)
Note over FrameTransformer: OLD: body_name = "LF_SHANK"<br/>NEW: body_name = "Robot/LF_SHANK"
FrameTransformer->>BodyDict: Store body_name → {frames, prim_path, type}
FrameTransformer->>FrameTransformer: Resolve prim path<br/>/World/envs/env_0/Robot_1/LF_SHANK
FrameTransformer->>FrameTransformer: Extract relative path<br/>env_\d+/(.*)
Note over FrameTransformer: OLD: body_name = "LF_SHANK" (COLLISION!)<br/>NEW: body_name = "Robot_1/LF_SHANK" (UNIQUE)
FrameTransformer->>BodyDict: Store body_name → {frames, prim_path, type}
Note over BodyDict: OLD: Only 1 entry (collision)<br/>NEW: 2 separate entries
FrameTransformer->>FrameTransformer: Build target frame body names list<br/>using _get_rel_path()
FrameTransformer->>PhysicsView: Create view with tracked_body_names<br/>["Robot/LF_SHANK", "Robot_1/LF_SHANK"]
Note over PhysicsView: Both bodies tracked separately
FrameTransformer->>User: Returns distinct transforms<br/>for each body
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, no comments
231526e to
03def46
Compare
jtigue-bdai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey thanks for the feature. Some minor stuff with the test.
… hierarchical paths (e.g., Robot/LF_SHANK vs Robot_1/LF_SHANK) are tracked separately and return distinct transforms.
2266636 to
b382b4d
Compare
jtigue-bdai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT in the test, but thanks for the added functionality.
Co-authored-by: James Tigue <166445701+jtigue-bdai@users.noreply.github.com> Signed-off-by: Bikram Pandit <bikcrum@gmail.com>
Description
Bug:
FrameTransformeruses only the body name (last component of the prim path) as the unique key to identify bodies. This causes target frames with the same body name but different hierarchical paths to collide, resulting in only one body being tracked.Example: When tracking both
Robot/left_handandRobot_1/left_hand:body_name = "left_hand"left_handandleft_hand_1target frames return identical (incorrect) transformsUse cases affected:
Robot/left_handvsRobot_1/left_hand)arm/linkvsleg/link)Fix: Use the relative prim path (path after
env_X/) as the unique body identifier instead of just the body name. For example:/World/envs/env_0/Robot/left_hand-> key:Robot/left_hand/World/envs/env_0/Robot_1/left_hand-> key:Robot_1/left_handFixes #4167
Type of change
Screenshots
N/A - Internal data structure fix. No visual changes.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there