openai / roboschool

DEPRECATED: Open-source software for robot simulation, integrated with OpenAI Gym.
Other
2.13k stars 488 forks source link

NaN value in ordered-joint when second reset - RoboschoolHumanoid-v1 #132

Open AlEmerich opened 6 years ago

AlEmerich commented 6 years ago

Hi, I am trying to the following code just for a random benchmark

for i in range(20):
            observation = self.env.reset()
            for j in range(epochs):
                state, reward, done, info = self.env.step(self.act())
                self.env.render()
                if done:
                    time.sleep(0.5)
                    break

The first pass is well but the second reset trigger that error:

RuntimeWarning: invalid value encountered in greater
self.joints_at_limit = np.count_nonzero(np.abs(j[0::2]) > 0.99)

because there is just NaN value in the array j. I precise that there is no error when I don't render it (when I comment self.env.render()). But I want to render it to get feedback when I will teach it to walk.

Anyone guys has a workaround or know what is going on ? I am trying to dig in the code but I couldn't get anything yet...