From 6f27f3a7eb416e57b5010661ce96888297494c27 Mon Sep 17 00:00:00 2001 From: Hongyu Li Date: Tue, 8 Oct 2024 17:35:40 -0400 Subject: [PATCH] add get local pose --- .../omni/isaac/lab/sensors/camera/camera.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/sensors/camera/camera.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/sensors/camera/camera.py index 6a655915a9..7e61022e4f 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/sensors/camera/camera.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/sensors/camera/camera.py @@ -435,6 +435,24 @@ def get_world_poses(self, env_ids: Sequence[int] | None = None): positions, orientations = self._view.get_world_poses(indices=env_ids) return positions, orientations + def get_local_poses(self, env_ids: Sequence[int] | None = None): + """Get the local pose of the camera. + + Args: + env_ids: indices to specify which prims to query. Defaults to None, which means all sensor indices. + + Raises: + RuntimeError: If the camera prim is not set. Need to call :meth:`initialize` method first. + + Returns: the position and orientation of the local camera pose. quaternion is scalar-first (w, x, y, z) + """ + # resolve env_ids + if env_ids is None: + env_ids = self._ALL_INDICES + # set camera poses using the view + positions, orientations = self._view.get_local_poses(indices=env_ids) + return positions, orientations + """ Operations """