pybullet-gym icon indicating copy to clipboard operation
pybullet-gym copied to clipboard

Fix InvertedPendulumMuJoCoEnv done signal.

Open floringogianu opened this issue 5 years ago • 3 comments

On env.step() the done signal should be a bool, not a tuple. Also check gym.envs.mujoco.inverted_pendulum.py.

floringogianu avatar Jan 28 '20 12:01 floringogianu

hi floringogianu, Thank you for making this pr. Would you like to explain why this done = not (np.isfinite(state).all() or np.abs(state[1]) > .2) can fix it? In my opinion, we should use done = not np.isfinite(state).all() or (np.abs(state[1]) > .2).any(). Because np.abs(state[1]) > .2 gives a np.array here. Correct me if I'm wrong. Thank you.

LostXine avatar Feb 27 '20 05:02 LostXine

@floringogianu Thanks for your contribution! @LostXine seems to have a valid argument here, no?

benelot avatar Mar 29 '21 09:03 benelot

@benelot Sorry for not replying for a while, somehow I missed @LostXine observation. I haven't worked with pybullet since last year but I'll find the time to install it again and check this out. If np.abs(state[1]) > .2 is indeed an array (although I don't remember that being the case) then yes, @LostXine solution is the right one.

floringogianu avatar Apr 02 '21 06:04 floringogianu