Verified Commit 1d996aa5 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: fix operator!= for JointData types

parent 51840667
......@@ -120,13 +120,14 @@ namespace pinocchio
return os;
}
bool operator==(const JointDataBase<Derived> & other) const
template<typename OtherDerived>
bool operator==(const JointDataBase<OtherDerived> & other) const
{
return derived().isEqual(other.derived());
}
/// \brief Default operator== implementation
bool isEqual(const JointDataBase<Derived> & other) const
bool isEqual(const JointDataBase & other) const
{
return S() == other.S()
&& M() == other.M()
......@@ -138,6 +139,14 @@ namespace pinocchio
;
}
/// \brief Default operator== implementation
template<typename OtherDerived>
bool isEqual(const JointDataBase<OtherDerived> & /*other*/) const
{
return false;
;
}
bool operator!=(const JointDataBase<Derived> & other) const
{
return derived().isNotEqual(other.derived());
......
//
// Copyright (c) 2019 INRIA
// Copyright (c) 2019-2021 INRIA
//
#ifndef __pinocchio_joint_mimic_hpp__
#define __pinocchio_joint_mimic_hpp__
#ifndef __pinocchio_multibody_joint_mimic_hpp__
#define __pinocchio_multibody_joint_mimic_hpp__
#include "pinocchio/macros.hpp"
#include "pinocchio/multibody/joint/joint-base.hpp"
......@@ -316,6 +316,7 @@ namespace pinocchio
return *this;
}
using Base::isEqual;
bool isEqual(const JointDataMimic & other) const
{
return Base::isEqual(other)
......@@ -635,4 +636,4 @@ namespace pinocchio
} // namespace pinocchio
#endif // ifndef __pinocchio_joint_mimic_hpp__
#endif // ifndef __pinocchio_multibody_joint_mimic_hpp__
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