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
hpp-fcl
Commits
cdb0a72d
Commit
cdb0a72d
authored
Nov 14, 2019
by
Joseph Mirabel
Browse files
[Python] Update bindings with requirements from Pinocchio.
parent
3351029d
Changes
3
Hide whitespace changes
Inline
Side-by-side
python/collision-geometries.cc
View file @
cdb0a72d
...
...
@@ -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 @
cdb0a72d
...
...
@@ -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,9 +79,16 @@ 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
)
;
...
...
python/distance.cc
View file @
cdb0a72d
...
...
@@ -45,6 +45,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 +63,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
)
...
...
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