|
1 | 1 | /* |
2 | | - * Copyright 2014-2021 CNRS INRIA |
| 2 | + * Copyright 2014-2022 CNRS INRIA |
3 | 3 | */ |
4 | 4 |
|
5 | 5 | #ifndef __eigenpy_quaternion_hpp__ |
@@ -120,9 +120,11 @@ namespace eigenpy |
120 | 120 | (bp::arg("aa"))), |
121 | 121 | "Initialize from an angle axis.\n" |
122 | 122 | "\taa: angle axis object.") |
123 | | - .def(bp::init<Quaternion>((bp::arg("self"),bp::arg("quat")), |
124 | | - "Copy constructor.\n" |
125 | | - "\tquat: a quaternion.")[bp::return_value_policy<bp::return_by_value>()]) |
| 123 | + .def("__init__",bp::make_constructor(&QuaternionVisitor::FromOtherQuaternion, |
| 124 | + bp::default_call_policies(), |
| 125 | + (bp::arg("quat"))), |
| 126 | + "Copy constructor.\n" |
| 127 | + "\tquat: a quaternion.") |
126 | 128 | .def("__init__",bp::make_constructor(&QuaternionVisitor::FromTwoVectors, |
127 | 129 | bp::default_call_policies(), |
128 | 130 | (bp::arg("u"),bp::arg("v"))), |
@@ -286,7 +288,13 @@ namespace eigenpy |
286 | 288 | Quaternion* q(new Quaternion); q->setFromTwoVectors(u,v); |
287 | 289 | return q; |
288 | 290 | } |
289 | | - |
| 291 | + |
| 292 | + static Quaternion* FromOtherQuaternion(const Quaternion & other) |
| 293 | + { |
| 294 | + Quaternion* q(new Quaternion(other)); |
| 295 | + return q; |
| 296 | + } |
| 297 | + |
290 | 298 | static Quaternion* DefaultConstructor() |
291 | 299 | { |
292 | 300 | return new Quaternion; |
|
0 commit comments