Commit 088561f6 authored by jcarpent's avatar jcarpent
Browse files

[C++] Set shortname to non static method

parent 5314a61e
......@@ -366,6 +366,7 @@ namespace se3
const JointIndex & id() const { return i_id; }
void setIndexes(JointIndex id,int q,int v) { i_id = id, i_q = q; i_v = v; }
std::string shortname() const { return derived().shortname(); }
/* Acces to dedicated segment in robot config space. */
......
......@@ -412,8 +412,8 @@ namespace se3
public:
template<typename D>
std::string operator()(const JointModelBase<D> &) const
{ return D::shortname(); }
std::string operator()(const JointModelBase<D> & jmodel) const
{ return jmodel.shortname(); }
static std::string run(const JointModelVariant & jmodel)
{ return boost::apply_visitor( JointShortnameVisitor(), jmodel ); }
......
......@@ -238,7 +238,7 @@ namespace se3
return *this;
}
static const std::string shortname()
std::string shortname() const
{
return std::string("JointModelDense");
}
......
......@@ -387,7 +387,7 @@ namespace se3
);
}
static const std::string shortname()
std::string shortname() const
{
return std::string("JointModelFreeFlyer");
}
......
......@@ -440,7 +440,7 @@ namespace se3
);
}
static const std::string shortname()
std::string shortname() const
{
return std::string("JointModelPlanar");
}
......
......@@ -446,7 +446,7 @@ namespace se3
);
}
static const std::string shortname()
std::string shortname() const
{
return std::string("JointModelPrismaticUnaligned");
}
......
......@@ -501,7 +501,7 @@ namespace se3
);
}
static const std::string shortname();
std::string shortname() const;
template <class D>
bool operator == (const JointModelBase<D> &) const
......@@ -522,7 +522,7 @@ namespace se3
typedef JointModelPrismatic<0> JointModelPX;
template<> inline
const std::string JointModelPrismatic<0>::shortname()
std::string JointModelPrismatic<0>::shortname() const
{
return std::string("JointModelPX");
}
......@@ -532,7 +532,7 @@ namespace se3
typedef JointModelPrismatic<1> JointModelPY;
template<> inline
const std::string JointModelPrismatic<1>::shortname()
std::string JointModelPrismatic<1>::shortname() const
{
return std::string("JointModelPY");
}
......@@ -542,7 +542,7 @@ namespace se3
typedef JointModelPrismatic<2> JointModelPZ;
template<> inline
const std::string JointModelPrismatic<2>::shortname()
std::string JointModelPrismatic<2>::shortname() const
{
return std::string("JointModelPZ");
}
......
......@@ -450,7 +450,7 @@ namespace se3
);
}
static const std::string shortname()
std::string shortname() const
{
return std::string("JointModelRevoluteUnaligned");
}
......
......@@ -251,7 +251,7 @@ namespace se3
);
}
static const std::string shortname();
std::string shortname() const;
template <class D>
bool operator == (const JointModelBase<D> &) const
......@@ -273,7 +273,7 @@ namespace se3
typedef JointModelRevoluteUnbounded<0> JointModelRUBX;
template<> inline
const std::string JointModelRevoluteUnbounded<0>::shortname()
std::string JointModelRevoluteUnbounded<0>::shortname() const
{
return std::string("JointModelRUBX") ;
}
......@@ -283,7 +283,7 @@ namespace se3
typedef JointModelRevoluteUnbounded<1> JointModelRUBY;
template<> inline
const std::string JointModelRevoluteUnbounded<1>::shortname()
std::string JointModelRevoluteUnbounded<1>::shortname() const
{
return std::string("JointModelRUBY") ;
}
......@@ -293,7 +293,7 @@ namespace se3
typedef JointModelRevoluteUnbounded<2> JointModelRUBZ;
template<> inline
const std::string JointModelRevoluteUnbounded<2>::shortname()
std::string JointModelRevoluteUnbounded<2>::shortname() const
{
return std::string("JointModelRUBZ") ;
}
......
......@@ -535,7 +535,7 @@ namespace se3
);
}
static const std::string shortname();
std::string shortname() const;
template <class D>
bool operator == (const JointModelBase<D> &) const
......@@ -557,7 +557,7 @@ namespace se3
typedef JointModelRevolute<0> JointModelRX;
template<> inline
const std::string JointModelRevolute<0>::shortname()
std::string JointModelRevolute<0>::shortname() const
{
return std::string("JointModelRX") ;
}
......@@ -567,7 +567,7 @@ namespace se3
typedef JointModelRevolute<1> JointModelRY;
template<> inline
const std::string JointModelRevolute<1>::shortname()
std::string JointModelRevolute<1>::shortname() const
{
return std::string("JointModelRY") ;
}
......@@ -577,7 +577,7 @@ namespace se3
typedef JointModelRevolute<2> JointModelRZ;
template<> inline
const std::string JointModelRevolute<2>::shortname()
std::string JointModelRevolute<2>::shortname() const
{
return std::string("JointModelRZ") ;
}
......
......@@ -467,7 +467,7 @@ namespace se3
);
}
static const std::string shortname()
std::string shortname() const
{
return std::string("JointModelSphericalZYX");
}
......
......@@ -412,7 +412,7 @@ namespace se3
);
}
static const std::string shortname()
std::string shortname() const
{
return std::string("JointModelSpherical");
}
......
......@@ -379,7 +379,7 @@ namespace se3
);
}
static const std::string shortname()
std::string shortname() const
{
return std::string("JointModelTranslation");
}
......
......@@ -160,7 +160,7 @@ namespace se3
JointModel( const JointModelVariant & model_variant ) : JointModelBoostVariant(model_variant)
{}
const std::string shortname() const
std::string shortname() const
{
return ::se3::shortname(*this);
}
......
......@@ -44,9 +44,9 @@ void test_joint_methods (T & jmodel, typename T::JointDataDerived & jdata)
se3::Inertia::Matrix6 Ia(se3::Inertia::Random().matrix());
bool update_I = false;
if(T::shortname() == "JointModelRUBX" ||
T::shortname() == "JointModelRUBY" ||
T::shortname() == "JointModelRUBZ")
if(jmodel.shortname() == "JointModelRUBX" ||
jmodel.shortname() == "JointModelRUBY" ||
jmodel.shortname() == "JointModelRUBZ")
{
// normalize cos/sin
q1.normalize();
......@@ -65,7 +65,7 @@ void test_joint_methods (T & jmodel, typename T::JointDataDerived & jdata)
jma.calc(jda, q1, q1_dot);
jma.calc_aba(jda, Ia, update_I);
std::string error_prefix("JointModel on " + T::shortname());
std::string error_prefix("JointModel on " + jma.shortname());
BOOST_CHECK_MESSAGE(jmodel.nq() == jma.nq() ,std::string(error_prefix + " - nq "));
BOOST_CHECK_MESSAGE(jmodel.nv() == jma.nv() ,std::string(error_prefix + " - nv "));
......
Supports Markdown
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