Applies world scale to mesh transformation correctly in MeshRayCaster#4700
Open
Applies world scale to mesh transformation correctly in MeshRayCaster#4700
Conversation
Previously, the transforms were applied in the order (scale, transform, rotate). However, in Isaac Sim, the correct transformation order is (transform, rotate, scale). This MR fixes this issue by applying scale later. Signed-off-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
Contributor
Greptile SummaryThis PR fixes the mesh transformation order in
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Read mesh_prim vertices\n(local space)"] --> B["resolve_prim_pose(mesh_prim, target_prim)\n→ relative_pos, relative_quat"]
B --> C["resolve_prim_scale(mesh_prim)\n→ world_scale (sx, sy, sz)"]
C --> D["Build rotation matrix R\nfrom relative_quat"]
D --> E["Build 4x4 transform:\ntransform[:3,:3] = R\ntransform[:3,3] = relative_pos"]
E --> F["Compose scale into rotation:\ntransform[:3,:3] = R @ diag(world_scale)"]
F --> G["mesh.apply_transform(transform)\n→ vertices in target_prim frame"]
G --> H["Convert to Warp mesh\nfor raycasting"]
style F fill:#90EE90,stroke:#333,stroke-width:2px
style A fill:#f0f0f0,stroke:#333
style H fill:#f0f0f0,stroke:#333
Last reviewed commit: 7426231 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Previously, the transforms were applied in the order (scale, transform, rotate). However, in Isaac Sim, the correct transformation order is (transform, rotate, scale). This MR fixes this issue by applying scale later.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there