-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Test for Camera and Tiled Camera transforms on CPU and GPU #4923
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
Draft
bareya
wants to merge
20
commits into
isaac-sim:develop
Choose a base branch
from
bareya:pbarejko/camera-update
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,259
−792
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
9e725e7
Fix Tiled Camera bug when set_world_poses_from_view is called
pbarejko a9f61a0
Reformat and add comment
pbarejko 2c0fbc1
Add missing comment
pbarejko 332dd1f
Move update usd to the backend
pbarejko 421c53f
Remove comment
pbarejko 450ce70
Add CPU/GPU tests and re-create matrices
pbarejko 6585962
Enable Fabric CPU path
pbarejko 4a17b9c
Update unit tests to do not skip CPU path
pbarejko ca44dda
Refactoring to use fabric local matrix
pbarejko 167db07
Break down XFormPrimView into Usd and Fabric backends
pbarejko 8afeb88
Reformat
pbarejko f5a3623
Revert unwanted changes
pbarejko 6466ffe
Replace fabric array with indexedfabricarray
pbarejko 6f52944
Rebuild indexing based on Fabric topology change
pbarejko 32ea149
Small refactoring
pbarejko 4c2ac4a
Update to reuse buffers through PrepareForReuse
pbarejko c9b68de
Update Fabric Backend and add debug methods
pbarejko ff5da88
Fix a bug with ro/wr accessor
pbarejko 8e704a2
update repr
pbarejko a70c115
Rename and reformat
pbarejko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| # Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from collections.abc import Sequence | ||
| from typing import Protocol | ||
|
|
||
| import torch | ||
|
|
||
|
|
||
| class XformBackend(Protocol): | ||
| """Protocol defining the interface for :class:`XformPrimView` transform backends. | ||
|
|
||
| Implementations provide read/write access to prim transforms through either | ||
| the USD or Fabric data path. :class:`XformPrimView` delegates all transform | ||
| operations to a *primary* backend and optionally replicates writes to one or | ||
| more *sync* backends. | ||
| """ | ||
|
|
||
| def initialize(self) -> None: | ||
| """Perform any deferred initialisation required by the backend.""" | ||
| ... | ||
|
|
||
| def set_world_poses( | ||
| self, | ||
| positions: torch.Tensor | None = None, | ||
| orientations: torch.Tensor | None = None, | ||
| indices: Sequence[int] | None = None, | ||
| ) -> None: | ||
| """Set world-space poses for the managed prims. | ||
|
|
||
| Args: | ||
| positions: World-space positions, shape ``(M, 3)`` [m]. | ||
| orientations: World-space quaternions ``(x, y, z, w)``, shape ``(M, 4)``. | ||
| indices: Subset of prim indices to update. ``None`` means all. | ||
| """ | ||
| ... | ||
|
|
||
| def get_world_poses( | ||
| self, | ||
| indices: Sequence[int] | None = None, | ||
| ) -> tuple[torch.Tensor, torch.Tensor]: | ||
| """Return world-space ``(positions, orientations)`` for the managed prims. | ||
|
|
||
| Args: | ||
| indices: Subset of prim indices to query. ``None`` means all. | ||
|
|
||
| Returns: | ||
| ``(positions, orientations)`` with shapes ``(M, 3)`` and ``(M, 4)``. | ||
| """ | ||
| ... | ||
|
|
||
| def set_local_poses( | ||
| self, | ||
| translations: torch.Tensor | None = None, | ||
| orientations: torch.Tensor | None = None, | ||
| indices: Sequence[int] | None = None, | ||
| ) -> None: | ||
| """Set local-space poses (relative to each prim's parent). | ||
|
|
||
| Args: | ||
| translations: Local-space translations, shape ``(M, 3)`` [m]. | ||
| orientations: Local-space quaternions ``(x, y, z, w)``, shape ``(M, 4)``. | ||
| indices: Subset of prim indices to update. ``None`` means all. | ||
| """ | ||
| ... | ||
|
|
||
| def get_local_poses( | ||
| self, | ||
| indices: Sequence[int] | None = None, | ||
| ) -> tuple[torch.Tensor, torch.Tensor]: | ||
| """Return local-space ``(translations, orientations)`` for the managed prims. | ||
|
|
||
| Args: | ||
| indices: Subset of prim indices to query. ``None`` means all. | ||
|
|
||
| Returns: | ||
| ``(translations, orientations)`` with shapes ``(M, 3)`` and ``(M, 4)``. | ||
| """ | ||
| ... | ||
|
|
||
| def set_scales( | ||
| self, | ||
| scales: torch.Tensor, | ||
| indices: Sequence[int] | None = None, | ||
| ) -> None: | ||
| """Set scales for the managed prims. | ||
|
|
||
| Args: | ||
| scales: Scales, shape ``(M, 3)``. | ||
| indices: Subset of prim indices to update. ``None`` means all. | ||
| """ | ||
| ... | ||
|
|
||
| def get_scales( | ||
| self, | ||
| indices: Sequence[int] | None = None, | ||
| ) -> torch.Tensor: | ||
| """Return scales for the managed prims. | ||
|
|
||
| Args: | ||
| indices: Subset of prim indices to query. ``None`` means all. | ||
|
|
||
| Returns: | ||
| Scales tensor of shape ``(M, 3)``. | ||
| """ | ||
| ... |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.