InvertedPendulumBulletEnv-v0 observation dimension meaning?

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
mretchin
Posts: 2
Joined: Fri Jul 29, 2022 1:50 am

InvertedPendulumBulletEnv-v0 observation dimension meaning?

Post by mretchin »

I noticed that the inverted pendulum Gym environment (https://github.com/bulletphysics/bullet ... um_envs.py) is 5-dimensional, which is different from the usual 4-dimensional observation vector: [cart position, cart velocity, pendulum angle, pendulum angular velocity]. What do the observation dimensions correspond to?

I'd like to start my episode with the pendulum facing down, but it's difficult to do that if I don't know what the observation space is.

Thanks!
mretchin
Posts: 2
Joined: Fri Jul 29, 2022 1:50 am

Re: InvertedPendulumBulletEnv-v0 observation dimension meaning?

Post by mretchin »

The answer is here: https://github.com/bulletphysics/bullet ... ula.py#L48.

np.array([x, vx, np.cos(self.theta), np.sin(self.theta), theta_dot])

It's the same four-dimensional space, except that rather than cart position, cart velocity, pole angle, pole angular velocity like usual, it's the cos and sin of pole angle.
Post Reply