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
Guilhem Saurel
ndcurves
Commits
e1a69f73
Commit
e1a69f73
authored
Jan 23, 2020
by
Pierre Fernbach
Browse files
[Tests][Python] test accessor to waypoints in bezier and bezier3
parent
dfae4d8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/test/test.py
View file @
e1a69f73
...
...
@@ -98,6 +98,14 @@ class TestCurves(unittest.TestCase):
self
.
assertTrue
(
norm
(
a0
.
derivate
(
t
,
2
)
-
a1
.
derivate
(
3
*
t
,
2
)
*
9.
)
<
__EPS
)
self
.
assertTrue
(
norm
(
prim0
(
t
)
-
prim1
(
t
*
3
)
/
3.
)
<
__EPS
)
self
.
assertTrue
((
prim
(
0
)
==
array
([
0.
,
0.
,
0.
])).
all
())
# testing accessor to waypoints :
wp_getter
=
a0
.
waypoints
()
self
.
assertEqual
(
wp_getter
.
shape
[
0
],
waypoints
.
shape
[
0
])
self
.
assertEqual
(
wp_getter
.
shape
[
1
],
waypoints
.
shape
[
1
])
self
.
assertTrue
(
array_equal
(
wp_getter
,
waypoints
))
# check that it return a copy:
a0
.
waypoints
()[
1
,
1
]
=
-
15.
self
.
assertEqual
(
a0
.
waypoints
()[
1
,
1
],
waypoints
[
1
,
1
])
# testing bezier with constraints
c
=
curve_constraints
(
3
)
c
.
init_vel
=
array
([[
0.
,
1.
,
1.
]]).
transpose
()
...
...
@@ -189,6 +197,14 @@ class TestCurves(unittest.TestCase):
self
.
assertTrue
(
norm
(
a0
.
derivate
(
t
,
2
)
-
a1
.
derivate
(
3
*
t
,
2
)
*
9.
)
<
__EPS
)
self
.
assertTrue
(
norm
(
prim0
(
t
)
-
prim1
(
t
*
3
)
/
3.
)
<
__EPS
)
self
.
assertTrue
((
prim
(
0
)
==
array
([
0.
,
0.
,
0.
])).
all
())
# testing accessor to waypoints :
wp_getter
=
a0
.
waypoints
()
self
.
assertEqual
(
wp_getter
.
shape
[
0
],
waypoints
.
shape
[
0
])
self
.
assertEqual
(
wp_getter
.
shape
[
1
],
waypoints
.
shape
[
1
])
self
.
assertTrue
(
array_equal
(
wp_getter
,
waypoints
))
# check that it return a copy:
a0
.
waypoints
()[
1
,
1
]
=
-
15.
self
.
assertEqual
(
a0
.
waypoints
()[
1
,
1
],
waypoints
[
1
,
1
])
# testing bezier with constraints
c
=
curve_constraints
(
3
)
c
.
init_vel
=
array
([[
0.
,
1.
,
1.
]]).
transpose
()
...
...
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