Skip to content

robotology/urdf2casadi-matlab

Repository files navigation

urdf2casadi-matlab

The main purpose of this project is to generate symbolic represantions of the kinematics and dynamics of a robot by extracting its geometrical and physical parameters from its URDF description. It supports fixed-base, open-chain robots. It uses CasADi to compute the symbolic expressions. It is inspired by urdf2eom.

Installation

The software has the following dependencies:

  • MATLAB;
  • CasADi: Here you can find the instruction to install it. Remember to add CasAdi to the MATLAB path.

Additional features

iDynTree has been used to validate the results of the symbolic models. Its documentation can be found at https://robotology.github.io/idyntree/master/. Make sure to compile the bindings to MATLAB. Some usefull turorial can be found at https://github.com/robotology/idyntree#tutorials .

URDF specifications

The URDF specifications and its mathematical description that has been used in this repository can be found here. Only joints with the axis aligned with one of the three directions of the joint frame are supported. Models with fixed joints are not supported.

Usage

Add to the MATLAB path the repository and all its subfolders by launching setPath.m, make sure to insert the correct path to CasADi.Get the URDF of your robot. Then pick one of the functions to create and test the model against IDynTree in the Verification/ subfolder. Each test* script should be launched from the folder it is contained in.

The code is structured as a MATLAB package. See the MATLAB documentation on how to reference the package members from within and outside the package.

Available algorithms

The algorithms generate both symbolic functions and their C code version (that is compiled as a *.mex file):

Additionally, the algorithms can be used to simulate a Momentum Observer for external force estimation, which can be tested by: