Commit b81ef63f authored by Florent Lamiraux's avatar Florent Lamiraux Committed by Florent Lamiraux florent@laas.fr
Browse files

Add method name () in OperationBase and derived classes.

parent 79251600
......@@ -41,6 +41,9 @@ namespace se3
typedef CartesianProductOperation<LieGroup1, LieGroup2> LieGroupDerived;
SE3_LIE_GROUP_TYPEDEF_TEMPLATE;
CartesianProductOperation () : lg1_ (), lg2_ ()
{
}
/// Get dimension of Lie Group vector representation
///
/// For instance, for SO(3), the dimension of the vector representation is
......@@ -55,6 +58,12 @@ namespace se3
return NV;
}
std::string name () const
{
std::ostringstream oss; oss << lg1_.name () << "*" << lg2_.name ();
return oss.str ();
}
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,
......@@ -114,6 +123,9 @@ namespace se3
return LieGroup1::isSameConfiguration(q0.template head<LieGroup1::NQ>(), q1.template head<LieGroup1::NQ>(), prec)
+ LieGroup2::isSameConfiguration(q0.template tail<LieGroup2::NQ>(), q1.template tail<LieGroup2::NQ>(), prec);
}
private:
LieGroup1 lg1_;
LieGroup2 lg2_;
}; // struct CartesianProductOperation
} // namespace se3
......
......@@ -244,6 +244,9 @@ namespace se3
/// Get dimension of Lie Group tangent space
Index nv () const;
/// Get name of instance
std::string name () const;
Derived& derived ()
{
return static_cast <Derived&> (*this);
......
......@@ -242,6 +242,13 @@ namespace se3 {
{
return Derived::nv ();
}
template <class Derived>
std::string LieGroupOperationBase <Derived>::name () const
{
return Derived::name ();
}
} // namespace se3
#endif // __se3_lie_group_operation_base_hxx__
......@@ -75,6 +75,11 @@ namespace se3
return NV;
}
std::string name () const
{
return std::string ("SE(2)");
}
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,
......@@ -222,6 +227,11 @@ namespace se3
return NV;
}
std::string name () const
{
return std::string ("SE(3)");
}
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,
......
......@@ -69,6 +69,11 @@ namespace se3
return NV;
}
std::string name () const
{
return std::string ("SO(2)");
}
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,
......@@ -176,6 +181,11 @@ namespace se3
return NV;
}
std::string name () const
{
return std::string ("SO(3)");
}
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,
......
......@@ -69,6 +69,12 @@ namespace se3
return size_;
}
std::string name () const
{
std::ostringstream oss; oss << "R^" << size_;
return oss.str ();
}
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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment