Commit 0631df57 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Add equality operator in class Joint.

parent f87ba669
......@@ -226,6 +226,16 @@ namespace hpp {
/// \}
bool operator== (const Joint& other) const
{
return index() == other.index() && robot() == other.robot();
}
bool operator!= (const Joint& other) const
{
return !operator==(other);
}
protected:
value_type maximalDistanceToParent_;
DeviceWkPtr_t devicePtr;
......
......@@ -43,6 +43,11 @@ BOOST_AUTO_TEST_CASE(joint_bounds)
size_type nJoints (robot->nbJoints ());
for (size_type i=0; i<nJoints; ++i) {
JointPtr_t joint (robot->jointAt (i));
BOOST_CHECK(joint == joint);
BOOST_CHECK(*joint == *robot->jointAt (i));
if (i > 0)
BOOST_CHECK(*joint != *robot->jointAt (i-1));
// Set bounds
vector_t l0 (joint->configSize ());
vector_t u0 (joint->configSize ());
......
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