10 #ifndef EIGEN_LGSM_LIE_TWIST_H 11 #define EIGEN_LGSM_LIE_TWIST_H 29 template<
class Derived>
30 struct traits<
TwistBase<Derived> > : traits<LieAlgebraBase<Matrix<typename internal::traits<Derived>::Scalar, 6, 1>, Derived> > {
34 template<
class Derived>
43 EIGEN_INHERIT_ASSIGNMENT_OPERATORS(
TwistBase)
51 inline Scalar rx()
const {
return this->getAngularVelocity().x(); }
53 inline Scalar
ry()
const {
return this->getAngularVelocity().y(); }
55 inline Scalar
rz()
const {
return this->getAngularVelocity().z(); }
57 inline Scalar
vx()
const {
return this->getLinearVelocity().x(); }
59 inline Scalar
vy()
const {
return this->getLinearVelocity().y(); }
61 inline Scalar
vz()
const {
return this->getLinearVelocity().z(); }
64 inline Scalar&
rx() {
return this->getAngularVelocity().x(); }
66 inline Scalar&
ry() {
return this->getAngularVelocity().y(); }
68 inline Scalar&
rz() {
return this->getAngularVelocity().z(); }
70 inline Scalar&
vx() {
return this->getLinearVelocity().x(); }
72 inline Scalar&
vy() {
return this->getLinearVelocity().y(); }
74 inline Scalar&
vz() {
return this->getLinearVelocity().z(); }
82 inline Map<AngularVelocity>
getAngularVelocity(){
return Map<AngularVelocity>(this->derived().get().template head<3>().data()); }
84 inline Map<const AngularVelocity>
getAngularVelocity()
const {
return Map<const AngularVelocity>(this->derived().get().template head<3>().data()); }
86 inline Map<LinearVelocity>
getLinearVelocity() {
return Map<LinearVelocity>(this->derived().get().template tail<3>().data()); }
88 inline Map<const LinearVelocity>
getLinearVelocity()
const {
return Map<const LinearVelocity>(this->derived().get().template tail<3>().data()); }
90 template<
class RotationDerived>
inline Twist<Scalar> changeFrame(
const LieGroupBase<Quaternion<Scalar>, RotationDerived>&)
const;
92 template<
class OtherDerived>
inline Twist<Scalar> changePoint(
const MatrixBase<OtherDerived>& point)
const;
96 template<
class Derived>
97 template<
class RotationDerived>
100 rot*this->getLinearVelocity());
103 template<
class Derived>
104 template<
class OtherDerived>
107 this->getLinearVelocity() + this->getAngularVelocity().cross(point) );
115 template<
typename Scalar>
117 :
public traits<LieAlgebra<Matrix<Scalar, 6, 1> > >
122 template<
typename Scalar,
int Options>
123 struct traits<Map<
Twist<Scalar>, Options> >
124 :
public traits<Map<LieAlgebra<Matrix<Scalar, 6, 1> >, Options > >
140 template<
typename _Scalar>
146 EIGEN_DENSE_PUBLIC_INTERFACE(
Twist)
148 EIGEN_INHERIT_ASSIGNMENT_OPERATORS(
Twist)
163 inline Twist(Scalar rx, Scalar ry, Scalar rz, Scalar vx, Scalar vy, Scalar vz) {
172 template<
typename OtherDerived>
173 EIGEN_STRONG_INLINE
Twist(
const MatrixBase<OtherDerived>& other)
185 template<
class LinearVelocityDerived,
class AngularVelocityDerived>
186 inline Twist(
const LieAlgebraBase<Matrix<Scalar, 3, 1>, AngularVelocityDerived>& r,
const MatrixBase<LinearVelocityDerived>& v) {
187 this->getLinearVelocity() = v;
188 this->getAngularVelocity() = r;
192 this->getLinearVelocity() = v;
193 this->getAngularVelocity() = r;
226 template<
typename _Scalar,
int MapOptions,
typename Str
ideType>
227 class Map<
Twist<_Scalar>, MapOptions, StrideType> :
public TwistBase<Map<Twist<_Scalar>, MapOptions, StrideType> >{
231 EIGEN_DENSE_PUBLIC_INTERFACE(Map)
232 EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Map)
235 inline Map(const
Twist<Scalar>& d) : m_coeffs(d.get()) {};
236 template<
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
237 inline Map(
const Array<Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& g) : m_coeffs(g.data()) {};
239 inline Map(Scalar* data) : m_coeffs(data) {};
240 inline Map(
const Map& m) : m_coeffs(m.get()) {};
LieAlgebraBase< Matrix< typename internal::traits< Derived >::Scalar, 6, 1 >, Derived > Base
Base class describing a Twist.
Class describing an element of a Lie Algebra.
Twist(Scalar rx, Scalar ry, Scalar rz, Scalar vx, Scalar vy, Scalar vz)
Map< const LinearVelocity > getLinearVelocity() const
internal::traits< Map >::Coefficients Coefficients
Map(const Array< Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &g)
Map< AngularVelocity > getAngularVelocity()
Class describing a Twist.
Twist(const typename Base::AngularVelocity &r, const typename Base::LinearVelocity &v)
Displacement< Scalar > Group
TwistBase< Twist< _Scalar > > Base
Map< LinearVelocity > getLinearVelocity()
Matrix< Scalar, 3, 1 > LinearVelocity
Matrix< internal::traits< Twist< _Scalar > >::Scalar, 6, 1 > BaseType
LieAlgebra< Matrix< Scalar, 3, 1 > > AngularVelocity
Twist(const LieAlgebraBase< Matrix< Scalar, 3, 1 >, AngularVelocityDerived > &r, const MatrixBase< LinearVelocityDerived > &v)
Twist< Scalar > changePoint(const MatrixBase< OtherDerived > &point) const
Base class for all Lie Group class.
Map< const AngularVelocity > getAngularVelocity() const
internal::traits< Twist >::Coefficients Coefficients
Base class for all Lie Algebra class.
TwistBase< Map< Twist< _Scalar > > > Base
internal::traits< Twist< _Scalar > >::Coefficients Coefficients
EIGEN_STRONG_INLINE Twist(const MatrixBase< OtherDerived > &other)
Displacement< Scalar > Group
Twist< Scalar > changeFrame(const LieGroupBase< Quaternion< Scalar >, RotationDerived > &) const