Is it possible to obtain the dynamical terms of the equation of motion directly from Gazebo/Ignition Gazebo?


To your knowledge, is there some method in the c++ API of Gazebo11 for obtaining the dynamics terms (mass matrix, potential energy contribution, contact jacobians, etc…)? If not, will these be implemented in Ignition Gazebo?

Does someone know if an external library for generating the dynamics terms based on the SDF model of the robot?

Thanks in advance

Gazebo itself doesn’t know or compute these terms. They are computed by the underlying physics engine (ODE, Dart, Bullet …). I’ve digged around these a lot, but it doesn’t seem to me there is a way to extract these values to Gazebo. They are private data of the physics engine. So I fear the only option is to fork the physics engine and do some modifications to them.

I see,

Thanks for yor answer.

Do you know if there is an external library for generating these terms from the SDF model of the system and the current state measurement?
I tried to search for them, without success for now.
This would be really useful for real-time applications, where obtaining a complete model of the robot mifht be too time-consuming.

Thanks again

I think what you’re asking for is Gazebo :slight_smile: Maybe with Ignition Gazebo, you could use just the parts related to physics (ign-physics), but I still think that to parse SDF, ign-gazebo would be needed. But you can definitely use it as a library calling the “Step” function yourself, so that you control when the physics computations happen and with what parameters.

The basic problem ign-gazebo solves is how to transform the joints and collision elements to the “objects” from which the physics engine makes the dynamics constraints. ign-physics is a meta-physics engine that just receives these “objects” and converts them to the datatypes the selected physics engine understands.

Please, also note that not all physics engines use the same problem formulation. Most use LCP, but there might be exceptions. Some use generalized coordinates, some use reduced coordinates etc.