Skip to content
Snippets Groups Projects
Commit 9324fb98 authored by Florent Lamiraux's avatar Florent Lamiraux Committed by Florent Lamiraux florent@laas.fr
Browse files

Add dimension getters in LiegroupOperation classes

parent 86c816fb
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,20 @@ namespace se3
typedef CartesianProductOperation<LieGroup1, LieGroup2> LieGroupDerived;
SE3_LIE_GROUP_TYPEDEF_TEMPLATE;
/// Get dimension of Lie Group vector representation
///
/// For instance, for SO(3), the dimension of the vector representation is
/// 4 (quaternion) while the dimension of the tangent space is 3.
Index nq () const
{
return NQ;
}
/// Get dimension of Lie Group tangent space
Index nv () const
{
return NV;
}
template <class ConfigL_t, class ConfigR_t, class Tangent_t>
static void difference_impl(const Eigen::MatrixBase<ConfigL_t> & q0,
const Eigen::MatrixBase<ConfigR_t> & q1,
......
......@@ -233,7 +233,13 @@ namespace se3
static bool isSameConfiguration_impl(const Eigen::MatrixBase<ConfigL_t> & q0,
const Eigen::MatrixBase<ConfigR_t> & q1,
const Scalar & prec);
/// Get dimension of Lie Group vector representation
///
/// For instance, for SO(3), the dimension of the vector representation is
/// 4 (quaternion) while the dimension of the tangent space is 3.
Index nq () const;
/// Get dimension of Lie Group tangent space
Index nv () const;
/// \}
protected:
......
......@@ -226,6 +226,20 @@ namespace se3 {
{
return q0.isApprox(q1, prec);
}
template <class Derived>
typename LieGroupOperationBase <Derived>::Index
LieGroupOperationBase <Derived>::nq () const
{
return Derived::nq ();
}
template <class Derived>
typename LieGroupOperationBase <Derived>::Index
LieGroupOperationBase <Derived>::nv () const
{
return Derived::nv ();
}
} // namespace se3
#endif // __se3_lie_group_operation_base_hxx__
......@@ -61,6 +61,20 @@ namespace se3
typedef SpecialEuclideanOperation LieGroupDerived;
SE3_LIE_GROUP_TYPEDEF;
/// Get dimension of Lie Group vector representation
///
/// For instance, for SO(3), the dimension of the vector representation is
/// 4 (quaternion) while the dimension of the tangent space is 3.
Index nq () const
{
return NQ;
}
/// Get dimension of Lie Group tangent space
Index nv () const
{
return NV;
}
template <class ConfigL_t, class ConfigR_t, class Tangent_t>
static void difference_impl(const Eigen::MatrixBase<ConfigL_t> & q0,
const Eigen::MatrixBase<ConfigR_t> & q1,
......@@ -193,6 +207,20 @@ namespace se3
typedef Eigen::Map<const Quaternion_t> ConstQuaternionMap_t;
typedef SE3 Transformation_t;
/// Get dimension of Lie Group vector representation
///
/// For instance, for SO(3), the dimension of the vector representation is
/// 4 (quaternion) while the dimension of the tangent space is 3.
Index nq () const
{
return NQ;
}
/// Get dimension of Lie Group tangent space
Index nv () const
{
return NV;
}
template <class ConfigL_t, class ConfigR_t, class Tangent_t>
static void difference_impl(const Eigen::MatrixBase<ConfigL_t> & q0,
const Eigen::MatrixBase<ConfigR_t> & q1,
......
......@@ -55,6 +55,20 @@ namespace se3
typedef SpecialOrthogonalOperation LieGroupDerived;
SE3_LIE_GROUP_TYPEDEF;
/// Get dimension of Lie Group vector representation
///
/// For instance, for SO(3), the dimension of the vector representation is
/// 4 (quaternion) while the dimension of the tangent space is 3.
Index nq () const
{
return NQ;
}
/// Get dimension of Lie Group tangent space
Index nv () const
{
return NV;
}
template <class ConfigL_t, class ConfigR_t, class Tangent_t>
static void difference_impl(const Eigen::MatrixBase<ConfigL_t> & q0,
const Eigen::MatrixBase<ConfigR_t> & q1,
......@@ -147,6 +161,20 @@ namespace se3
typedef Eigen::Map< Quaternion_t> QuaternionMap_t;
typedef Eigen::Map<const Quaternion_t> ConstQuaternionMap_t;
/// Get dimension of Lie Group vector representation
///
/// For instance, for SO(3), the dimension of the vector representation is
/// 4 (quaternion) while the dimension of the tangent space is 3.
Index nq () const
{
return NQ;
}
/// Get dimension of Lie Group tangent space
Index nv () const
{
return NV;
}
template <class ConfigL_t, class ConfigR_t, class Tangent_t>
static void difference_impl(const Eigen::MatrixBase<ConfigL_t> & q0,
const Eigen::MatrixBase<ConfigR_t> & q1,
......
......@@ -41,7 +41,6 @@ namespace se3
typedef VectorSpaceOperation<Size> LieGroupDerived;
SE3_LIE_GROUP_TYPEDEF_TEMPLATE;
typedef typename Eigen::Matrix <Scalar, 1, 1>::Index size_type;
/// Constructor
/// \param size size of the vector space: should be the equal to template
......@@ -52,11 +51,11 @@ namespace se3
assert (Size == Eigen::Dynamic || size_ == Size);
}
size_type nq () const
Index nq () const
{
return size_;
}
size_type nv () const
Index nv () const
{
return size_;
}
......@@ -107,7 +106,7 @@ namespace se3
}
}
private:
size_type size_;
Index size_;
}; // struct VectorSpaceOperation
} // namespace se3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment