Skip to content
Snippets Groups Projects
Commit 3b76cb80 authored by Nicolas Mansard's avatar Nicolas Mansard Committed by Valenza Florian
Browse files

Correction of the warning at CRBA compilation.

parent 6c609e48
No related branches found
No related tags found
No related merge requests found
......@@ -28,15 +28,16 @@ namespace se3
ForceTpl(const Eigen::MatrixBase<f3_t> & f,const Eigen::MatrixBase<n3_t> & n)
: m_n(n), m_f(f) {}
template<typename f6>
ForceTpl(const Eigen::MatrixBase<f6> & f)
: m_n(f.template segment<3>(ANGULAR)),
m_f(f.template segment<3>(LINEAR))
explicit ForceTpl(const Eigen::MatrixBase<f6> & f)
: m_n(f.template segment<3>(ANGULAR))
, m_f(f.template segment<3>(LINEAR))
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(f6);
assert( f.size() == 6 );
}
template<typename S2,int O2>
ForceTpl(const ForceTpl<S2,O2> & clone) : m_n(clone.angular()), m_f(clone.linear()) {}
explicit ForceTpl(const ForceTpl<S2,O2> & clone)
: m_n(clone.angular()), m_f(clone.linear()) {}
// initializers
static ForceTpl Zero() { return ForceTpl(Vector3::Zero(), Vector3::Zero()); }
......@@ -58,8 +59,10 @@ namespace se3
void angular(const Vector3 & n) { m_n = n; }
// Arithmetic operators
ForceTpl & operator=(const Vector6 & phi)
template<typename F6>
ForceTpl & operator=(const Eigen::MatrixBase<F6> & phi)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(F6); assert(phi.size() == 6);
m_n = phi.template segment<3>(ANGULAR);
m_f = phi.template segment<3>(LINEAR);
return *this;
......
......@@ -29,18 +29,21 @@ namespace se3
MotionTpl(const Eigen::MatrixBase<v1> & v, const Eigen::MatrixBase<v2> & w)
: m_w(w), m_v(v) {}
template<typename v6>
MotionTpl(const Eigen::MatrixBase<v6> & v) :
m_w(v.template segment<3>(ANGULAR)),
m_v(v.template segment<3>(LINEAR))
explicit MotionTpl(const Eigen::MatrixBase<v6> & v)
: m_w(v.template segment<3>(ANGULAR))
, m_v(v.template segment<3>(LINEAR))
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(v6);
assert( v.size() == 6 );
}
template<typename S2,int O2>
MotionTpl(const MotionTpl<S2,O2> & clone) : m_w(clone.angular()),m_v(clone.linear()) {}
explicit MotionTpl(const MotionTpl<S2,O2> & clone)
: m_w(clone.angular()),m_v(clone.linear()) {}
// initializers
static MotionTpl Zero() { return MotionTpl(Vector3::Zero(), Vector3::Zero()); }
static MotionTpl Random() { return MotionTpl(Vector3::Random(),Vector3::Random()); }
Vector6 toVector() const
{
Vector6 v;
......@@ -57,10 +60,10 @@ namespace se3
void linear (const Vector3 & v) { m_v=v; }
// Arithmetic operators
template<typename D>
MotionTpl & operator=(const Eigen::MatrixBase<D> & v)
template<typename V6>
MotionTpl & operator=(const Eigen::MatrixBase<V6> & v)
{
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(D,6);
EIGEN_STATIC_ASSERT_VECTOR_ONLY(V6); assert(v.size() == 6);
m_w = v.template segment<3>(ANGULAR);
m_v = v.template segment<3>(LINEAR);
return *this;
......
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