openai/mujoco-py

Support for dynamics modding and randomization (DynamicsModder)

matwilso opened this issue · 3 comments

In Sim-to-Real Transfer of Robotic Control with Dynamics Randomization, they randomize model properties of the Mujoco simulation like mass of links and damping of joints.

Is there any planned support for this dynamics modding and randomization as there is for texture modding (TextureModder)?

I am guessing dynamics modding is not as straightforward, due to how Mujoco handles model loading.

It looks like the current workaround is altering an xml file and reloading the model from that. If this is the best way, would it make sense to add a nicer API for it?

Modding and re-loading the XML is particularly slow, so we try to avoid doing that where possible.

For some model parameters (e.g. lengths, masses, positions) we find we're able to change them after model compilation. For now I would suggest you compare this to re-loading XMLs to verify consistent behavior (for example, when making some geoms much larger, sometimes collisions are missed, but when making them smaller they are not).

It's possible that the MuJoCo documentation (http://mujoco.org/book/) notes which model parameters can be dynamically adjusted.

For example our CameraModder sets the orientation of the camera in the model directly https://github.com/openai/mujoco-py/blob/master/mujoco_py/modder.py#L115

Closing this out for now because there doesn't seem to be anything else concretely actionable for it right now.

Is the community looking at a way to change parameters online ?