Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
eigenpy
Commits
cfcc81e2
Commit
cfcc81e2
authored
Nov 15, 2016
by
jcarpent
Browse files
[Quaternion] Update API to follow old Eigen version API
parent
1870d4f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/quaternion.hpp
View file @
cfcc81e2
...
...
@@ -61,7 +61,7 @@ namespace eigenpy
.
def
(
bp
::
init
<
Matrix3
>
((
bp
::
arg
(
"matrixRotation"
)),
"Initialize from rotation matrix."
))
.
def
(
bp
::
init
<
AngleAxis
>
((
bp
::
arg
(
"angleaxis"
)),
"Initialize from angle axis."
))
.
def
(
bp
::
init
<
Quaternion
>
((
bp
::
arg
(
"clone"
)),
"Copy constructor."
))
.
def
(
"__init__"
,
bp
::
make_constructor
(
&
QuaternionVisitor
::
f
romTwoVectors
,
.
def
(
"__init__"
,
bp
::
make_constructor
(
&
QuaternionVisitor
::
F
romTwoVectors
,
bp
::
default_call_policies
(),
(
bp
::
arg
(
"u"
),
bp
::
arg
(
"v"
))),
"Initialize from two vector u,v"
)
.
def
(
bp
::
init
<
Scalar
,
Scalar
,
Scalar
,
Scalar
>
...
...
@@ -83,9 +83,13 @@ namespace eigenpy
(
Scalar
(
Quaternion
::*
)()
const
)
&
Quaternion
::
w
,
&
QuaternionVisitor
::
setCoeff
<
3
>
,
"The w coefficient."
)
.
def
(
"isApprox"
,(
bool
(
Quaternion
::*
)(
const
Quaternion
&
))
&
Quaternion
::
template
isApprox
<
Quaternion
>,
// .def("isApprox",(bool (Quaternion::*)(const Quaternion &))&Quaternion::template isApprox<Quaternion>,
// "Returns true if *this is approximately equal to other.")
// .def("isApprox",(bool (Quaternion::*)(const Quaternion &, const Scalar prec))&Quaternion::template isApprox<Quaternion>,
// "Returns true if *this is approximately equal to other, within the precision determined by prec..")
.
def
(
"isApprox"
,(
bool
(
*
)(
const
Quaternion
&
))
&
isApprox
,
"Returns true if *this is approximately equal to other."
)
.
def
(
"isApprox"
,(
bool
(
Quaternion
::
*
)(
const
Quaternion
&
,
const
Scalar
prec
))
&
Quaternion
::
template
isApprox
<
Quaternion
>
,
.
def
(
"isApprox"
,(
bool
(
*
)(
const
Quaternion
&
,
const
Scalar
prec
))
&
isApprox
,
"Returns true if *this is approximately equal to other, within the precision determined by prec.."
)
/* --- Methods --- */
...
...
@@ -131,6 +135,10 @@ namespace eigenpy
// .def("FromTwoVectors",&Quaternion::template FromTwoVectors<Vector3,Vector3>,
// bp::args("a","b"),
// "Returns the quaternion which transform a into b through a rotation.")
.
def
(
"FromTwoVectors"
,
&
FromTwoVectors
,
bp
::
args
(
"a"
,
"b"
),
"Returns the quaternion which transform a into b through a rotation."
,
bp
::
return_value_policy
<
bp
::
manage_new_object
>
())
.
staticmethod
(
"FromTwoVectors"
)
.
def
(
"Identity"
,
&
Quaternion
::
Identity
,
"Returns a quaternion representing an identity rotation."
)
.
staticmethod
(
"Identity"
)
...
...
@@ -150,11 +158,17 @@ namespace eigenpy
static
Quaternion
&
assign
(
Quaternion
&
self
,
const
OtherQuat
&
quat
)
{
return
self
=
quat
;
}
static
Quaternion
*
f
romTwoVectors
(
const
Vector3
&
u
,
const
Vector3
&
v
)
static
Quaternion
*
F
romTwoVectors
(
const
Vector3
&
u
,
const
Vector3
&
v
)
{
Quaternion
*
q
(
new
Quaternion
);
q
->
setFromTwoVectors
(
u
,
v
);
return
q
;
}
static
bool
isApprox
(
const
Quaternion
&
self
,
const
Quaternion
&
other
,
const
Scalar
prec
=
Eigen
::
NumTraits
<
Scalar
>::
dummy_precision
)
{
return
self
.
isApprox
(
other
,
prec
);
}
static
bool
__eq__
(
const
Quaternion
&
u
,
const
Quaternion
&
v
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment