Closed cookiegg closed 3 years ago
Each env is made from a robot (the actor) and its actual environment. This is built to allow defining new environments/settings with robots used in other settings.
To reset the initial position and angle manually, you need to access the robot of the environment (here the pendulum) and reset its hinges as the robot itself does (https://github.com/benelot/pybullet-gym/blob/1d239f55b62b4f3ac8e6e2f193cb379e604d8661/pybulletgym/envs/roboschool/robots/pendula/inverted_double_pendulum.py#L9)
So, it should be possible to call:
u = self.np_random.uniform(low=-.1, high=.1, size=[2])
env.robot.jdict["hinge"].reset_current_position(float(u[0], 0)
env.robot.jdict["hinge2"].reset_current_position(float(u[1], 0)
Edit: sorry, wrong robot, but this serves as a sufficient example because pendulum is the same.
Thank you very much for your patience in answering my questions, it was a great help.
I want to run the
InvertedPendulumPyBulletEnv-v0
from a different initial position and angle each time. Could you tell me how to set the status value manually?