Skip to content
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

add get local pose #3

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down