Skip to content

Commit

Permalink
Dynamic render_modes detection
Browse files Browse the repository at this point in the history
  • Loading branch information
aliberts committed Apr 9, 2024
1 parent 5f9110a commit 35e4bc0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gym_pusht/envs/pusht.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import collections
import os

import cv2
import gymnasium as gym
Expand All @@ -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 = []
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 35e4bc0

Please sign in to comment.