NVlabs / DiffRL

[ICLR 2022] Accelerated Policy Learning with Parallel Differentiable Simulation
https://short-horizon-actor-critic.github.io/
Other
263 stars 43 forks source link

Add box obstacles #9

Closed verityw closed 1 year ago

verityw commented 1 year ago

I want to try and add box obstacles to the environment, e.g. to create stairs that Ant or Cheetah has to scale. Is there a way to do this, perhaps by editing the ground plane?

I see in sim.py that there are some functions that handle contact forces. I'm not sure which ones would be relevant to modify to achieve the above, if any.

eanswer commented 1 year ago

The current code only supports ground contact though. We hard-coded something in some functions in sim.py to implicitly indicate the ground contact. For instance, in https://github.com/NVlabs/DiffRL/blob/main/dflex/dflex/sim.py#L1138, we assume the normal of contact is (0, 1, 0) and assume that the ground is at the plane of y = 0 when computing contact distance c. It is possible to incorporate more complex contact surfaces such as stairs with a moderate amount of modifications of sim.py.