Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KincoActuatorIsaacLab
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kevin
KincoActuatorIsaacLab
Commits
63f585fc
Commit
63f585fc
authored
Apr 17, 2024
by
Mayank Mittal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes camera unittest by adding missing sim.step() calls
parent
78692be5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
test_camera.py
...e/extensions/omni.isaac.orbit/test/sensors/test_camera.py
+9
-0
No files found.
source/extensions/omni.isaac.orbit/test/sensors/test_camera.py
View file @
63f585fc
...
@@ -98,11 +98,13 @@ class TestCamera(unittest.TestCase):
...
@@ -98,11 +98,13 @@ class TestCamera(unittest.TestCase):
# Check if camera prim is set correctly and that it is a camera prim
# Check if camera prim is set correctly and that it is a camera prim
self
.
assertEqual
(
camera
.
_sensor_prims
[
0
]
.
GetPath
()
.
pathString
,
self
.
camera_cfg
.
prim_path
)
self
.
assertEqual
(
camera
.
_sensor_prims
[
0
]
.
GetPath
()
.
pathString
,
self
.
camera_cfg
.
prim_path
)
self
.
assertIsInstance
(
camera
.
_sensor_prims
[
0
],
UsdGeom
.
Camera
)
self
.
assertIsInstance
(
camera
.
_sensor_prims
[
0
],
UsdGeom
.
Camera
)
# Simulate for a few steps
# Simulate for a few steps
# note: This is a workaround to ensure that the textures are loaded.
# note: This is a workaround to ensure that the textures are loaded.
# Check "Known Issues" section in the documentation for more details.
# Check "Known Issues" section in the documentation for more details.
for
_
in
range
(
5
):
for
_
in
range
(
5
):
self
.
sim
.
step
()
self
.
sim
.
step
()
# Check buffers that exists and have correct shapes
# Check buffers that exists and have correct shapes
self
.
assertEqual
(
camera
.
data
.
pos_w
.
shape
,
(
1
,
3
))
self
.
assertEqual
(
camera
.
data
.
pos_w
.
shape
,
(
1
,
3
))
self
.
assertEqual
(
camera
.
data
.
quat_w_ros
.
shape
,
(
1
,
4
))
self
.
assertEqual
(
camera
.
data
.
quat_w_ros
.
shape
,
(
1
,
4
))
...
@@ -111,6 +113,7 @@ class TestCamera(unittest.TestCase):
...
@@ -111,6 +113,7 @@ class TestCamera(unittest.TestCase):
self
.
assertEqual
(
camera
.
data
.
intrinsic_matrices
.
shape
,
(
1
,
3
,
3
))
self
.
assertEqual
(
camera
.
data
.
intrinsic_matrices
.
shape
,
(
1
,
3
,
3
))
self
.
assertEqual
(
camera
.
data
.
image_shape
,
(
self
.
camera_cfg
.
height
,
self
.
camera_cfg
.
width
))
self
.
assertEqual
(
camera
.
data
.
image_shape
,
(
self
.
camera_cfg
.
height
,
self
.
camera_cfg
.
width
))
self
.
assertEqual
(
camera
.
data
.
info
,
[{
self
.
camera_cfg
.
data_types
[
0
]:
None
}])
self
.
assertEqual
(
camera
.
data
.
info
,
[{
self
.
camera_cfg
.
data_types
[
0
]:
None
}])
# Simulate physics
# Simulate physics
for
_
in
range
(
10
):
for
_
in
range
(
10
):
# perform rendering
# perform rendering
...
@@ -184,6 +187,12 @@ class TestCamera(unittest.TestCase):
...
@@ -184,6 +187,12 @@ class TestCamera(unittest.TestCase):
rtol
=
1e-5
,
rtol
=
1e-5
,
)
)
# Simulate for a few steps
# note: This is a workaround to ensure that the textures are loaded.
# Check "Known Issues" section in the documentation for more details.
for
_
in
range
(
5
):
self
.
sim
.
step
()
# check if transform correctly set in output
# check if transform correctly set in output
np
.
testing
.
assert_allclose
(
camera_ros
.
data
.
pos_w
[
0
]
.
cpu
()
.
numpy
(),
cam_cfg_offset_ros
.
offset
.
pos
,
rtol
=
1e-5
)
np
.
testing
.
assert_allclose
(
camera_ros
.
data
.
pos_w
[
0
]
.
cpu
()
.
numpy
(),
cam_cfg_offset_ros
.
offset
.
pos
,
rtol
=
1e-5
)
np
.
testing
.
assert_allclose
(
camera_ros
.
data
.
quat_w_ros
[
0
]
.
cpu
()
.
numpy
(),
QUAT_ROS
,
rtol
=
1e-5
)
np
.
testing
.
assert_allclose
(
camera_ros
.
data
.
quat_w_ros
[
0
]
.
cpu
()
.
numpy
(),
QUAT_ROS
,
rtol
=
1e-5
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment