Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions mjrl/envs/mujoco_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

try:
import mujoco_py
from mujoco_py import load_model_from_path, MjSim, MjViewer
from mujoco_py import load_model_from_path, MjSim, MjViewer, ignore_mujoco_warnings
except ImportError as e:
raise error.DependencyNotInstalled("{}. (HINT: you need to install mujoco_py, and also perform the setup instructions here: https://github.com/openai/mujoco-py/.)".format(e))

Expand Down Expand Up @@ -113,10 +113,11 @@ def dt(self):
def do_simulation(self, ctrl, n_frames):
for i in range(self.model.nu):
self.sim.data.ctrl[i] = ctrl[i]
for _ in range(n_frames):
self.sim.step()
if self.mujoco_render_frames is True:
self.mj_render()
with ignore_mujoco_warnings():
for _ in range(n_frames):
self.sim.step()
if self.mujoco_render_frames is True:
self.mj_render()

def mj_render(self):
try:
Expand Down