I'm a professor and I'm trying to use MuJoCo for biomechanical simulations of different bodies.
I'm looking for some help with how to take a model I have of an upper limb (which was, I believe, ported from OpenSim) and scale its parts; I want to run a variety of simulations with different scales on its arms, hands, torso, etc., so that it "matches" different people's dimensions. Playing with the Simulate tool and looking at Issue #41 , I can see how to scale mesh parts of the model, but this does not bring the tendon parts along. As an example, if I use a negative scale and flip a bone out of place, the tendons it used to be attached to now just hang in space. Is there a tool (similar to OpenSim's scaling tool) that enables easy per-body scaling such that tendon positions, dependent bodies' positions, and so forth are updated appropriately, as well? I would like to be able to scale the thorax by .75 while the humerus is scaled by .85, for example, without losing their connection to each other or to the tendons.
This is a great question! The very short answer is: in native MuJoCo, unfortunately no. However:
As a medium-term (and possibly long-term) solution, I encourage you to use pyMJCF. This is a python package that lets you procedurally edit MJCF models (before they are compiled by MuJoCo). It is quite powerful and you can find many examples of its use inside the dm_control repository.
That said, being able to natively stretch, scale and generally transform MuJoCo model elements is something that we consider a high priority, and completely understand its importance – especially for biomechanics. Implementing such native transformation machinery in MJCF itself is on our roadmap and will hopefully be implemented by the end of 2023.
Howdy!
I'm a professor and I'm trying to use MuJoCo for biomechanical simulations of different bodies.
I'm looking for some help with how to take a model I have of an upper limb (which was, I believe, ported from OpenSim) and scale its parts; I want to run a variety of simulations with different scales on its arms, hands, torso, etc., so that it "matches" different people's dimensions. Playing with the Simulate tool and looking at Issue #41 , I can see how to scale mesh parts of the model, but this does not bring the tendon parts along. As an example, if I use a negative scale and flip a bone out of place, the tendons it used to be attached to now just hang in space. Is there a tool (similar to OpenSim's scaling tool) that enables easy per-body scaling such that tendon positions, dependent bodies' positions, and so forth are updated appropriately, as well? I would like to be able to scale the thorax by .75 while the humerus is scaled by .85, for example, without losing their connection to each other or to the tendons.
The model that I'm using is https://github.com/aikkala/user-in-the-box/blob/main/uitb/bm_models/mobl_arms/bm_model.xml , but I'm also happy to learn how to do this on a simpler model; I'm confident I can figure out how to port the calls.
Thanks!