Unverified Commit 13146109 authored by Mayank Mittal's avatar Mayank Mittal Committed by GitHub

Uses Orbit's SimContext for camera unit tests (#504)

# Description

Earlier, we used Isaac Sim's sim context, which set the backend to torch
on CPU. However, we want to make sure things work fine on GPU. This MR
uses Orbit's sim context class for better integration testing.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [ ] 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 run all the tests with `./orbit.sh --test` and they pass
- [ ] 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
parent 19851b9b
......@@ -220,10 +220,13 @@ class Camera(SensorBase):
# resolve env_ids
if env_ids is None:
env_ids = self._ALL_INDICES
# convert matrices to numpy tensors
if isinstance(matrices, torch.Tensor):
matrices = matrices.cpu().numpy()
else:
matrices = np.asarray(matrices, dtype=float)
# iterate over env_ids
for i, matrix in zip(env_ids, matrices):
# convert to numpy for sanity
intrinsic_matrix = np.asarray(matrix, dtype=float)
for i, intrinsic_matrix in zip(env_ids, matrices):
# extract parameters from matrix
f_x = intrinsic_matrix[0, 0]
c_x = intrinsic_matrix[0, 2]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment