10 #ifndef EIGEN_LGSM_LIE_WRENCH_H 11 #define EIGEN_LGSM_LIE_WRENCH_H 29 template<
class Derived>
30 struct traits<
WrenchBase<Derived> > : traits<LieAlgebraDualBase<Matrix<typename internal::traits<Derived>::Scalar, 6, 1>, Derived> > {
34 template<
class Derived>
51 typedef Matrix<Scalar, 3, 1>
Force;
56 inline Scalar tx()
const {
return this->getTorque().x(); }
58 inline Scalar
ty()
const {
return this->getTorque().y(); }
60 inline Scalar
tz()
const {
return this->getTorque().z(); }
62 inline Scalar
fx()
const {
return this->getForce().x(); }
64 inline Scalar
fy()
const {
return this->getForce().y(); }
66 inline Scalar
fz()
const {
return this->getForce().z(); }
69 inline Scalar&
tx() {
return this->getTorque().x(); }
71 inline Scalar&
ty() {
return this->getTorque().y(); }
73 inline Scalar&
tz() {
return this->getTorque().z(); }
75 inline Scalar&
fx() {
return this->getForce().x(); }
77 inline Scalar&
fy() {
return this->getForce().y(); }
79 inline Scalar&
fz() {
return this->getForce().z(); }
83 inline Map<Torque>
getTorque(){
return Map<Torque>(this->data()); }
85 inline Map<const Torque>
getTorque()
const {
return Map<const Torque>(this->data()); }
87 inline Map<Force>
getForce() {
return Map<Force>(this->derived().get().template tail<3>().data()); }
89 inline Map<const Force>
getForce()
const {
return Map<const Force>(this->derived().get().template tail<3>().data()); }
91 template<
class RotationDerived>
inline Wrench<Scalar> changeFrame(
const LieGroupBase<Quaternion<Scalar>, RotationDerived>&)
const;
93 template<
class OtherDerived>
inline Wrench<Scalar> changePoint(
const MatrixBase<OtherDerived>& point)
const;
97 template<
class Derived>
98 template<
class RotationDerived>
101 rot*this->getForce());
105 template<
class Derived>
106 template<
class OtherDerived>
108 return Wrench<Scalar>(this->getTorque() + this->getForce.cross(point),
117 template<
typename _Scalar>
118 struct traits<
Wrench<_Scalar> > : traits<LieAlgebraDual<Matrix<_Scalar, 6, 1> > >
134 template<
typename _Scalar>
140 EIGEN_DENSE_PUBLIC_INTERFACE(
Wrench)
142 EIGEN_INHERIT_ASSIGNMENT_OPERATORS(
Wrench)
159 inline Wrench(Scalar tx, Scalar ty, Scalar tz, Scalar fx, Scalar fy, Scalar fz) {
160 m_coeffs << tx, ty, tz, fx, fy, fz;
163 template<
typename OtherDerived>
164 EIGEN_STRONG_INLINE
Wrench(
const MatrixBase<OtherDerived>& other)
169 template<
typename OtherDerived>
177 this->getForce() = f;
178 this->getTorque() = t;
200 template<
typename _Scalar,
int MapOptions,
typename Str
ideType>
201 struct traits<Map<
Wrench<_Scalar>, MapOptions, StrideType> > : traits<Map<LieAlgebraDual<Matrix<_Scalar, 6, 1> >, MapOptions, StrideType> >
216 template<
typename _Scalar,
int MapOptions,
typename Str
ideType>
217 class Map<
Wrench<_Scalar>, MapOptions, StrideType> :
public WrenchBase<Map<Wrench<_Scalar>, MapOptions, StrideType> >{
221 EIGEN_DENSE_PUBLIC_INTERFACE(Map)
222 EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Map)
226 inline Map(const
Wrench<Scalar>& w) : m_coeffs(w.get()) {};
227 template<
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
228 inline Map(
const Array<Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& g) : m_coeffs(g.data()) {};
230 inline Map(Scalar* data) : m_coeffs(data) {};
231 inline Map(
const Map& m) : m_coeffs(m.get()) {};
EIGEN_STRONG_INLINE Wrench & operator=(const MatrixBase< OtherDerived > &other)
Wrench(Scalar tx, Scalar ty, Scalar tz, Scalar fx, Scalar fy, Scalar fz)
Wrench(const typename Base::Torque &t, const typename Base::Force &f)
Map< const Torque > getTorque() const
Base class describing a Wrench.
WrenchBase< Map< Wrench< _Scalar > > > Base
internal::traits< Wrench< _Scalar > >::Coefficients Coefficients
EIGEN_STRONG_INLINE Wrench(const MatrixBase< OtherDerived > &other)
LieAlgebraDualBase< Matrix< typename internal::traits< Derived >::Scalar, 6, 1 >, Derived > Base
Wrench(const typename Base::PlainObject &g)
Matrix< Scalar, 3, 1 > Force
Wrench(const BaseType &g)
Wrench< Scalar > changeFrame(const LieGroupBase< Quaternion< Scalar >, RotationDerived > &) const
WrenchBase< Wrench< _Scalar > > Base
Map< const Force > getForce() const
Wrench< Scalar > changePoint(const MatrixBase< OtherDerived > &point) const
Map< Torque > getTorque()
Base class for all Lie Group class.
Matrix< internal::traits< Wrench< _Scalar > >::Scalar, 6, 1 > BaseType
Base class for all Lie Algebra class.
internal::traits< Wrench >::Coefficients Coefficients
Class describing an element of a Lie algebra dual.
Class describing a Wrench.
internal::traits< Map >::Coefficients Coefficients
Map(const Array< Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &g)