Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
eigenpy
Commits
9d8dd7aa
Verified
Commit
9d8dd7aa
authored
5 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
test: fix when using Array by default
parent
9476f88e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
unittest/python/test_geometry.py
+4
-4
4 additions, 4 deletions
unittest/python/test_geometry.py
unittest/python/test_matrix.py
+5
-5
5 additions, 5 deletions
unittest/python/test_matrix.py
with
9 additions
and
9 deletions
unittest/python/test_geometry.py
+
4
−
4
View file @
9d8dd7aa
...
...
@@ -27,7 +27,7 @@ assert(q2.isApprox(q2,1e-2))
Rq
=
q
.
matrix
()
Rr
=
r
.
matrix
()
assert
(
isapprox
(
Rq
*
Rq
.
T
,
np
.
eye
(
3
)))
assert
(
isapprox
(
Rq
.
dot
(
Rq
.
T
)
,
np
.
eye
(
3
)))
assert
(
isapprox
(
Rr
,
Rq
))
qR
=
Quaternion
(
Rr
)
...
...
@@ -42,15 +42,15 @@ except RuntimeError as e:
if
verbose
:
print
(
"
As expected, catched exception:
"
,
e
)
# --- Angle Vector ------------------------------------------------
r
=
AngleAxis
(.
1
,
np
.
matrix
([
1
,
0
,
0
],
np
.
double
)
.
T
)
r
=
AngleAxis
(.
1
,
np
.
array
([
1
,
0
,
0
],
np
.
double
))
if
verbose
:
print
(
"
Rx(.1) =
\n\n
"
,
r
.
matrix
(),
"
\n
"
)
assert
(
isapprox
(
r
.
matrix
()[
2
,
2
],
cos
(
r
.
angle
)))
assert
(
isapprox
(
r
.
axis
,
np
.
matrix
(
"
1;0;0
"
))
)
assert
(
isapprox
(
r
.
axis
,
np
.
array
([
1.
,
0
,
0
]
))
)
assert
(
isapprox
(
r
.
angle
,
0.1
)
)
assert
(
r
.
isApprox
(
r
))
assert
(
r
.
isApprox
(
r
,
1e-2
))
r
.
axis
=
np
.
matrix
([
0
,
1
,
0
],
np
.
double
).
T
r
.
axis
=
np
.
array
([
0
,
1
,
0
],
np
.
double
).
T
assert
(
isapprox
(
r
.
matrix
()[
0
,
0
],
cos
(
r
.
angle
)))
ri
=
r
.
inverse
()
...
...
This diff is collapsed.
Click to expand it.
unittest/python/test_matrix.py
+
5
−
5
View file @
9d8dd7aa
...
...
@@ -11,11 +11,11 @@ assert M.shape == (0,0)
if
verbose
:
print
(
"
===> From empty VectorXd to Py
"
)
v
=
eigenpy
.
emptyVector
()
assert
v
.
shape
==
(
0
,
1
)
assert
v
.
shape
==
(
0
,)
if
verbose
:
print
(
"
===> From MatrixXd to Py
"
)
M
=
eigenpy
.
naturals
(
3
,
3
,
verbose
)
Mcheck
=
np
.
reshape
(
np
.
matrix
(
range
(
9
),
np
.
double
),[
3
,
3
])
Mcheck
=
np
.
reshape
(
np
.
array
(
range
(
9
),
np
.
double
),[
3
,
3
])
assert
np
.
array_equal
(
Mcheck
,
M
)
if
verbose
:
print
(
"
===> From Matrix3d to Py
"
)
...
...
@@ -24,13 +24,13 @@ assert np.array_equal(Mcheck,M33)
if
verbose
:
print
(
"
===> From VectorXd to Py
"
)
v
=
eigenpy
.
naturalsX
(
3
,
verbose
)
vcheck
=
np
.
matrix
([
range
(
3
),
],
np
.
double
).
T
vcheck
=
np
.
array
(
range
(
3
),
np
.
double
).
T
assert
np
.
array_equal
(
vcheck
,
v
)
if
verbose
:
print
(
"
===> From Py to Eigen::MatrixXd
"
)
if
verbose
:
print
(
"
===> From Py to Eigen::MatrixXd
"
)
if
verbose
:
print
(
"
===> From Py to Eigen::MatrixXd
"
)
Mref
=
np
.
reshape
(
np
.
matrix
(
range
(
64
),
np
.
double
),[
8
,
8
])
Mref
=
np
.
reshape
(
np
.
array
(
range
(
64
),
np
.
double
),[
8
,
8
])
# Test base function
Mref_from_base
=
eigenpy
.
base
(
Mref
)
...
...
@@ -125,4 +125,4 @@ assert(mat1x1[0,0] == value)
vec1x1
=
eigenpy
.
vector1x1
(
value
)
assert
(
vec1x1
.
size
==
1
)
assert
(
vec1x1
[
0
,
0
]
==
value
)
assert
(
vec1x1
[
0
]
==
value
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment