@@ -98,11 +98,13 @@ def test_camera_init(self):
98
98
# Check if camera prim is set correctly and that it is a camera prim
99
99
self .assertEqual (camera ._sensor_prims [0 ].GetPath ().pathString , self .camera_cfg .prim_path )
100
100
self .assertIsInstance (camera ._sensor_prims [0 ], UsdGeom .Camera )
101
+
101
102
# Simulate for a few steps
102
103
# note: This is a workaround to ensure that the textures are loaded.
103
104
# Check "Known Issues" section in the documentation for more details.
104
105
for _ in range (5 ):
105
106
self .sim .step ()
107
+
106
108
# Check buffers that exists and have correct shapes
107
109
self .assertEqual (camera .data .pos_w .shape , (1 , 3 ))
108
110
self .assertEqual (camera .data .quat_w_ros .shape , (1 , 4 ))
@@ -111,6 +113,7 @@ def test_camera_init(self):
111
113
self .assertEqual (camera .data .intrinsic_matrices .shape , (1 , 3 , 3 ))
112
114
self .assertEqual (camera .data .image_shape , (self .camera_cfg .height , self .camera_cfg .width ))
113
115
self .assertEqual (camera .data .info , [{self .camera_cfg .data_types [0 ]: None }])
116
+
114
117
# Simulate physics
115
118
for _ in range (10 ):
116
119
# perform rendering
@@ -184,6 +187,12 @@ def test_camera_init_offset(self):
184
187
rtol = 1e-5 ,
185
188
)
186
189
190
+ # Simulate for a few steps
191
+ # note: This is a workaround to ensure that the textures are loaded.
192
+ # Check "Known Issues" section in the documentation for more details.
193
+ for _ in range (5 ):
194
+ self .sim .step ()
195
+
187
196
# check if transform correctly set in output
188
197
np .testing .assert_allclose (camera_ros .data .pos_w [0 ].cpu ().numpy (), cam_cfg_offset_ros .offset .pos , rtol = 1e-5 )
189
198
np .testing .assert_allclose (camera_ros .data .quat_w_ros [0 ].cpu ().numpy (), QUAT_ROS , rtol = 1e-5 )
0 commit comments