6 #ifndef __pinocchio_force_base_hpp__ 7 #define __pinocchio_force_base_hpp__ 21 template<
class Derived>
25 FORCE_TYPEDEF_TPL(Derived);
27 Derived & derived() {
return *
static_cast<Derived*
>(
this); }
28 const Derived& derived()
const {
return *
static_cast<const Derived*
>(
this); }
35 ConstAngularType
angular()
const {
return derived().angular_impl(); }
42 ConstLinearType
linear()
const {
return derived().linear_impl(); }
45 AngularType
angular() {
return derived().angular_impl(); }
48 LinearType
linear() {
return derived().linear_impl(); }
58 template<
typename V3Like>
59 void angular(
const Eigen::MatrixBase<V3Like> & n)
60 { derived().angular_impl(n.derived()); }
69 template<
typename V3Like>
70 void linear(
const Eigen::MatrixBase<V3Like> & f)
71 { derived().linear_impl(f.derived()); }
81 ToVectorConstReturnType
toVector()
const {
return derived().toVector_impl(); }
84 ToVectorReturnType
toVector() {
return derived().toVector_impl(); }
90 operator Vector6()
const {
return toVector(); }
101 template<
typename F2>
106 bool isApprox(
const Derived & other,
const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const 107 {
return derived().isApprox_impl(other, prec); }
111 bool isZero(
const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const 112 {
return derived().isZero_impl(prec); }
118 {
return derived().setFrom(other.derived()); }
138 template<
typename OtherScalar>
139 ForcePlain
operator*(
const OtherScalar & alpha)
const {
return derived().__mult__(alpha); }
143 template<
typename OtherScalar>
144 ForcePlain
operator/(
const OtherScalar & alpha)
const {
return derived().__div__(alpha); }
148 Derived
operator-()
const {
return derived().__opposite__(); }
156 template<
typename MotionDerived>
171 template<
typename S2,
int O2>
174 {
return derived().se3Action_impl(m); }
187 template<
typename S2,
int O2>
190 {
return derived().se3ActionInverse_impl(m); }
192 template<
typename M1>
196 return derived().motionAction(v.derived());
199 void disp(std::ostream & os)
const { derived().disp_impl(os); }
200 friend std::ostream & operator << (std::ostream & os, const ForceBase<Derived> & X)
210 #endif // ifndef __pinocchio_force_base_hpp__ Derived & operator=(const ForceBase< Derived > &other)
Copies the Derived Force into *this.
Derived & operator-=(const ForceBase< Derived > &phi)
Replaces *this by *this - other.
SE3GroupAction< Derived >::ReturnType se3Action(const SE3Tpl< S2, O2 > &m) const
Transform from A to B coordinates the Force represented by *this such that .
LinearType linear()
Return the linear part of the force vector.
Derived & operator+=(const ForceBase< Derived > &phi)
Replaces *this by *this + other.
Scalar dot(const MotionDense< MotionDerived > &m) const
ToVectorConstReturnType toVector() const
Return the force as an Eigen vector.
SE3GroupAction< Derived >::ReturnType se3ActionInverse(const SE3Tpl< S2, O2 > &m) const
Transform from B to A coordinates the Force represented by *this such that .
ConstAngularType angular() const
Return the angular part of the force vector.
ForcePlain operator/(const OtherScalar &alpha) const
bool isApprox(const Derived &other, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
void angular(const Eigen::MatrixBase< V3Like > &n)
Set the angular part of the force vector.
ToVectorReturnType toVector()
Return the force as an Eigen vector.
Base interface for forces representation.
Derived operator-(const ForceBase< Derived > &phi) const
Main pinocchio namespace.
bool operator!=(const ForceBase< F2 > &other) const
bool operator==(const ForceBase< F2 > &other) const
AngularType angular()
Return the angular part of the force vector.
ForcePlain operator*(const OtherScalar &alpha) const
bool isZero(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
ConstLinearType linear() const
Return the linear part of the force vector.
Derived operator-() const
Derived operator+(const ForceBase< Derived > &phi) const
void linear(const Eigen::MatrixBase< V3Like > &f)
Set the linear part of the force vector.