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

Merge pull request #235 from jcarpent/devel

Fix constructors for Quaternion
parents d9e2f78f bd746be0
Pipeline #14626 passed with stage
in 11 minutes and 41 seconds
......@@ -97,7 +97,7 @@ namespace eigenpy
typedef typename QuaternionBase::Scalar Scalar;
typedef typename Quaternion::Coefficients Coefficients;
typedef typename QuaternionBase::Vector3 Vector3;
typedef typename Eigen::Matrix<Scalar,4,1> Vector4;
typedef Coefficients Vector4;
typedef typename QuaternionBase::Matrix3 Matrix3;
typedef typename QuaternionBase::AngleAxisType AngleAxis;
......@@ -110,23 +110,25 @@ namespace eigenpy
void visit(PyClass& cl) const
.def(bp::init<>(bp::arg("self"),"Default constructor"))
.def(bp::init<>(bp::arg("self"),"Default constructor")[bp::return_value_policy<bp::return_by_value>()])
"Initialize from rotation matrix.\n"
"\tR : a rotation matrix 3x3."))
"Initialize from a vector 4D.\n"
"\tvec4 : a 4D vector representing quaternion coefficients in the order xyzw."))
"\tR : a rotation matrix 3x3.")[bp::return_value_policy<bp::return_by_value>()])
"Initialize from an angle axis.\n"
"\taa: angle axis object."))
"Copy constructor.\n"
"\tquat: a quaternion."))
"\tquat: a quaternion.")[bp::return_value_policy<bp::return_by_value>()])
"Initialize from two vectors u and v")
"Initialize from a vector 4D.\n"
"\tvec4 : a 4D vector representing quaternion coefficients in the order xyzw.")
"Initialize from coefficients.\n\n"
......@@ -266,6 +268,12 @@ namespace eigenpy
Quaternion* q(new Quaternion); q->setFromTwoVectors(u,v);
return q;
static Quaternion* FromOneVector(const Vector4& v)
Quaternion* q(new Quaternion(v));
return q;
static bool __eq__(const Quaternion & u, const Quaternion & v)
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