5 #ifndef __pinocchio_parsers_urdf_utils_hpp__ 6 #define __pinocchio_parsers_urdf_utils_hpp__ 8 #include <urdf_model/model.h> 10 #include "pinocchio/spatial/se3.hpp" 11 #include "pinocchio/spatial/inertia.hpp" 27 const ::urdf::Vector3 & p = Y.origin.position;
28 const ::urdf::Rotation & q = Y.origin.rotation;
30 const Eigen::Vector3d com(p.x,p.y,p.z);
31 const Eigen::Matrix3d & R = Eigen::Quaterniond(q.w,q.x,q.y,q.z).matrix();
33 Eigen::Matrix3d I; I <<
37 return Inertia(Y.mass,com,R*I*R.transpose());
49 const ::urdf::Vector3 & p = M.position;
50 const ::urdf::Rotation & q = M.rotation;
51 return SE3( Eigen::Quaterniond(q.w,q.x,q.y,q.z).matrix(), Eigen::Vector3d(p.x,p.y,p.z));
68 if( (axis.x==1.0)&&(axis.y==0.0)&&(axis.z==0.0) )
70 else if( (axis.x==0.0)&&(axis.y==1.0)&&(axis.z==0.0) )
72 else if( (axis.x==0.0)&&(axis.y==0.0)&&(axis.z==1.0) )
75 return AXIS_UNALIGNED;
80 #endif // __pinocchio_parsers_urdf_utils_hpp__
CartesianAxis
The four possible cartesian types of an 3D axis.
CartesianAxis extractCartesianAxis(const ::urdf::Vector3 &axis)
Extract the cartesian property of a particular 3D axis.
Inertia convertFromUrdf(const ::urdf::Inertial &Y)
Convert URDF Inertial quantity to Spatial Inertia.
Main pinocchio namespace.