@@ -185,16 +185,19 @@ namespace eigenpy
185185 " Returns the quaternion describing the inverse rotation." )
186186 .def (" setIdentity" ,&Quaternion::setIdentity,
187187 bp::arg (" self" ),
188- " Set *this to the idendity rotation." ,bp::return_self<>())
188+ " Set *this to the identity rotation." ,
189+ bp::return_self<>())
189190 .def (" norm" ,&Quaternion::norm,
190191 bp::arg (" self" ),
191192 " Returns the norm of the quaternion's coefficients." )
192193 .def (" normalize" ,&Quaternion::normalize,
193194 bp::arg (" self" ),
194- " Normalizes the quaternion *this." )
195- .def (" normalized" ,&Quaternion::normalized,
195+ " Normalizes the quaternion *this." ,
196+ bp::return_self<>())
197+ .def (" normalized" ,&normalized,
196198 bp::arg (" self" ),
197- " Returns a normalized copy of *this." )
199+ " Returns a normalized copy of *this." ,
200+ bp::return_value_policy<bp::manage_new_object>())
198201 .def (" squaredNorm" ,&Quaternion::squaredNorm,
199202 bp::arg (" self" ),
200203 " Returns the squared norm of the quaternion's coefficients." )
@@ -251,6 +254,11 @@ namespace eigenpy
251254 ;
252255 }
253256 private:
257+
258+ static Quaternion * normalized (const Quaternion & self)
259+ {
260+ return new Quaternion (self.normalized ());
261+ }
254262
255263 template <int i>
256264 static void setCoeff (Quaternion & self, Scalar value) { self.coeffs ()[i] = value; }
0 commit comments