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
8092604a
Commit
8092604a
authored
Oct 17, 2017
by
jcarpent
Browse files
[Geometry] Make Quaternion with newest versions of Eigen
parent
86156dcb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/quaternion.hpp
View file @
8092604a
...
...
@@ -71,16 +71,16 @@ namespace eigenpy
"The [] operator numbers them differently, 0...4 for *x* *y* *z* *w*!"
))
.
add_property
(
"x"
,
(
Scalar
(
Quaternion
::*
)()
const
)
&
Quaternion
::
x
,
&
Quaternion
Visitor
::
getCoeff
<
0
>
,
&
QuaternionVisitor
::
setCoeff
<
0
>
,
"The x coefficient."
)
.
add_property
(
"y"
,
(
Scalar
(
Quaternion
::*
)()
const
)
&
Quaternion
::
y
,
&
Quaternion
Visitor
::
getCoeff
<
1
>
,
&
QuaternionVisitor
::
setCoeff
<
1
>
,
"The y coefficient."
)
.
add_property
(
"z"
,
(
Scalar
(
Quaternion
::*
)()
const
)
&
Quaternion
::
z
,
&
Quaternion
Visitor
::
getCoeff
<
2
>
,
&
QuaternionVisitor
::
setCoeff
<
2
>
,
"The z coefficient."
)
.
add_property
(
"w"
,
(
Scalar
(
Quaternion
::*
)()
const
)
&
Quaternion
::
w
,
&
Quaternion
Visitor
::
getCoeff
<
3
>
,
&
QuaternionVisitor
::
setCoeff
<
3
>
,
"The w coefficient."
)
// .def("isApprox",(bool (Quaternion::*)(const Quaternion &))&Quaternion::template isApprox<Quaternion>,
...
...
@@ -151,6 +151,9 @@ namespace eigenpy
template
<
int
i
>
static
void
setCoeff
(
Quaternion
&
self
,
Scalar
value
)
{
self
.
coeffs
()[
i
]
=
value
;
}
template
<
int
i
>
static
Scalar
getCoeff
(
Quaternion
&
self
)
{
return
self
.
coeffs
()[
i
];
}
static
Quaternion
&
setFromTwoVectors
(
Quaternion
&
self
,
const
Vector3
&
a
,
const
Vector3
&
b
)
{
return
self
.
setFromTwoVectors
(
a
,
b
);
}
...
...
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