Aim : For a mujoco environment (I'm using Metaworld) for example - "Sweep-into", I want to do this :
Reset Environment : Take some actions ... sim_state = Save the current state Take some actions ...
env.seed(0)
env.reset()
env.step() ... several times
sim_state = env.sim.get_state()
img = env.render('rgb_array')
env.step() ... several actions
Then : Reset Environment
env.seed(0)
env.reset()
env.sim.set_state(sim_state)
img_loaded = env.render('rgb_array')
sim_state_loaded = env.sim.get_state()
I find that sim_state_loaded is same as env.sim.get_state()
but the image (img != img_loaded) is not the same.
I only care about getting the image after setting the state.
I have already tried playing around by setting the seed before hand.
There are some domains where using env.set_state(qpos, qvel)
[not env.sim.set_state] will return the same image observation but using that same env object doesn't render valid images / states etc.