Skip to content

Commit 0879bd8

Browse files
authored
Fixed incorrect camera pose in :class:~isaaclab_newton.sim.views.NewtonSiteFrameView (#6047)
# Description Fixed incorrect camera pose in :class:`~isaaclab_newton.sim.views.NewtonSiteFrameView`. The code change is cherry-picked from #5979 . ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
1 parent cc87cc8 commit 0879bd8

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Fixed
2+
^^^^^
3+
4+
* Fixed incorrect camera pose in :class:`~isaaclab_newton.sim.views.NewtonSiteFrameView`.

source/isaaclab_newton/isaaclab_newton/sim/views/newton_site_frame_view.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from pxr import UsdPhysics
1515

1616
import isaaclab.sim as sim_utils
17-
from isaaclab.cloner.cloner_utils import iter_clone_plan_matches
17+
from isaaclab.cloner.cloner_utils import get_suffix, iter_clone_plan_matches
1818
from isaaclab.physics import PhysicsEvent
1919
from isaaclab.sim.views.base_frame_view import BaseFrameView
2020
from isaaclab.utils.string import resolve_matching_names
@@ -321,7 +321,13 @@ def _resolve_source_prim(
321321
return body_patterns, wp.transform(pos, quat), False, env_ids
322322
body_prim = body_prim.GetParent()
323323

324-
ref_prim = stage.GetPrimAtPath(source_root) if source_root is not None else None
324+
ref_path = source_root
325+
if source_root is not None and destination_template is not None:
326+
instance_template = destination_template.partition("{}")[0] + "{}"
327+
source_suffix = get_suffix(source_root, instance_template)
328+
if source_suffix is not None:
329+
ref_path = source_root[: -len(source_suffix)] if source_suffix else source_root
330+
ref_prim = stage.GetPrimAtPath(ref_path) if ref_path is not None else None
325331
pos, quat = sim_utils.resolve_prim_pose(prim, ref_prim if ref_prim and ref_prim.IsValid() else None)
326332
return None, wp.transform(pos, quat), source_root is not None, env_ids
327333

0 commit comments

Comments
 (0)