[Question] Randomizing the size and position of static objects (box geoms) makes them partially penetrable and leads to unexpected behavior #1295
Labels
question
Further information is requested
Question
I added static obstacles (box geoms) to the
half_cheetah.xml
model, and I would like to randomize their position and size during training at the beginning of each episode (by adding a small random number to their original position and size). To do this, I set the following in thereset_model()
methodThe call to
self.set_state()
comes after setting the above.However, it seems that this leads to some discrepancy within MuJoCo, as the box geoms become partially penetrable after modifying their position and size (i.e., the cheetah's body partially penetrates the box geoms, and sometimes even gets stuck inside them).
ChatGPT suggested adding
mujoco.mj_forward(self.model, self.data)
orself.sim.forward()
before or after the call toself.set_state()
, but this made no difference.I am using
gymnasium 0.28.1
mujoco 3.2.3
The text was updated successfully, but these errors were encountered: