@@ -278,21 +278,17 @@ def test_batched_mounted_camera_rendering(show_viewer, tol):
278278 robot = scene .add_entity (
279279 gs .morphs .MJCF (file = "xml/franka_emika_panda/panda.xml" ),
280280 )
281- cam = scene .add_camera (
282- res = (512 , 512 ),
283- pos = (1.5 , 0.5 , 1.5 ),
284- lookat = (0.0 , 0.0 , 0.5 ),
285- fov = 45 ,
286- GUI = True ,
287- )
281+ n_cameras = 3
282+ cams = [scene .add_camera (GUI = show_viewer , fov = 70 ) for _ in range (n_cameras )]
288283 n_envs = 3
289284 env_spacing = (2.0 , 2.0 )
290285 scene .build (n_envs = n_envs , env_spacing = env_spacing )
291286
292287 T = np .eye (4 )
293288 T [:3 , :3 ] = np .array ([[1 , 0 , 0 ], [0 , - 1 , 0 ], [0 , 0 , - 1 ]])
294289 T [:3 , 3 ] = np .array ([0.1 , 0.0 , 0.1 ])
295- cam .attach (robot .get_link ("hand" ), T )
290+ for cam in cams :
291+ cam .attach (robot .get_link ("hand" ), T )
296292
297293 target_quat = np .tile (np .array ([0 , 1 , 0 , 0 ]), [n_envs , 1 ]) # pointing downwards
298294 center = np .tile (np .array ([- 0.25 , - 0.25 , 0.5 ]), [n_envs , 1 ])
@@ -320,16 +316,17 @@ def test_batched_mounted_camera_rendering(show_viewer, tol):
320316 scene .step ()
321317
322318 robots_rgb_arrays = []
323- rgb_array , * _ = cam .render (rgb = True , depth = False , segmentation = False , colorize_seg = False , normal = False )
324- assert np .std (rgb_array ) > 10.0
325- robots_rgb_arrays .append (rgb_array )
319+ for cam in cams :
320+ rgb_array , * _ = cam .render (rgb = True , depth = False , segmentation = False , colorize_seg = False , normal = False )
321+ assert np .std (rgb_array ) > 10.0
322+ robots_rgb_arrays .append (rgb_array )
326323 steps_rgb_queue .put (robots_rgb_arrays )
327324
328325 if steps_rgb_queue .full (): # we have a set of 2 consecutive frames
329326 diff_tol = 0.02 # expect atlest 2% difference between each frame
330327 frames_t_minus_1 = steps_rgb_queue .get ()
331328 frames_t = steps_rgb_queue .get ()
332- for i in range (n_envs ):
329+ for i in range (n_cameras ):
333330 diff = frames_t [i ] - frames_t_minus_1 [i ]
334331 assert np .count_nonzero (diff ) > diff_tol * np .prod (diff .shape )
335332
0 commit comments