Skip to content

Commit 30bd0c6

Browse files
committed
geometry: fix quaternion static Identity constructor
1 parent b55c10d commit 30bd0c6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

include/eigenpy/quaternion.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ namespace eigenpy
234234
"Returns the quaternion which transforms a into b through a rotation.",
235235
bp::return_value_policy<bp::manage_new_object>())
236236
.staticmethod("FromTwoVectors")
237-
.def("Identity",&Quaternion::Identity,
238-
"Returns a quaternion representing an identity rotation.")
237+
.def("Identity",&Identity,
238+
"Returns a quaternion representing an identity rotation.",
239+
bp::return_value_policy<bp::manage_new_object>())
239240
.staticmethod("Identity")
240241
;
241242
}
@@ -254,6 +255,12 @@ namespace eigenpy
254255
static Quaternion & assign(Quaternion & self, const OtherQuat & quat)
255256
{ return self = quat; }
256257

258+
static Quaternion* Identity()
259+
{
260+
Quaternion* q(new Quaternion); q->setIdentity();
261+
return q;
262+
}
263+
257264
static Quaternion* FromTwoVectors(const Vector3& u, const Vector3& v)
258265
{
259266
Quaternion* q(new Quaternion); q->setFromTwoVectors(u,v);

0 commit comments

Comments
 (0)