Skip to content
Snippets Groups Projects
Unverified Commit 63385108 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #269 from jcarpent/devel

Fix Quaternion constructor
parents 975e39b5 c8be5af2
No related branches found
No related tags found
No related merge requests found
Pipeline #17617 passed with warnings
Subproject commit b0a77e2ead3f8dbb201b05e42048bb1cfc6a518e
Subproject commit 7a5475bcbac62643eb5c03744f1ee16f83607fe2
/*
* Copyright 2014-2021 CNRS INRIA
* Copyright 2014-2022 CNRS INRIA
*/
#ifndef __eigenpy_quaternion_hpp__
......@@ -120,9 +120,11 @@ namespace eigenpy
(bp::arg("aa"))),
"Initialize from an angle axis.\n"
"\taa: angle axis object.")
.def(bp::init<Quaternion>((bp::arg("self"),bp::arg("quat")),
"Copy constructor.\n"
"\tquat: a quaternion.")[bp::return_value_policy<bp::return_by_value>()])
.def("__init__",bp::make_constructor(&QuaternionVisitor::FromOtherQuaternion,
bp::default_call_policies(),
(bp::arg("quat"))),
"Copy constructor.\n"
"\tquat: a quaternion.")
.def("__init__",bp::make_constructor(&QuaternionVisitor::FromTwoVectors,
bp::default_call_policies(),
(bp::arg("u"),bp::arg("v"))),
......@@ -286,7 +288,13 @@ namespace eigenpy
Quaternion* q(new Quaternion); q->setFromTwoVectors(u,v);
return q;
}
static Quaternion* FromOtherQuaternion(const Quaternion & other)
{
Quaternion* q(new Quaternion(other));
return q;
}
static Quaternion* DefaultConstructor()
{
return new Quaternion;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment