Skip to content

Commit

Permalink
Fixed OpenAI Gym sample (#5581)
Browse files Browse the repository at this point in the history
* Fixed OpenAI Gym sample

* Update changelog-r2023.md

Co-authored-by: Stefania Pedrazzi <[email protected]>
  • Loading branch information
omichel and stefaniapedrazzi authored Nov 28, 2022
1 parent 9bc7ccb commit 0a33a72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/reference/changelog-r2023.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Released on December, 12th, 2022.
- New Examples
- Added a sample world showing how to compute the attitude of a robot from IMU sensors ([#5256](https://github.com/cyberbotics/webots/pull/5256)).
- Bug Fixes
- Fixed the OpenAI Gym example which was not converging after ENU/FLU conversion ([#5581](https://github.com/cyberbotics/webots/pull/5581)).
- Fixed wrong warnings due to SFNode empty flag in the controller ([#5430](https://github.com/cyberbotics/webots/pull/5430)).
- Fixed controller restart after crash ([#5284](https://github.com/cyberbotics/webots/pull/5284)).
- Fixed the export of [Lidar](lidar.md)'s rotating head to X3D ([#5224](https://github.com/cyberbotics/webots/pull/5224)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def step(self, action):
# Observation
robot = self.getSelf()
endpoint = self.getFromDef("POLE_ENDPOINT")
self.state = np.array([robot.getPosition()[2], robot.getVelocity()[2],
self.__pendulum_sensor.getValue(), endpoint.getVelocity()[3]])
self.state = np.array([robot.getPosition()[0], robot.getVelocity()[0],
self.__pendulum_sensor.getValue(), endpoint.getVelocity()[4]])

# Done
done = bool(
Expand Down

0 comments on commit 0a33a72

Please sign in to comment.