5 #ifndef __pinocchio_spatial_force_dense_hpp__
6 #define __pinocchio_spatial_force_dense_hpp__
11 template<
typename Derived>
14 typedef typename SE3GroupAction<Derived>::ReturnType ReturnType;
17 template<
typename Derived,
typename MotionDerived>
20 typedef typename MotionAlgebraAction<Derived, MotionDerived>::ReturnType ReturnType;
23 template<
typename Derived>
28 FORCE_TYPEDEF_TPL(Derived);
36 using Base::operator=;
60 return other.derived() == derived();
67 return derived().set(other.derived());
72 return derived().set(other.derived());
84 Derived &
operator=(
const Eigen::MatrixBase<V6> & v)
86 EIGEN_STATIC_ASSERT_VECTOR_ONLY(V6);
87 assert(v.size() == 6);
88 linear() = v.template segment<3>(LINEAR);
89 angular() = v.template segment<3>(ANGULAR);
93 ForcePlain operator-()
const
95 return derived().__opposite__();
100 return derived().__plus__(f.derived());
102 template<
typename F1>
105 return derived().__minus__(f.derived());
108 template<
typename F1>
111 return derived().__pequ__(f.derived());
113 template<
typename F1>
116 f.derived().addTo(derived());
120 template<
typename M1>
123 return derived().__mequ__(v.derived());
126 ForcePlain __opposite__()
const
131 template<
typename M1>
137 template<
typename M1>
143 template<
typename M1>
151 template<
typename M1>
159 template<
typename OtherScalar>
160 ForcePlain __mult__(
const OtherScalar & alpha)
const
165 template<
typename OtherScalar>
166 ForcePlain __div__(
const OtherScalar & alpha)
const
168 return derived().__mult__((OtherScalar)(1) / alpha);
171 template<
typename F1>
174 return phi.linear().dot(
linear()) + phi.angular().dot(
angular());
177 template<
typename M1,
typename M2>
184 template<
typename M1>
188 motionAction(v, res);
192 template<
typename M2>
195 const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const
197 return derived().isApprox_impl(f, prec);
200 template<
typename D2>
203 const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const
208 bool isZero_impl(
const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const
213 template<
typename S2,
int O2,
typename D2>
221 template<
typename S2,
int O2>
225 se3Action_impl(m, res);
229 template<
typename S2,
int O2,
typename D2>
232 f.
linear().noalias() = m.rotation().transpose() *
linear();
234 m.rotation().transpose() * (
angular() - m.translation().cross(
linear()));
237 template<
typename S2,
int O2>
241 se3ActionInverse_impl(m, res);
245 void disp_impl(std::ostream & os)
const
247 os <<
" f = " <<
linear().transpose() << std::endl
248 <<
"tau = " <<
angular().transpose() << std::endl;
254 return derived().ref();
260 ForceDense(
const ForceDense &) =
delete;
265 template<
typename F1>
266 typename traits<F1>::ForcePlain
269 return f.derived() * alpha;
Base interface for forces representation.
bool isApprox(const Derived &other, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
ConstAngularType angular() const
Return the angular part of the force vector.
ConstLinearType linear() const
Return the linear part of the force vector.
bool isZero(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
bool isApprox(const Derived &other, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
ConstAngularType angular() const
Return the angular part of the force vector.
ConstLinearType linear() const
Return the linear part of the force vector.
Derived & operator=(const ForceBase< Derived > &other)
Copies the Derived Force into *this.
Main pinocchio namespace.
Return type of the ation of a Motion onto an object of type D.
Common traits structure to fully define base classes for CRTP.