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); }
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>
172 typename internal::SE3GroupAction<Derived>::ReturnType
174 {
return derived().se3Action_impl(m); }
187 template<
typename S2,
int O2>
188 typename internal::SE3GroupAction<Derived>::ReturnType
190 {
return derived().se3ActionInverse_impl(m); }
192 template<
typename M1>
193 typename internal::MotionAlgebraAction<Derived,M1>::ReturnType
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__ bool operator!=(const ForceBase< F2 > &other) const
Derived & operator=(const ForceBase< Derived > &other)
Copies the Derived Force into *this.
ForcePlain operator*(const OtherScalar &alpha) const
Derived & operator-=(const ForceBase< Derived > &phi)
Replaces *this by *this - other.
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
Derived operator+(const ForceBase< Derived > &phi) const
bool operator==(const ForceBase< F2 > &other) const
ForcePlain operator/(const OtherScalar &alpha) const
internal::SE3GroupAction< Derived >::ReturnType se3Action(const SE3Tpl< S2, O2 > &m) const
Transform from A to B coordinates the Force represented by *this such that .
internal::SE3GroupAction< Derived >::ReturnType se3ActionInverse(const SE3Tpl< S2, O2 > &m) const
Transform from B to A coordinates the Force represented by *this such that .
Derived operator-() 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.
ConstAngularType angular() const
Return the angular part of the force vector.
Base interface for forces representation.
ToVectorConstReturnType toVector() const
Return the force as an Eigen vector.
Main pinocchio namespace.
AngularType angular()
Return the angular part of the force vector.
Derived operator-(const ForceBase< Derived > &phi) const
ConstLinearType linear() const
Return the linear part of the force vector.
void linear(const Eigen::MatrixBase< V3Like > &f)
Set the linear part of the force vector.
bool isApprox(const Derived &other, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const