Reset an environment to an arbitrary state
Posted: Wed Jan 29, 2020 2:48 am
Pardon if this question has been answered before -- I searched an could not find what I'm looking for.
I would like to be able to reset a pybullet environment to a given state.
As a concrete example, suppose I have two instances of the same environment (e.g. HopperBulletEnv), call them env1 and env2.
I want to be able to reset env2 to the same state that env1 is in.
Just using saveState and restoreState won't work (as far as I can tell), since that limits me to only those states that the environment instance has already traversed.
In principle, this seems possible using saveBullet, which should allow me to dump the state of env1 to disk, and then restore that state from disk to env2. However, I'd like to avoid disk IO operations as this would be too slow.
Is there a way to return the state of env1 as a python dict, and then pass that dict to env2 and just reset all the values? What are the values that I need to pass in order to fully recreate the state? (From what I gather, I need at least the joint angles and velocities, but possibly much else besides).
Thanks,
Abe
I would like to be able to reset a pybullet environment to a given state.
As a concrete example, suppose I have two instances of the same environment (e.g. HopperBulletEnv), call them env1 and env2.
I want to be able to reset env2 to the same state that env1 is in.
Just using saveState and restoreState won't work (as far as I can tell), since that limits me to only those states that the environment instance has already traversed.
In principle, this seems possible using saveBullet, which should allow me to dump the state of env1 to disk, and then restore that state from disk to env2. However, I'd like to avoid disk IO operations as this would be too slow.
Is there a way to return the state of env1 as a python dict, and then pass that dict to env2 and just reset all the values? What are the values that I need to pass in order to fully recreate the state? (From what I gather, I need at least the joint angles and velocities, but possibly much else besides).
Thanks,
Abe