6 #ifndef __pinocchio_spatial_force_base_hpp__
7 #define __pinocchio_spatial_force_base_hpp__
22 template<
class Derived>
26 FORCE_TYPEDEF_TPL(Derived);
30 return *
static_cast<Derived *
>(
this);
32 const Derived & derived()
const
34 return *
static_cast<const Derived *
>(
this);
37 Derived & const_cast_derived()
const
39 return *
const_cast<Derived *
>(&derived());
49 return derived().angular_impl();
59 return derived().linear_impl();
65 return derived().angular_impl();
71 return derived().linear_impl();
81 template<
typename V3Like>
82 void angular(
const Eigen::MatrixBase<V3Like> & n)
84 derived().angular_impl(n.derived());
94 template<
typename V3Like>
95 void linear(
const Eigen::MatrixBase<V3Like> & f)
97 derived().linear_impl(f.derived());
110 return derived().toVector_impl();
116 return derived().toVector_impl();
123 operator Vector6()
const
132 template<
typename F2>
135 return derived().isEqual_impl(other.derived());
140 template<
typename F2>
143 return !(derived() == other.derived());
149 const Derived & other,
150 const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const
152 return derived().isApprox_impl(other, prec);
158 bool isZero(
const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const
160 return derived().isZero_impl(prec);
168 return derived().setFrom(other.derived());
177 return derived().__pequ__(phi.derived());
186 return derived().__mequ__(phi.derived());
193 return derived().__plus__(phi.derived());
198 template<
typename OtherScalar>
201 return derived().__mult__(alpha);
206 template<
typename OtherScalar>
209 return derived().__div__(alpha);
216 return derived().__opposite__();
223 return derived().__minus__(phi.derived());
228 template<
typename MotionDerived>
231 return derived().dot(m.derived());
246 template<
typename S2,
int O2>
249 return derived().se3Action_impl(m);
264 template<
typename S2,
int O2>
267 return derived().se3ActionInverse_impl(m);
270 template<
typename M1>
271 typename MotionAlgebraAction<Derived, M1>::ReturnType
274 return derived().motionAction(v.derived());
277 void disp(std::ostream & os)
const
279 derived().disp_impl(os);
281 friend std::ostream & operator<<(std::ostream & os,
const ForceBase<Derived> & X)
Base interface for forces representation.
SE3GroupAction< Derived >::ReturnType se3ActionInverse(const SE3Tpl< S2, O2 > &m) const
Transform from B to A coordinates the Force represented by *this such that.
AngularType angular()
Return the angular part of the force vector.
bool operator!=(const ForceBase< F2 > &other) const
bool operator==(const ForceBase< F2 > &other) const
void angular(const Eigen::MatrixBase< V3Like > &n)
Set the angular part of the force vector.
Derived & operator+=(const ForceBase< Derived > &phi)
Replaces *this by *this + other.
Derived operator-() 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.
void linear(const Eigen::MatrixBase< V3Like > &f)
Set the linear part of the force vector.
Derived operator-(const ForceBase< Derived > &phi) const
ConstLinearType linear() const
Return the linear part of the force vector.
bool isZero(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
Derived & operator=(const ForceBase< Derived > &other)
Copies the Derived Force into *this.
LinearType linear()
Return the linear part of the force vector.
Derived & operator-=(const ForceBase< Derived > &phi)
Replaces *this by *this - other.
ForcePlain operator*(const OtherScalar &alpha) const
ToVectorReturnType toVector()
Return the force as an Eigen vector.
Derived operator+(const ForceBase< Derived > &phi) const
SE3GroupAction< Derived >::ReturnType se3Action(const SE3Tpl< S2, O2 > &m) const
Transform from A to B coordinates the Force represented by *this such that.
ToVectorConstReturnType toVector() const
Return the force as an Eigen vector.
ForcePlain operator/(const OtherScalar &alpha) const
Scalar dot(const MotionDense< MotionDerived > &m) const
Main pinocchio namespace.