diff --git a/include/eigenpy/quaternion.hpp b/include/eigenpy/quaternion.hpp index 05d88a64cc237c18645f65c03258d05c15462fff..c0d23745959d50c182e55263ba94e33209b07a66 100644 --- a/include/eigenpy/quaternion.hpp +++ b/include/eigenpy/quaternion.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 CNRS INRIA + * Copyright 2014-2021 CNRS INRIA */ #ifndef __eigenpy_quaternion_hpp__ @@ -111,12 +111,12 @@ namespace eigenpy { cl .def(bp::init<>(bp::arg("self"),"Default constructor")) - .def(bp::init<Vector4>((bp::arg("self"),bp::arg("vec4")), - "Initialize from a vector 4D.\n" - "\tvec4 : a 4D vector representing quaternion coefficients in the order xyzw.")) .def(bp::init<Matrix3>((bp::arg("self"),bp::arg("R")), "Initialize from rotation matrix.\n" "\tR : a rotation matrix 3x3.")) + .def(bp::init<Vector4>((bp::arg("self"),bp::arg("vec4")), + "Initialize from a vector 4D.\n" + "\tvec4 : a 4D vector representing quaternion coefficients in the order xyzw.")) .def(bp::init<AngleAxis>((bp::arg("self"),bp::arg("aa")), "Initialize from an angle axis.\n" "\taa: angle axis object.")) diff --git a/unittest/python/test_geometry.py b/unittest/python/test_geometry.py index 818d37f0c0670f442c9aafd76a371bc931383339..86332f2422d761da90ce6c69a278f8f5bcf0be82 100644 --- a/unittest/python/test_geometry.py +++ b/unittest/python/test_geometry.py @@ -18,6 +18,10 @@ q.normalize() assert(isapprox(np.linalg.norm(q.coeffs()),q.norm())) assert(isapprox(np.linalg.norm(q.coeffs()),1)) +v = np.array([0.5,-0.5,0.5,0.5]) +qv = Quaternion(v) +assert(isapprox(qv.coeffs(), v)) + r = AngleAxis(q) q2 = Quaternion(r) assert(q==q)