6 #ifndef __pinocchio_force_base_hpp__ 7 #define __pinocchio_force_base_hpp__ 26 template<
class Derived>
30 FORCE_TYPEDEF_TPL(Derived);
32 Derived & derived() {
return *
static_cast<Derived*
>(
this); }
33 const Derived& derived()
const {
return *
static_cast<const Derived*
>(
this); }
40 ConstAngularType
angular()
const {
return derived().angular_impl(); }
47 ConstLinearType
linear()
const {
return derived().linear_impl(); }
50 AngularType
angular() {
return derived().angular_impl(); }
53 LinearType
linear() {
return derived().linear_impl(); }
63 template<
typename V3Like>
64 void angular(
const Eigen::MatrixBase<V3Like> & n)
65 { derived().angular_impl(n.derived()); }
74 template<
typename V3Like>
75 void linear(
const Eigen::MatrixBase<V3Like> & f)
76 { derived().linear_impl(f.derived()); }
86 ToVectorConstReturnType
toVector()
const {
return derived().toVector_impl(); }
89 ToVectorReturnType
toVector() {
return derived().toVector_impl(); }
95 operator Vector6()
const {
return toVector(); }
101 template<
typename F2>
106 template<
typename F2>
111 bool isApprox(
const Derived & other,
const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const 112 {
return derived().isApprox_impl(other, prec); }
116 bool isZero(
const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const 117 {
return derived().isZero_impl(prec); }
123 {
return derived().setFrom(other.derived()); }
143 template<
typename OtherScalar>
144 ForcePlain
operator*(
const OtherScalar & alpha)
const {
return derived().__mult__(alpha); }
148 template<
typename OtherScalar>
149 ForcePlain
operator/(
const OtherScalar & alpha)
const {
return derived().__div__(alpha); }
153 Derived
operator-()
const {
return derived().__opposite__(); }
161 template<
typename MotionDerived>
176 template<
typename S2,
int O2>
177 typename SE3GroupAction<Derived>::ReturnType
179 {
return derived().se3Action_impl(m); }
192 template<
typename S2,
int O2>
193 typename SE3GroupAction<Derived>::ReturnType
195 {
return derived().se3ActionInverse_impl(m); }
197 template<
typename M1>
198 typename MotionAlgebraAction<Derived,M1>::ReturnType
201 return derived().motionAction(v.derived());
204 void disp(std::ostream & os)
const { derived().disp_impl(os); }
205 friend std::ostream & operator << (std::ostream & os, const ForceBase<Derived> & X)
215 #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.