@@ -61,7 +61,7 @@ namespace eigenpy
6161 .def (bp::init<Matrix3>((bp::arg (" matrixRotation" ))," Initialize from rotation matrix." ))
6262 .def (bp::init<AngleAxis>((bp::arg (" angleaxis" ))," Initialize from angle axis." ))
6363 .def (bp::init<Quaternion>((bp::arg (" clone" ))," Copy constructor." ))
64- .def (" __init__" ,bp::make_constructor (&QuaternionVisitor::fromTwoVectors ,
64+ .def (" __init__" ,bp::make_constructor (&QuaternionVisitor::FromTwoVectors ,
6565 bp::default_call_policies (),
6666 (bp::arg (" u" ),bp::arg (" v" )))," Initialize from two vector u,v" )
6767 .def (bp::init<Scalar,Scalar,Scalar,Scalar>
@@ -83,9 +83,13 @@ namespace eigenpy
8383 (Scalar (Quaternion::*)()const )&Quaternion::w,
8484 &QuaternionVisitor::setCoeff<3 >," The w coefficient." )
8585
86- .def (" isApprox" ,(bool (Quaternion::*)(const Quaternion &))&Quaternion::template isApprox<Quaternion>,
86+ // .def("isApprox",(bool (Quaternion::*)(const Quaternion &))&Quaternion::template isApprox<Quaternion>,
87+ // "Returns true if *this is approximately equal to other.")
88+ // .def("isApprox",(bool (Quaternion::*)(const Quaternion &, const Scalar prec))&Quaternion::template isApprox<Quaternion>,
89+ // "Returns true if *this is approximately equal to other, within the precision determined by prec..")
90+ .def (" isApprox" ,(bool (*)(const Quaternion &))&isApprox,
8791 " Returns true if *this is approximately equal to other." )
88- .def (" isApprox" ,(bool (Quaternion:: *)(const Quaternion &, const Scalar prec))&Quaternion:: template isApprox<Quaternion> ,
92+ .def (" isApprox" ,(bool (*)(const Quaternion &, const Scalar prec))&isApprox,
8993 " Returns true if *this is approximately equal to other, within the precision determined by prec.." )
9094
9195 /* --- Methods --- */
@@ -131,6 +135,10 @@ namespace eigenpy
131135// .def("FromTwoVectors",&Quaternion::template FromTwoVectors<Vector3,Vector3>,
132136// bp::args("a","b"),
133137// "Returns the quaternion which transform a into b through a rotation.")
138+ .def (" FromTwoVectors" ,&FromTwoVectors,
139+ bp::args (" a" ," b" ),
140+ " Returns the quaternion which transform a into b through a rotation." ,
141+ bp::return_value_policy<bp::manage_new_object>())
134142 .staticmethod (" FromTwoVectors" )
135143 .def (" Identity" ,&Quaternion::Identity," Returns a quaternion representing an identity rotation." )
136144 .staticmethod (" Identity" )
@@ -150,11 +158,17 @@ namespace eigenpy
150158 static Quaternion & assign (Quaternion & self, const OtherQuat & quat)
151159 { return self = quat; }
152160
153- static Quaternion* fromTwoVectors (const Vector3& u, const Vector3& v)
161+ static Quaternion* FromTwoVectors (const Vector3& u, const Vector3& v)
154162 {
155163 Quaternion* q (new Quaternion); q->setFromTwoVectors (u,v);
156164 return q;
157165 }
166+
167+ static bool isApprox (const Quaternion & self, const Quaternion & other,
168+ const Scalar prec = Eigen::NumTraits<Scalar>::dummy_precision)
169+ {
170+ return self.isApprox (other,prec);
171+ }
158172
159173 static bool __eq__ (const Quaternion& u, const Quaternion& v)
160174 {
0 commit comments