Skip to content

Commit

Permalink
bipedal_walker: trivial fixes (openai#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
olegklimov authored and gdb committed May 12, 2016
1 parent 892485a commit ba9fd34
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gym/envs/box2d/bipedal_walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,16 @@ def _step(self, action):
self.joints[0].motorSpeed = float(SPEED_HIP * np.clip(-1, 1, action[0]))
self.joints[1].motorSpeed = float(SPEED_KNEE * np.clip(-1, 1, action[1]))
self.joints[2].motorSpeed = float(SPEED_HIP * np.clip(-1, 1, action[2]))
self.joints[2].motorSpeed = float(SPEED_KNEE * np.clip(-1, 1, action[3]))
self.joints[3].motorSpeed = float(SPEED_KNEE * np.clip(-1, 1, action[3]))
else:
self.joints[0].motorSpeed = float(SPEED_HIP * np.sign(action[0]))
self.joints[0].maxMotorTorque = float(MOTORS_TORQUE * np.clip(0, 1, np.abs(action[0])))
self.joints[0].maxMotorTorque = float(MOTORS_TORQUE * np.clip(np.abs(action[0]), 0, 1))
self.joints[1].motorSpeed = float(SPEED_KNEE * np.sign(action[1]))
self.joints[1].maxMotorTorque = float(MOTORS_TORQUE * np.clip(0, 1, np.abs(action[1])))
self.joints[1].maxMotorTorque = float(MOTORS_TORQUE * np.clip(np.abs(action[1]), 0, 1))
self.joints[2].motorSpeed = float(SPEED_HIP * np.sign(action[2]))
self.joints[2].maxMotorTorque = float(MOTORS_TORQUE * np.clip(0, 1, np.abs(action[2])))
self.joints[2].maxMotorTorque = float(MOTORS_TORQUE * np.clip(np.abs(action[2]), 0, 1))
self.joints[3].motorSpeed = float(SPEED_KNEE * np.sign(action[3]))
self.joints[3].maxMotorTorque = float(MOTORS_TORQUE * np.clip(0, 1, np.abs(action[3])))
self.joints[3].maxMotorTorque = float(MOTORS_TORQUE * np.clip(np.abs(action[3]), 0, 1))

self.world.Step(1.0/FPS, 6*30, 2*30)

Expand Down

0 comments on commit ba9fd34

Please sign in to comment.