5 #ifndef __pinocchio_spatial_axis_hpp__
6 #define __pinocchio_spatial_axis_hpp__
8 #include "pinocchio/spatial/fwd.hpp"
9 #include "pinocchio/spatial/cartesian-axis.hpp"
10 #include "pinocchio/spatial/motion.hpp"
11 #include "pinocchio/spatial/force.hpp"
18 template<
int axis,
typename MotionDerived>
21 typedef typename MotionDerived::MotionPlain ReturnType;
40 template<
typename Derived1,
typename Derived2>
43 template<
typename Derived>
51 template<
typename Derived1,
typename Derived2>
54 template<
typename Derived>
62 template<
typename Scalar>
67 for (Eigen::DenseIndex i = 0; i < dim; ++i)
68 res.toVector()[i] = i == axis ? s : Scalar(0);
73 template<
typename Scalar>
79 template<
typename Derived>
84 min.toVector()[axis] = Scalar(1);
88 template<
typename MotionDerived>
91 typename MotionDerived::MotionPlain res;
92 if ((LINEAR == 0 && axis < 3) || (LINEAR == 3 && axis >= 3))
94 res.angular().setZero();
95 CartesianAxis3::cross(-m.angular(), res.linear());
99 CartesianAxis3::cross(-m.linear(), res.linear());
100 CartesianAxis3::cross(-m.angular(), res.angular());
109 template<
typename Derived1,
typename Derived2>
113 Derived2 & mout_ = PINOCCHIO_EIGEN_CONST_CAST(Derived2, mout);
115 if ((LINEAR == 0 && axis < 3) || (LINEAR == 3 && axis >= 3))
117 mout_.angular().setZero();
118 CartesianAxis3::cross(min.angular(), mout_.linear());
122 CartesianAxis3::cross(min.linear(), mout_.linear());
123 CartesianAxis3::cross(min.angular(), mout_.angular());
128 template<
typename Derived1,
typename Derived2>
130 SpatialAxis<axis>::cross(
const ForceDense<Derived1> & fin,
const ForceDense<Derived2> & fout)
132 Derived2 & fout_ = PINOCCHIO_EIGEN_CONST_CAST(Derived2, fout);
134 if ((LINEAR == 0 && axis < 3) || (LINEAR == 3 && axis >= 3))
136 fout_.linear().setZero();
137 CartesianAxis3::cross(fin.linear(), fout_.angular());
141 CartesianAxis3::cross(fin.linear(), fout_.linear());
142 CartesianAxis3::cross(fin.angular(), fout_.angular());
146 typedef SpatialAxis<0> AxisVX;
147 typedef SpatialAxis<1> AxisVY;
148 typedef SpatialAxis<2> AxisVZ;
150 typedef SpatialAxis<3> AxisWX;
151 typedef SpatialAxis<4> AxisWY;
152 typedef SpatialAxis<5> AxisWZ;
Main pinocchio namespace.
void cross(const Eigen::MatrixBase< Vector3 > &v, const Eigen::MatrixBase< Matrix3xIn > &Min, const Eigen::MatrixBase< Matrix3xOut > &Mout)
Applies the cross product onto the columns of M.
Return type of the ation of a Motion onto an object of type D.
Common traits structure to fully define base classes for CRTP.