Unverified Commit ed6518c8 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #221 from jcarpent/devel

Fix init call order
parents 6e74d285 424595ce
Pipeline #12892 failed with stage
in 11 minutes and 13 seconds
/* /*
* Copyright 2014-2020 CNRS INRIA * Copyright 2014-2021 CNRS INRIA
*/ */
#ifndef __eigenpy_quaternion_hpp__ #ifndef __eigenpy_quaternion_hpp__
...@@ -111,12 +111,12 @@ namespace eigenpy ...@@ -111,12 +111,12 @@ namespace eigenpy
{ {
cl cl
.def(bp::init<>(bp::arg("self"),"Default constructor")) .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")), .def(bp::init<Matrix3>((bp::arg("self"),bp::arg("R")),
"Initialize from rotation matrix.\n" "Initialize from rotation matrix.\n"
"\tR : a rotation matrix 3x3.")) "\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")), .def(bp::init<AngleAxis>((bp::arg("self"),bp::arg("aa")),
"Initialize from an angle axis.\n" "Initialize from an angle axis.\n"
"\taa: angle axis object.")) "\taa: angle axis object."))
......
...@@ -18,6 +18,10 @@ q.normalize() ...@@ -18,6 +18,10 @@ q.normalize()
assert(isapprox(np.linalg.norm(q.coeffs()),q.norm())) assert(isapprox(np.linalg.norm(q.coeffs()),q.norm()))
assert(isapprox(np.linalg.norm(q.coeffs()),1)) 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) r = AngleAxis(q)
q2 = Quaternion(r) q2 = Quaternion(r)
assert(q==q) assert(q==q)
......
Supports Markdown
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