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
d7a7bd3f
Unverified
Commit
d7a7bd3f
authored
Mar 17, 2020
by
Joseph Mirabel
Committed by
GitHub
Mar 17, 2020
Browse files
Merge pull request #142 from jmirabel/devel
[Python] Fix bindings of CollisionResult.
parents
4359f817
ac577cc3
Changes
3
Hide whitespace changes
Inline
Side-by-side
python/collision.cc
View file @
d7a7bd3f
...
...
@@ -134,7 +134,7 @@ void exposeCollisionAPI ()
if
(
!
eigenpy
::
register_symbolic_link_to_registered_type
<
std
::
vector
<
CollisionResult
>
>
())
{
class_
<
std
::
vector
<
CollisionResult
>
>
(
"CollisionResult"
)
class_
<
std
::
vector
<
CollisionResult
>
>
(
"
StdVec_
CollisionResult"
)
.
def
(
vector_indexing_suite
<
std
::
vector
<
CollisionResult
>
>
())
;
}
...
...
test/python_unit/CMakeLists.txt
View file @
d7a7bd3f
SET
(
${
PROJECT_NAME
}
_PYTHON_TESTS
geometric_shapes
api
)
FOREACH
(
TEST
${${
PROJECT_NAME
}
_PYTHON_TESTS
}
)
...
...
test/python_unit/api.py
0 → 100644
View file @
d7a7bd3f
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