-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[Newton]Fixes xform prim set_world_poses to respect its ancestral transform tree #4265
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: dev/newton
Are you sure you want to change the base?
Conversation
Greptile SummaryFixed critical bug in Key changes:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant XFormPrim
participant USD_API
participant Prim
participant Parent
User->>XFormPrim: set_world_poses(positions, orientations)
XFormPrim->>Prim: ComputeLocalToWorldTransform()
Prim-->>XFormPrim: current_world_transform
alt positions is None
XFormPrim->>XFormPrim: world_t = current_world.ExtractTranslation()
else positions provided
XFormPrim->>XFormPrim: world_t = Gf.Vec3d(positions[idx])
end
alt orientations is None
XFormPrim->>XFormPrim: world_q = current_world.ExtractRotation().GetQuat()
else orientations provided
XFormPrim->>XFormPrim: world_q = Gf.Quatd(orientations[idx])
end
XFormPrim->>XFormPrim: _world_to_local_tq(prim, world_t, world_q)
XFormPrim->>Prim: GetParent()
Prim-->>XFormPrim: parent_prim
alt parent exists and valid
XFormPrim->>Parent: ComputeLocalToWorldTransform()
Parent-->>XFormPrim: parent_w (parent world transform)
else no parent
XFormPrim->>XFormPrim: parent_w = identity matrix
end
XFormPrim->>XFormPrim: world_m = Matrix4d from (world_t, world_q)
XFormPrim->>XFormPrim: local_m = parent_w.GetInverse() * world_m
XFormPrim->>XFormPrim: Extract (local_t, local_q) from local_m
XFormPrim-->>XFormPrim: return (local_t, local_q)
XFormPrim->>USD_API: translate_op.Set(local_t)
XFormPrim->>USD_API: orient_op.Set(local_q)
USD_API-->>User: World pose set correctly
|
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.
Additional Comments (1)
-
source/isaaclab/isaaclab/sim/prims/xform_prim.py, line 241-243 (link)logic: order of operations:
SetRotate()must be called beforeSetTranslateOnly()for correct matrix composition
1 file reviewed, 1 comment
Description
Our pure-USD
XFormPrim.set_world_poses()was writing world positions/orientations directly into localxformOp:translate/orient, instead of converting the desired world pose into the prim’s parent-local frame. For prims under a transformed parent/ancestor, this could bake the parent’s world translation into the child’s local translate, effectively applying the translation twice (and leading to misplaced collision geometry / missing contacts). This PR fixesset_world_poses()to compute local ops via world→local conversion using the parent transform, matching expected world-pose semantics.Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there