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
Humanoid Path Planner
hpp-fcl
Commits
394ecbb6
Commit
394ecbb6
authored
Mar 17, 2020
by
Joseph Mirabel
Browse files
Add failing unit test.
parent
4359f817
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/python_unit/CMakeLists.txt
View file @
394ecbb6
SET
(
${
PROJECT_NAME
}
_PYTHON_TESTS
geometric_shapes
api
)
FOREACH
(
TEST
${${
PROJECT_NAME
}
_PYTHON_TESTS
}
)
...
...
test/python_unit/api.py
0 → 100644
View file @
394ecbb6
import
unittest
from
test_case
import
TestCase
import
hppfcl
hppfcl
.
switchToNumpyArray
()
import
numpy
as
np
class
TestMainAPI
(
TestCase
):
def
test_collision
(
self
):
capsule
=
hppfcl
.
Capsule
(
1.
,
2.
)
M1
=
hppfcl
.
Transform3f
()
M2
=
hppfcl
.
Transform3f
(
np
.
eye
(
3
),
np
.
array
([
3
,
0
,
0
]))
req
=
hppfcl
.
CollisionRequest
()
res
=
hppfcl
.
CollisionResult
()
self
.
assertTrue
(
not
hppfcl
.
collide
(
capsule
,
M1
,
capsule
,
M2
,
req
,
res
))
def
test_distance
(
self
):
capsule
=
hppfcl
.
Capsule
(
1.
,
2.
)
M1
=
hppfcl
.
Transform3f
()
M2
=
hppfcl
.
Transform3f
(
np
.
eye
(
3
),
np
.
array
([
3
,
0
,
0
]))
req
=
hppfcl
.
DistanceRequest
()
res
=
hppfcl
.
DistanceResult
()
self
.
assertTrue
(
hppfcl
.
distance
(
capsule
,
M1
,
capsule
,
M2
,
req
,
res
)
>
0
)
if
__name__
==
'__main__'
:
unittest
.
main
()
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