Scaling the world

Discussion in 'Simulation' started by Siebe, Mar 7, 2017.

  1. Hi

    I am trying to simulate a running quadruped. The model is based on a real robot with dimensions approximately 25 cm in length, 15 cm wide and 15 cm high.

    When I assume the units of MuJoCo are in meters, the simulated model is quite small and the contact behavior is not optimal. I tried changing the solref and solimp parameters but had no luck.

    However, the simulation and contacts are better when I scale the robot 10 times (so 25 cm would be 2.5 units instead of 0.25). I found an article for Bullet where they describe scaling the world (http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Scaling_The_World)

    I increased the gravity in my model to -98.1 and it looks OK but I don't know what to do with the mass. For example, the real servos on the robot have a mass of 67 grams. So this would be mass='0.067' in my non-scaled model file. Should I scale this mass as well to accommodate for the scaling factor or not? And what about the inertia of the bodies?

    Thank you very much for an answer.

    Best regards

    Siebe
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    MuJoCo does not assume any units; it uses whatever numbers you provide in your model. It is up to you to keep the units consistent. Since it uses double-precision, scaling the world is not likely to be needed. But if you need to do it, keep in mind that mass and inertia scale with volume (assuming fixed material density), and volume scale as s^3 where s is the linear scaling constant.