def testSceneOption(self):
    height, width = 480, 640
    scene_option = wrapper.MjvOption()
    mjlib.mjv_defaultOption(scene_option.ptr)

    # Render geoms as semi-transparent.
    scene_option.flags[enums.mjtVisFlag.mjVIS_TRANSPARENT] = 1

    no_scene_option = self._physics.render(height, width, camera_id=0)
    with_scene_option = self._physics.render(height, width, camera_id=0,
                                             scene_option=scene_option)
    self.assertFalse(np.all(no_scene_option == with_scene_option),
                     msg='Images are identical with and without scene option.')
Exemple #2
0
 def __init__(self):
   ptr = ctypes.pointer(types.MJVOPTION())
   mjlib.mjv_defaultOption(ptr)
   # Do not visualize rangefinder lines by default:
   ptr.contents.flags[enums.mjtVisFlag.mjVIS_RANGEFINDER] = False
   super(MjvOption, self).__init__(ptr)
Exemple #3
0
 def __init__(self):
   ptr = ctypes.pointer(types.MJVOPTION())
   mjlib.mjv_defaultOption(ptr)
   super(MjvOption, self).__init__(ptr)