@@ -110,7 +110,6 @@ namespace eigenpy
110110 void visit (PyClass& cl) const
111111 {
112112 cl
113- .def (bp::init<>(bp::arg (" self" )," Default constructor" )[bp::return_value_policy<bp::return_by_value>()])
114113 .def (bp::init<Matrix3>((bp::arg (" self" ),bp::arg (" R" )),
115114 " Initialize from rotation matrix.\n "
116115 " \t R : a rotation matrix 3x3." )[bp::return_value_policy<bp::return_by_value>()])
@@ -129,6 +128,8 @@ namespace eigenpy
129128 (bp::arg (" vec4" ))),
130129 " Initialize from a vector 4D.\n "
131130 " \t vec4 : a 4D vector representing quaternion coefficients in the order xyzw." )
131+ .def (" __init__" ,bp::make_constructor (&QuaternionVisitor::DefaultConstructor),
132+ " Default constructor" )
132133 .def (bp::init<Scalar,Scalar,Scalar,Scalar>
133134 ((bp::arg (" self" ),bp::arg (" w" ),bp::arg (" x" ),bp::arg (" y" ),bp::arg (" z" )),
134135 " Initialize from coefficients.\n\n "
@@ -269,9 +270,14 @@ namespace eigenpy
269270 return q;
270271 }
271272
273+ static Quaternion* DefaultConstructor ()
274+ {
275+ return new Quaternion;
276+ }
277+
272278 static Quaternion* FromOneVector (const Vector4& v)
273279 {
274- Quaternion* q (new Quaternion (v));
280+ Quaternion* q (new Quaternion (v[ 3 ],v[ 0 ],v[ 1 ],v[ 2 ] ));
275281 return q;
276282 }
277283
0 commit comments