Skip to content

Commit f46c988

Browse files
Removing Action Space comparison with CTRL for MuJoco Envs (#604)
Co-authored-by: Mark Towers <[email protected]>
1 parent 78fe890 commit f46c988

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: gymnasium/envs/mujoco/mujoco_env.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ def do_simulation(self, ctrl, n_frames) -> None:
170170
Step the simulation n number of frames and applying a control action.
171171
"""
172172
# Check control input is contained in the action space
173-
if np.array(ctrl).shape != self.action_space.shape:
173+
if np.array(ctrl).shape != (self.model.nu,):
174174
raise ValueError(
175-
f"Action dimension mismatch. Expected {self.action_space.shape}, found {np.array(ctrl).shape}"
175+
f"Action dimension mismatch. Expected {(self.model.nu,)}, found {np.array(ctrl).shape}"
176176
)
177177
self._step_mujoco_simulation(ctrl, n_frames)
178178

0 commit comments

Comments
 (0)