10 #ifndef EIGEN_LGSM_DISPLACEMENT_H 11 #define EIGEN_LGSM_DISPLACEMENT_H 27 template<
class Derived>
31 typedef typename internal::traits<Derived>::Scalar
Scalar;
50 inline Map<Rotation3D>
getRotation(){
return Map<Rotation3D>(this->
derived().get().template head<4>().data()); }
52 inline const Map<const Rotation3D>
getRotation()
const{
return Map<const Rotation3D>(this->
derived().get().template head<4>().data()); }
56 inline const Map<const Vector3>
getTranslation()
const {
return Map<const Vector3>(this->
get().
template tail<3>().data()); }
99 template<
typename NewScalarType>
100 inline typename internal::cast_return_type<Derived, Displacement<NewScalarType> >::type
cast()
const 102 return typename internal::cast_return_type<Derived, Displacement<NewScalarType> >::type(
103 this->
get().
template cast<NewScalarType>());
108 this->
derived().get() = g.get();
115 template<
class OtherDerived>
116 friend std::ostream& operator <<(std::ostream& os, const DisplacementBase<OtherDerived>& d);
121 Matrix<Scalar, 4, 4> m;
128 template<
class Derived>
129 inline std::ostream& operator <<(std::ostream& os, const DisplacementBase<Derived>& d)
131 os << d.x() <<
"\t" << d.y() <<
"\t" << d.z() <<
"\t" << d.qw() <<
"\t" << d.qx() <<
"\t" << d.qy() <<
"\t" << d.qz();
140 template<
typename _Scalar>
141 struct traits<
Displacement<_Scalar> > : traits<LieGroup<Array<_Scalar, 7, 1> > >
158 template<
typename _Scalar>
168 typedef typename internal::traits<Displacement>::Coefficients
Coefficients;
178 template<
typename Derived>
182 template<
typename Derived>
183 explicit inline Displacement(
const MatrixBase<Derived>& other) { *
this = other; }
190 EIGEN_STRONG_INLINE
Displacement(Scalar
x, Scalar
y, Scalar
z, Scalar
qw = (Scalar)1.0, Scalar
qx = (Scalar)0.0, Scalar
qy = (Scalar)0.0, Scalar
qz = (Scalar)0.0) {
203 EIGEN_STRONG_INLINE
Displacement(
const typename Base::Vector3& v,
const typename Base::Rotation3D& r) {
209 inline Coefficients&
get() {
return m_coeffs; }
211 inline const Coefficients&
get()
const {
return m_coeffs; }
228 template<
typename _Scalar,
int MapOptions,
typename Str
ideType>
229 struct traits<Map<
Displacement<_Scalar>, MapOptions, StrideType> > : Map<LieGroup<Array<_Scalar, 7, 1> >, MapOptions, StrideType>
245 template<
typename _Scalar,
int MapOptions,
typename Str
ideType>
252 EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Map)
253 typedef typename
internal::traits<Map>::Coefficients Coefficients;
256 template<
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
257 inline Map(
const Array<Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& g) : m_coeffs(g.data()) {};
259 inline Map(Scalar* data) : m_coeffs(data) {};
260 inline Map(
const Map& m) : m_coeffs(m.
get()) {};
262 inline Coefficients&
get() {
return m_coeffs; }
263 inline const Coefficients&
get()
const {
return m_coeffs; }
Base::PlainObject PlainObject
Base class describing a rigid Displacement or a 3D Frame position.
Displacement(const DisplacementBase< Derived > &other)
Displacement(const MatrixBase< Derived > &other)
DisplacementBase< Map< Displacement< Scalar > > > Base
Displacement< _Scalar > PlainObject
EIGEN_STRONG_INLINE Displacement(const typename Base::Vector3 &v, const typename Base::Rotation3D &r)
internal::traits< Displacement >::Coefficients Coefficients
const Derived & derived() const
Matrix< Scalar, 3, 1 > Vector3
Map< Vector3 > getTranslation()
Displacement(const Displacement &other)
DisplacementBase< Displacement< Scalar > > Base
Displacement(const Array< Scalar, 7, 1 > &g)
const Map< const Rotation3D > getRotation() const
Base class for all Lie Group class.
Displacement< double > Displacementd
internal::traits< Derived >::PlainObject PlainObject
Map< Rotation3D > getRotation()
internal::cast_return_type< Derived, Displacement< NewScalarType > >::type cast() const
Base class for all Lie Algebra class.
Map(const Array< Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &g)
LieGroupBase< Array< Scalar, 7, 1 >, Derived > Base
Displacement< float > Displacementf
Matrix< Scalar, 4, 4 > toHomogeneousMatrix() const
Class describing an element of a Lie Group.
EIGEN_STRONG_INLINE Displacement(Scalar x, Scalar y, Scalar z, Scalar qw=(Scalar) 1.0, Scalar qx=(Scalar) 0.0, Scalar qy=(Scalar) 0.0, Scalar qz=(Scalar) 0.0)
EIGEN_STRONG_INLINE DisplacementBase & operator=(const typename Base::PlainObject &g)
internal::traits< Derived >::Scalar Scalar
const Map< const Vector3 > getTranslation() const
Class describing a rigid Displacement or a 3D Frame position.
Displacement< _Scalar > PlainObject