mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-19 13:32:03 +00:00
Fix action dimension check bugs (#2469)
* fix action dimension check bugs * black codes, add test function * clear codes for simplicity * update check mujoco install
This commit is contained in:
@@ -70,6 +70,9 @@ class RobotEnv(gym.GoalEnv):
|
||||
return [seed]
|
||||
|
||||
def step(self, action):
|
||||
if np.array(action).shape != self.action_space.shape:
|
||||
raise ValueError("Action dimension mismatch")
|
||||
|
||||
action = np.clip(action, self.action_space.low, self.action_space.high)
|
||||
self._set_action(action)
|
||||
self.sim.step()
|
||||
|
Reference in New Issue
Block a user