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
pinocchio
Commits
836d732a
Commit
836d732a
authored
Nov 25, 2020
by
Gabriele Buondonno
Browse files
[unittest/python/rpy] Appease codacy
parent
d92b3199
Pipeline
#12440
passed with stage
in 224 minutes and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
unittest/python/rpy.py
View file @
836d732a
...
...
@@ -48,26 +48,26 @@ class TestRPY(TestCase):
r
=
random
()
*
2
*
pi
-
pi
p
=
random
()
*
pi
-
pi
/
2
y
=
random
()
*
2
*
pi
-
pi
R
=
rpyToMatrix
(
r
,
p
,
y
)
Raa
=
AngleAxis
(
y
,
np
.
array
([
0.
,
0.
,
1.
])).
matrix
()
\
.
dot
(
AngleAxis
(
p
,
np
.
array
([
0.
,
1.
,
0.
])).
matrix
())
\
.
dot
(
AngleAxis
(
r
,
np
.
array
([
1.
,
0.
,
0.
])).
matrix
())
self
.
assertApprox
(
R
,
Raa
)
v
=
np
.
array
([
r
,
p
,
y
])
Rv
=
rpyToMatrix
(
v
)
self
.
assertApprox
(
Rv
,
Raa
)
self
.
assertApprox
(
Rv
,
R
)
def
test_matrixToRpy
(
self
):
n
=
100
for
k
in
range
(
n
):
for
_
in
range
(
n
):
quat
=
pin
.
Quaternion
(
np
.
random
.
rand
(
4
,
1
)).
normalized
()
R
=
quat
.
toRotationMatrix
()
...
...
@@ -85,10 +85,10 @@ class TestRPY(TestCase):
Rp
=
np
.
array
([[
0.0
,
0.0
,
1.0
],
[
0.0
,
1.0
,
0.0
],
[
-
1.0
,
0.0
,
0.0
]])
for
k
in
range
(
n2
):
for
_
in
range
(
n2
):
r
=
random
()
*
2
*
pi
-
pi
y
=
random
()
*
2
*
pi
-
pi
R
=
AngleAxis
(
y
,
np
.
array
([
0.
,
0.
,
1.
])).
matrix
()
\
.
dot
(
Rp
)
\
.
dot
(
AngleAxis
(
r
,
np
.
array
([
1.
,
0.
,
0.
])).
matrix
())
...
...
@@ -105,10 +105,10 @@ class TestRPY(TestCase):
Rp
=
np
.
array
([[
0.0
,
0.0
,
-
1.0
],
[
0.0
,
1.0
,
0.0
],
[
1.0
,
0.0
,
0.0
]])
for
k
in
range
(
n2
):
for
_
in
range
(
n2
):
r
=
random
()
*
2
*
pi
-
pi
y
=
random
()
*
2
*
pi
-
pi
R
=
AngleAxis
(
y
,
np
.
array
([
0.
,
0.
,
1.
])).
matrix
()
\
.
dot
(
Rp
)
\
.
dot
(
AngleAxis
(
r
,
np
.
array
([
1.
,
0.
,
0.
])).
matrix
())
...
...
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