Commit de6ee5bc authored by Justin Carpentier's avatar Justin Carpentier

geometry: fix operator==

parent 5bd8ef10
......@@ -98,7 +98,8 @@ namespace eigenpy
{ self.angle() = angle; }
static bool __eq__(const AngleAxis & u, const AngleAxis & v)
{ return u.isApprox(v); }
{ return u.axis() == v.axis() && v.angle() == u.angle(); }
static bool __ne__(const AngleAxis & u, const AngleAxis & v)
{ return !__eq__(u,v); }
......
......@@ -178,9 +178,9 @@ namespace eigenpy
return self.isApprox(other,prec);
}
static bool __eq__(const Quaternion& u, const Quaternion& v)
static bool __eq__(const Quaternion & u, const Quaternion & v)
{
return u.isApprox(v,1e-9);
return u.coeffs() == v.coeffs();
}
static bool __ne__(const Quaternion& u, const Quaternion& v)
......
......@@ -20,7 +20,7 @@ assert(isapprox(np.linalg.norm(q.coeffs()),1))
r = AngleAxis(q)
q2 = Quaternion(r)
assert(q==q2)
assert(q==q)
assert(isapprox(q.coeffs(),q2.coeffs()))
Rq = q.matrix()
......@@ -29,7 +29,7 @@ assert(isapprox(Rq*Rq.T,np.eye(3)))
assert(isapprox(Rr,Rq))
qR = Quaternion(Rr)
assert(q==qR)
assert(q.isApprox(qR))
assert(isapprox(q.coeffs(),qR.coeffs()))
assert(isapprox(qR[3],1./np.sqrt(30)))
......
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