pinocchio: Using CasADi automatic differentiation is not possible

The paper says:

In addition to analytical derivatives, Pinocchio supports
automatic differentiation. This is made possible through the
full scalar templatization of the whole C++ code and the use
of any external library that does automatic differentiation:
ADOL-C [23], CasADi [24], CppAD [25] and others.

I tried to use casadi::SX type as a scalar type for Pinocchio algorithms, but the code does not compile. Here is a code snippet:

pinocchio::ModelTpl<casadi::SX> model;
pinocchio::DataTpl<casadi::SX> data(model);

Eigen::Matrix<casadi::SX, N_JOINTS, 1> q;
Eigen::Matrix<casadi::SX, N_JOINTS, 1> v;
Eigen::Matrix<casadi::SX, N_JOINTS, 1> tau;

aba(model, data, q, v, tau);

Here is the relevant compiler output: make.log

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

Shouldn’t you define Eigen::NumTraits<casadi::Matrix<casadi::SXElem> > too then ?

@jmirabel casadi::SX is a typedef for casadi::Matrix<casadi::SXElem>: https://github.com/casadi/casadi/blob/006f67c/casadi/core/sx_elem.hpp#L251