diff --git a/gym_pusht/envs/pusht.py b/gym_pusht/envs/pusht.py index 607e921..4adda74 100644 --- a/gym_pusht/envs/pusht.py +++ b/gym_pusht/envs/pusht.py @@ -1,4 +1,5 @@ import collections +import os import cv2 import gymnasium as gym @@ -12,6 +13,10 @@ from .pymunk_override import DrawOptions +RENDER_MODES = ["rgb_array"] +if os.environ.get("MUJOCO_GL") != "egl": + RENDER_MODES.append("human") + def pymunk_to_shapely(body, shapes): geoms = [] @@ -114,8 +119,7 @@ class PushTEnv(gym.Env): * TODO: """ - # metadata = {"render_modes": ["human", "rgb_array"], "render_fps": 10} - metadata = {"render_modes": ["rgb_array"], "render_fps": 10} + metadata = {"render_modes": RENDER_MODES, "render_fps": 10} def __init__( self,