myosuite
myosuite copied to clipboard
Contact information on Myochallenge bimanual tasks
The observation matrix for the contact information doesn't reflect the state of the environment at the first few steps. Thanks to @jamesheald for raising this issue.
Code to reproduce
from myosuite.utils import gym
import time
import numpy as np
env = gym.make('myoChallengeBimanual-v0')
env.reset()
for i in range(800):
env.mj_render()
geom_1_indices = np.where(env.sim.model.geom_group == 1)
# Change the alpha value to make it transparent
env.sim.model.geom_rgba[geom_1_indices, 3] = 0
act = env.action_space.sample()
next_o, r, done, *_, ifo = env.step(act) # take an action based on the current observation
obs_dict = env.obs_dict
print(obs_dict['touching_body'])
if done == True:
env.reset()
pass
time.sleep(0.02)
env.reset()
env.close()
quit()
Observed output:
[0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 1 0 0] [0 0 0 0 0] [0 0 0 0 0] [0 0 1 0 0] [0 0 1 0 0] [0 0 0 0 0] [0 0 1 0 0] [0 0 1 0 0] [0 0 1 0 0] [0 0 1 0 0] [0 0 1 0 0] [0 0 1 0 0] [0 0 1 0 0] [0 0 1 0 0]
expected output to be all [0 0 1 0 0 ]