pinocchio: Error when building from source (python bindings)

Hi, I have been trying to build pinocchio from source both from the master and devel branches but I haven’t succeed. After the make command, I always got the following error:

In file included from /home/alejandro/phd_software/pinocchio_source/pinocchio/build/include/pinocchio/bindings/python/multibody/joint/joints-variant.hpp:11:0,
                 from /home/alejandro/phd_software/pinocchio_source/pinocchio/bindings/python/multibody/joint/expose-joints.cpp:7:
/home/alejandro/phd_software/pinocchio_source/pinocchio/build/include/pinocchio/bindings/python/multibody/joint/joints-models.hpp: In function ‘pinocchio::JointModelComposite& pinocchio::python::addJoint_proxy(pinocchio::JointModelComposite&, const JointModelVariant&, const SE3&)’:
/home/alejandro/phd_software/pinocchio_source/pinocchio/build/include/pinocchio/bindings/python/multibody/joint/joints-models.hpp:79:118: error: call of overloaded ‘apply_visitor(pinocchio::python::JointModelCompositeAddJointVisitor, const JointModelVariant&)’ is ambiguous
       return boost::apply_visitor(JointModelCompositeAddJointVisitor(joint_composite,joint_placement), jmodel_variant);
                                                                                                                      ^

Do you have any idea on what is causing that error? Thanks in advance

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 25 (13 by maintainers)

Most upvoted comments

Thank you very much @jcarpent. Built, tested, and working. I’ll now try to build with python interface and see what happens.

Ok I will have a look and do the appropriate modifications. Thanks for reporting this new issue.

Dear @jcarpent. I have been testing the aba algorithm and forward kinematics interfacing casadi. Almost everything is working fine. However, since I need to calculate the casadi expressions which define the pose of a robot’s end-effector, I must update the frame placements like this:

pinocchio::forwardKinematics(casadi_model,casadi_data,q_casadi);
pinocchio::updateFramePlacements(casadi_model,casadi_data);

or just: pinocchio::framesForwardKinematics(casadi_model,casadi_data,q_casadi); taking into account that I already defined:

  typedef double                              Scalar;
  typedef casadi::SX                          CasadiScalar;

  typedef pinocchio::ModelTpl<Scalar>         Model;
  typedef Model::Data                         Data;

  typedef pinocchio::ModelTpl<CasadiScalar>   CasadiModel;
  typedef CasadiModel::Data                   CasadiData;

  ...

  CasadiModel casadi_model = model.cast<CasadiScalar>();
  CasadiData casadi_data(casadi_model);

  ...

  casadi::SX q_sx = casadi::SX::sym("q", model.nq);
  ConfigVectorCasadi q_casadi(model.nq);
  q_casadi = Eigen::Map<ConfigVectorCasadi>(static_cast< std::vector<CasadiScalar> >(q_sx).data(),model.nq,1);

But, whenever I uncomment the pinocchio::updateFramePlacements(casadi_model,casadi_data) call, my script is not compiling. Both errors are related to the file pinocchio/algorithm/frames.hxx. The first one is:

/usr/local/include/pinocchio/algorithm/frames.hxx:30:21: error: invalid initialization of reference of type ‘const Frame& {aka const pinocchio::FrameTpl<double>&}’ from expression of type ‘const value_type {aka const pinocchio::FrameTpl<casadi::Matrix<casadi::SXElem>, 0>}’
       const Frame & frame = model.frames[i];
                     ^~~~~

and the second one isrelated to the operator*

/usr/local/include/pinocchio/algorithm/frames.hxx:35:39: error: no match for ‘operator*’ (operand types are ‘__gnu_cxx::__alloc_traits<Eigen::aligned_allocator<pinocchio::SE3Tpl<casadi::Matrix<casadi::SXElem>, 0> > >::value_type {aka pinocchio::SE3Tpl<casadi::Matrix<casadi::SXElem>, 0>}’ and ‘const SE3 {aka const pinocchio::SE3Tpl<double, 0>}’)
         data.oMf[i] = data.oMi[parent]*frame.placement;
                       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/local/include/pinocchio/spatial/se3.hpp:42:0,
                 from /usr/local/include/pinocchio/multibody/model.hpp:10,
                 from /home/alejandro/phd_software/Code/Git_repos/urdf2modelcasadi/urdf2model/src/model_pinocchio/pinocchio_interface.h:8,
                 from /home/alejandro/phd_software/Code/Git_repos/urdf2modelcasadi/urdf2model/src/model_pinocchio/pinocchio_interface.cpp:20:
/usr/local/include/pinocchio/spatial/se3-base.hpp:59:5: note: candidate: typename pinocchio::SE3GroupAction<Derived>::ReturnType pinocchio::SE3Base<Derived>::operator*(const Derived&) const [with Derived = pinocchio::SE3Tpl<casadi::Matrix<casadi::SXElem>, 0>; typename pinocchio::SE3GroupAction<Derived>::ReturnType = pinocchio::SE3Tpl<casadi::Matrix<casadi::SXElem>, 0>]
     operator*(const Derived & m2) const
     ^~~~~~~~
/usr/local/include/pinocchio/spatial/se3-base.hpp:59:5: note:   no known conversion for argument 1 from ‘const SE3 {aka const pinocchio::SE3Tpl<double, 0>}’ to ‘const pinocchio::SE3Tpl<casadi::Matrix<casadi::SXElem>, 0>&’
In file included from /usr/local/include/pinocchio/multibody/joint/joints.hpp:15:0,
                 from /usr/local/include/pinocchio/multibody/joint/joint-collection.hpp:9,
                 from /usr/local/include/pinocchio/multibody/joint/joint-generic.hpp:8,
                 from /usr/local/include/pinocchio/multibody/model.hpp:17,
                 from /home/alejandro/phd_software/Code/Git_repos/urdf2modelcasadi/urdf2model/src/model_pinocchio/pinocchio_interface.h:8,
                 from /home/alejandro/phd_software/Code/Git_repos/urdf2modelcasadi/urdf2model/src/model_pinocchio/pinocchio_interface.cpp:20:
/usr/local/include/pinocchio/multibody/joint/joint-spherical-ZYX.hpp:174:3: note: candidate: template<class Matrix6Like, class S2, int O2> const typename pinocchio::MatrixProduct<typename Eigen::internal::remove_const<typename pinocchio::SizeDepType<3>::ColsReturn<Mat>::ConstType>::type, typename pinocchio::ConstraintSphericalZYXTpl<S2, O2>::Matrix3>::type pinocchio::operator*(const Eigen::MatrixBase<Derived>&, const pinocchio::ConstraintSphericalZYXTpl<S2, O2>&)
   operator*(const Eigen::MatrixBase<Matrix6Like> & Y,
   ^~~~~~~~

.....

Attached there are both the compilation log and my test script.

Thank you very much @jcarpent. I was able to build pinocchio’s devel branch from source (haven’t tried with python interface). I think that I will test it tomorrow morning and let you know how it goes.

Thanks, I will try with that and see what happens.