def _read_pixels()

in robosumo/envs/mujoco_env.py [0:0]


def _read_pixels(sim, width=None, height=None, camera_name=None):
    """Reads pixels w/o markers and overlay from the same camera as screen."""
    if width is None or height is None:
        resolution = glfw.get_framebuffer_size(
            sim._render_context_window.window)
        resolution = np.array(resolution)
        resolution = resolution * min(1000 / np.min(resolution), 1)
        resolution = resolution.astype(np.int32)
        resolution -= resolution % 16
        width, height = resolution

    img = sim.render(width, height, camera_name=camera_name)
    img = img[::-1, :, :] # Rendered images are upside-down.
    return img