ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org

# urdf to lagrangian equations of motion

I'm looking for a nice programmatic way of generating Lagrange's equations of motion for a robot arm given a description like a urdf. This should be straightforward, however I haven't found code or libraries that already do this. The closest thing I've found is Pydy. Does anybody else have any suggestions before I derive it by hand or implement in code something that has already been done? thanks.

edit retag close merge delete

Sort by ยป oldest newest most voted

Here is a review of the libraries I am aware of. I hope it will help you make your choice!

## Robotics algorithms

• Forward (or direct) geometry: from joint configuration to body position,
• Forward (or direct) kinematics: from joint velocity to body velocity,
• Inverse kinematics: from body velocity to joint velocity,
• Forward (or direct) dynamics: from forces applied on a body compute the body acceleration,
• Inverse dynamics: from body accelerations compute forces applied by the joints (RNEA).

For any of these algorithms, one may support or not:

• floating-base (through the addition of a free-flyer joint as the root joint of the model)
• particular structures such as trees (instead of chains) and closed-loops,
• external forces (for dynamics related algorithms). For instance, it is useful to take into account external disturbances during motion.

## Bullet (>= 2.82 / NEW)

Bullet Collision Detection & Physics SDK

Bullet is a Collision Detection and Rigid Body Dynamics Library. The Library is Open Source and free for commercial use, under the ZLib license.

Algorithms:

• Geometry: unknown
• Kinematics: unkown
• Dynamics: forward, inverse

Supported joints:

• 1-DOF revolute and prismatic joints

Features:

• Underlying matrix library: none, uses its own types,
• Frame representation: rotation matrix and translation vector,
• Online model edition: unknown,
• Tree support: yes,
• Floating base support: yes,

## KDL (Orocos)

The Kinematics and Dynamics library used by ROS core packages. Notably the robot_model one.

Algorithms:

Supported joints:

• 1-dof: revolute (X or Y or Z), prismatic (X or Y or Z)

Features:

• Underlying matrix library: none, uses its own types,
• Frame representation: rotation matrix and translation vector,
• Online model edition: yes,
• Tree support: NO,
• Floating base support: NO (only 1-dof joints),

## Metapod

Metapod is a meta-programming dynamics computation library. The objective is to achieve high efficiency by assuming the robot model is known at compile-time. By doing so and by relying on advanced C++ techniques, dynamic allocation can be totally avoided and the compiler can achieve optimization that would not be possible in any other case.

Algorithms:

• Geometry: Direct[1]
• Kinematics: Direct[1]
• Dynamics: Inverse

[1] Those two algorithms are currently bound to the RNEA algorithm which means it is not possible currently to compute these quantities without computing the dynamics information.

Supported joints:

• 1-dof: revolute (X or any arbitrary axis)
• 6-dof: free-floating (three translation, three rotation)

Features:

• Underlying matrix library: Eigen,
• Frame representation: spatial algebra (rotation matrix and translation vector),
• Online model edition: NO,
• Tree support: yes,
• Floating base support: yes,
• URDF support: yes, experimental, read only[1].

[1] This Python script lives as a specific branch of robot_model_py for now. Due to Metapod specific design, loading an URDF model means in this context generating a C++ file which then will be compiled to use the robot-specific dynamic algorithm (RNEA).

## OpenRAVE [C++, Python]

This motion planning library is able to provide kinematics and dynamics computation ...

more

This is a very thorough review, great job! However, I should have been clearer that I wanted symbolic representations. The difference in this case is that many iterative methods (RNE, etc.) require a joint acceleration to evaluate the mass, Coriolis, etc. terms. Sympybotics does not. Thanks.

( 2013-01-17 03:31:12 -0500 )edit

Also, although sympybotics uses numpy to generate the equations of motion, it outputs functions for both python and C to calculate the mass, Coriolis, gravity, etc. terms. These functions can then be integrated into any existing library.

( 2013-01-25 02:30:04 -0500 )edit
( 2013-03-24 14:23:22 -0500 )edit
1

Yes unfortunately it is simulated by 6 joints and not a real free floating joint which means that it is computationally inefficient...

( 2013-03-24 16:04:57 -0500 )edit
2

I added Featherstone articulated body algorithm in the Bullet physics library, through btMultiBody. It supports fixed and "real" floating base, 1-DOF revolute and prismatic joints and contact constraints. It will be part of Bullet 2.82, http://bulletphysics.org. Perhaps you can add it to your list?

( 2013-10-02 07:18:46 -0500 )edit

Done. Is there IK in Bullet yet? I am still missing some information.

( 2013-10-02 16:26:59 -0500 )edit

OpenRave URDF support should probably be modified to say that there exists an easy conversion from URDF to Collada: http://wiki.ros.org/collada_urdf/Tutorials/Exporting%20URDF%20to%20COLLADA

( 2013-11-20 10:38:49 -0500 )edit
1

Would be nice if you could add RBDL to your post. The upcoming 2.4.0 version has true 3-Dof joints of various sorts: TranslationXYZ, Spherical (a singularity free spherical joint that uses Quaternions), EulerZYX, EulerXYZ, EulerZYX, and uses those for floating base joints for faster URDF models.

( 2014-09-09 08:05:55 -0500 )edit

Hi all,

Since originally posting this question, I found the following python library:

http://gitorious.org/sympybotics

It generates symbolic python and C code given a robot description in terms of standard DH parameters, mass and rotational inertia. I've compared it to results with the iterative methods used in Peter Corke's matlab toolbox and everything seems to match up for a simple 2 link planar robot as well as a 6 DOF Puma robot.

There's not a lot of documentation, but the author's included a nice demo script and I've found the code to be self explanatory and very useful. Thanks.

more