Skip to content
GitLab
Menu
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
bd746be0
Verified
Commit
bd746be0
authored
May 19, 2021
by
Justin Carpentier
Browse files
geometry: fix constructors
parent
d9e2f78f
Pipeline
#14623
passed with stage
in 13 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/eigenpy/quaternion.hpp
View file @
bd746be0
...
...
@@ -97,7 +97,7 @@ namespace eigenpy
typedef
typename
QuaternionBase
::
Scalar
Scalar
;
typedef
typename
Quaternion
::
Coefficients
Coefficients
;
typedef
typename
QuaternionBase
::
Vector3
Vector3
;
typedef
typename
Eigen
::
Matrix
<
Scalar
,
4
,
1
>
Vector4
;
typedef
Coefficients
Vector4
;
typedef
typename
QuaternionBase
::
Matrix3
Matrix3
;
typedef
typename
QuaternionBase
::
AngleAxisType
AngleAxis
;
...
...
@@ -110,23 +110,25 @@ namespace eigenpy
void
visit
(
PyClass
&
cl
)
const
{
cl
.
def
(
bp
::
init
<>
(
bp
::
arg
(
"self"
),
"Default constructor"
))
.
def
(
bp
::
init
<>
(
bp
::
arg
(
"self"
),
"Default constructor"
)
[
bp
::
return_value_policy
<
bp
::
return_by_value
>
()]
)
.
def
(
bp
::
init
<
Matrix3
>
((
bp
::
arg
(
"self"
),
bp
::
arg
(
"R"
)),
"Initialize from rotation matrix.
\n
"
"
\t
R : a rotation matrix 3x3."
))
.
def
(
bp
::
init
<
Vector4
>
((
bp
::
arg
(
"self"
),
bp
::
arg
(
"vec4"
)),
"Initialize from a vector 4D.
\n
"
"
\t
vec4 : a 4D vector representing quaternion coefficients in the order xyzw."
))
"
\t
R : a rotation matrix 3x3."
)[
bp
::
return_value_policy
<
bp
::
return_by_value
>
()])
.
def
(
bp
::
init
<
AngleAxis
>
((
bp
::
arg
(
"self"
),
bp
::
arg
(
"aa"
)),
"Initialize from an angle axis.
\n
"
"
\t
aa: angle axis object."
))
.
def
(
bp
::
init
<
Quaternion
>
((
bp
::
arg
(
"self"
),
bp
::
arg
(
"quat"
)),
"Copy constructor.
\n
"
"
\t
quat: a quaternion."
))
"
\t
quat: a quaternion."
)
[
bp
::
return_value_policy
<
bp
::
return_by_value
>
()]
)
.
def
(
"__init__"
,
bp
::
make_constructor
(
&
QuaternionVisitor
::
FromTwoVectors
,
bp
::
default_call_policies
(),
(
bp
::
arg
(
"u"
),
bp
::
arg
(
"v"
))),
"Initialize from two vectors u and v"
)
.
def
(
"__init__"
,
bp
::
make_constructor
(
&
QuaternionVisitor
::
FromOneVector
,
bp
::
default_call_policies
(),
(
bp
::
arg
(
"vec4"
))),
"Initialize from a vector 4D.
\n
"
"
\t
vec4 : a 4D vector representing quaternion coefficients in the order xyzw."
)
.
def
(
bp
::
init
<
Scalar
,
Scalar
,
Scalar
,
Scalar
>
((
bp
::
arg
(
"self"
),
bp
::
arg
(
"w"
),
bp
::
arg
(
"x"
),
bp
::
arg
(
"y"
),
bp
::
arg
(
"z"
)),
"Initialize from coefficients.
\n\n
"
...
...
@@ -266,6 +268,12 @@ namespace eigenpy
Quaternion
*
q
(
new
Quaternion
);
q
->
setFromTwoVectors
(
u
,
v
);
return
q
;
}
static
Quaternion
*
FromOneVector
(
const
Vector4
&
v
)
{
Quaternion
*
q
(
new
Quaternion
(
v
));
return
q
;
}
static
bool
__eq__
(
const
Quaternion
&
u
,
const
Quaternion
&
v
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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