Skip to content
GitLab
Menu
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
hpp-fcl
Commits
a2493c1e
Unverified
Commit
a2493c1e
authored
Nov 14, 2019
by
Joseph Mirabel
Committed by
GitHub
Nov 14, 2019
Browse files
Merge pull request #99 from jmirabel/python
[Python] Update bindings with requirements from Pinocchio.
parents
3351029d
cd09b6ec
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
a2493c1e
...
...
@@ -147,8 +147,6 @@ SET(${PROJECT_NAME}_HEADERS
include/hpp/fcl/mesh_loader/loader.h
include/hpp/fcl/internal/BV_fitter.h
include/hpp/fcl/internal/BV_splitter.h
include/hpp/fcl/internal/collision_node.h
include/hpp/fcl/internal/geometric_shapes_utility.h
include/hpp/fcl/internal/intersect.h
include/hpp/fcl/internal/tools.h
include/hpp/fcl/internal/traversal_node_base.h
...
...
@@ -159,7 +157,6 @@ SET(${PROJECT_NAME}_HEADERS
include/hpp/fcl/internal/traversal_node_shapes.h
include/hpp/fcl/internal/traversal_recurse.h
include/hpp/fcl/internal/traversal.h
include/hpp/fcl/internal/traits_traversal.h
)
add_subdirectory
(
src
)
...
...
python/collision-geometries.cc
View file @
a2493c1e
...
...
@@ -222,6 +222,8 @@ void exposeCollisionGeometries ()
.
def
(
"computeMomentofInertia"
,
&
CollisionGeometry
::
computeMomentofInertia
)
.
def
(
"computeVolume"
,
&
CollisionGeometry
::
computeVolume
)
.
def
(
"computeMomentofInertiaRelatedToCOM"
,
&
CollisionGeometry
::
computeMomentofInertiaRelatedToCOM
)
.
def_readwrite
(
"aabb_radius"
,
&
CollisionGeometry
::
aabb_radius
,
"AABB radius"
)
;
exposeShapes
();
...
...
python/collision.cc
View file @
a2493c1e
...
...
@@ -33,6 +33,7 @@
// POSSIBILITY OF SUCH DAMAGE.
#include
<boost/python.hpp>
#include
<boost/python/suite/indexing/vector_indexing_suite.hpp>
#include
"fcl.hh"
...
...
@@ -65,7 +66,9 @@ void exposeCollisionAPI ()
.
def_readwrite
(
"break_distance"
,
&
CollisionRequest
::
break_distance
)
;
class_
<
Contact
>
(
"Contact"
,
no_init
)
class_
<
Contact
>
(
"Contact"
,
init
<>
())
//.def(init<CollisionGeometryPtr_t, CollisionGeometryPtr_t, int, int>())
//.def(init<CollisionGeometryPtr_t, CollisionGeometryPtr_t, int, int, Vec3f, Vec3f, FCL_REAL>())
.
def_readonly
(
"o1"
,
&
Contact
::
o1
)
.
def_readonly
(
"o2"
,
&
Contact
::
o2
)
.
def_readwrite
(
"b1"
,
&
Contact
::
b1
)
...
...
@@ -76,12 +79,23 @@ void exposeCollisionAPI ()
.
def
(
self
==
self
)
;
class_
<
std
::
vector
<
Contact
>
>
(
"StdVec_Contact"
)
.
def
(
vector_indexing_suite
<
std
::
vector
<
Contact
>
>
())
;
class_
<
CollisionResult
>
(
"CollisionResult"
,
init
<>
())
.
def
(
"isCollision"
,
&
CollisionResult
::
isCollision
)
.
def
(
"numContacts"
,
&
CollisionResult
::
numContacts
)
.
def
(
"getContact"
,
&
CollisionResult
::
getContact
,
return_value_policy
<
copy_const_reference
>
())
.
def
(
"getContacts"
,
&
CollisionResult
::
getContacts
,
return_internal_reference
<>
())
.
def
(
"addContact"
,
&
CollisionResult
::
addContact
)
.
def
(
"clear"
,
&
CollisionResult
::
clear
)
;
class_
<
std
::
vector
<
CollisionResult
>
>
(
"CollisionResult"
)
.
def
(
vector_indexing_suite
<
std
::
vector
<
CollisionResult
>
>
())
;
def
(
"collide"
,
static_cast
<
std
::
size_t
(
*
)(
const
CollisionObject
*
,
const
CollisionObject
*
,
const
CollisionRequest
&
,
CollisionResult
&
)
>
(
&
collide
));
def
(
"collide"
,
static_cast
<
std
::
size_t
(
*
)(
...
...
python/distance.cc
View file @
a2493c1e
...
...
@@ -33,6 +33,7 @@
// POSSIBILITY OF SUCH DAMAGE.
#include
<boost/python.hpp>
#include
<boost/python/suite/indexing/vector_indexing_suite.hpp>
#include
"fcl.hh"
...
...
@@ -45,6 +46,12 @@ using namespace hpp::fcl;
using
boost
::
shared_ptr
;
using
boost
::
noncopyable
;
struct
DistanceRequestWrapper
{
static
Vec3f
getNearestPoint1
(
const
DistanceResult
&
res
)
{
return
res
.
nearest_points
[
0
];
}
static
Vec3f
getNearestPoint2
(
const
DistanceResult
&
res
)
{
return
res
.
nearest_points
[
1
];
}
};
void
exposeDistanceAPI
()
{
class_
<
DistanceRequest
>
(
"DistanceRequest"
,
init
<
optional
<
bool
,
FCL_REAL
,
FCL_REAL
>
>
())
...
...
@@ -57,6 +64,8 @@ void exposeDistanceAPI ()
.
def_readwrite
(
"min_distance"
,
&
DistanceResult
::
min_distance
)
.
def_readwrite
(
"normal"
,
&
DistanceResult
::
normal
)
//.def_readwrite ("nearest_points", &DistanceResult::nearest_points)
.
def
(
"getNearestPoint1"
,
&
DistanceRequestWrapper
::
getNearestPoint1
)
.
def
(
"getNearestPoint2"
,
&
DistanceRequestWrapper
::
getNearestPoint2
)
.
def_readonly
(
"o1"
,
&
DistanceResult
::
o1
)
.
def_readonly
(
"o2"
,
&
DistanceResult
::
o2
)
.
def_readwrite
(
"b1"
,
&
DistanceResult
::
b1
)
...
...
@@ -65,6 +74,10 @@ void exposeDistanceAPI ()
.
def
(
"clear"
,
&
DistanceResult
::
clear
)
;
class_
<
std
::
vector
<
DistanceResult
>
>
(
"StdVec_DistanceResult"
)
.
def
(
vector_indexing_suite
<
std
::
vector
<
DistanceResult
>
>
())
;
def
(
"distance"
,
static_cast
<
FCL_REAL
(
*
)(
const
CollisionObject
*
,
const
CollisionObject
*
,
const
DistanceRequest
&
,
DistanceResult
&
)
>
(
&
distance
));
def
(
"distance"
,
static_cast
<
FCL_REAL
(
*
)(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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