mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-17 20:39:12 +00:00
MujocoEnv: Include shape in error message (#83)
This commit is contained in:
@@ -153,7 +153,9 @@ class BaseMujocoEnv(gym.Env):
|
|||||||
"""
|
"""
|
||||||
# Check control input is contained in the action space
|
# Check control input is contained in the action space
|
||||||
if np.array(ctrl).shape != self.action_space.shape:
|
if np.array(ctrl).shape != self.action_space.shape:
|
||||||
raise ValueError("Action dimension mismatch")
|
raise ValueError(
|
||||||
|
f"Action dimension mismatch. Expected {self.action_space.shape}, found {np.array(ctrl).shape}"
|
||||||
|
)
|
||||||
self._step_mujoco_simulation(ctrl, n_frames)
|
self._step_mujoco_simulation(ctrl, n_frames)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
|
Reference in New Issue
Block a user