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
f8d3fd2b
Unverified
Commit
f8d3fd2b
authored
Sep 17, 2021
by
Justin Carpentier
Committed by
GitHub
Sep 17, 2021
Browse files
Merge pull request #244 from jcarpent/devel
Enhance Convex exposition
parents
b85128ec
1c1557ea
Pipeline
#16087
passed with stage
in 23 minutes and 2 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
python/collision-geometries.cc
View file @
f8d3fd2b
...
...
@@ -71,6 +71,7 @@
using
namespace
boost
::
python
;
using
namespace
hpp
::
fcl
;
namespace
dv
=
doxygen
::
visitor
;
namespace
bp
=
boost
::
python
;
using
boost
::
noncopyable
;
...
...
@@ -122,12 +123,21 @@ void exposeBVHModel (const std::string& bvname)
struct
ConvexBaseWrapper
{
static
Vec3f
points
(
const
ConvexBase
&
convex
,
int
i
)
typedef
Eigen
::
Matrix
<
double
,
Eigen
::
Dynamic
,
3
,
Eigen
::
RowMajor
>
RowMatrixX3
;
typedef
Eigen
::
Map
<
RowMatrixX3
>
MapRowMatrixX3
;
typedef
Eigen
::
Ref
<
RowMatrixX3
>
RefRowMatrixX3
;
static
Vec3f
&
point
(
const
ConvexBase
&
convex
,
int
i
)
{
if
(
i
>=
convex
.
num_points
)
throw
std
::
out_of_range
(
"index is out of range"
);
return
convex
.
points
[
i
];
}
static
RefRowMatrixX3
points
(
const
ConvexBase
&
convex
)
{
return
MapRowMatrixX3
(
convex
.
points
[
0
].
data
(),
convex
.
num_points
,
3
);
}
static
list
neighbors
(
const
ConvexBase
&
convex
,
int
i
)
{
if
(
i
>=
convex
.
num_points
)
throw
std
::
out_of_range
(
"index is out of range"
);
...
...
@@ -232,7 +242,18 @@ void exposeShapes ()
(
"ConvexBase"
,
doxygen
::
class_doc
<
ConvexBase
>
(),
no_init
)
.
DEF_RO_CLASS_ATTRIB
(
ConvexBase
,
center
)
.
DEF_RO_CLASS_ATTRIB
(
ConvexBase
,
num_points
)
.
def
(
"points"
,
&
ConvexBaseWrapper
::
points
)
.
def
(
"point"
,
&
ConvexBaseWrapper
::
point
,
bp
::
args
(
"self"
,
"index"
),
"Retrieve the point given by its index."
,
bp
::
return_internal_reference
<>
())
.
def
(
"points"
,
&
ConvexBaseWrapper
::
point
,
bp
::
args
(
"self"
,
"index"
),
"Retrieve the point given by its index."
,
::
hpp
::
fcl
::
python
::
deprecated_member
<
bp
::
return_internal_reference
<>
>
())
.
def
(
"points"
,
&
ConvexBaseWrapper
::
points
,
bp
::
args
(
"self"
),
"Retrieve all the points."
,
bp
::
with_custodian_and_ward_postcall
<
0
,
1
>
())
// .add_property ("points",
// bp::make_function(&ConvexBaseWrapper::points,bp::with_custodian_and_ward_postcall<0,1>()),
// "Points of the convex.")
.
def
(
"neighbors"
,
&
ConvexBaseWrapper
::
neighbors
)
.
def
(
"convexHull"
,
&
ConvexBaseWrapper
::
convexHull
,
doxygen
::
member_func_doc
(
&
ConvexBase
::
convexHull
),
...
...
@@ -370,8 +391,6 @@ void exposeCollisionGeometries ()
;
}
namespace
bp
=
boost
::
python
;
class_
<
AABB
>
(
"AABB"
,
"A class describing the AABB collision structure, which is a box in 3D space determined by two diagonal points"
,
no_init
)
...
...
python/fcl.cc
View file @
f8d3fd2b
...
...
@@ -89,7 +89,10 @@ void exposeMeshLoader ()
BOOST_PYTHON_MODULE
(
hppfcl
)
{
boost
::
python
::
import
(
"warnings"
);
namespace
bp
=
boost
::
python
;
PyImport_ImportModule
(
"warnings"
);
exposeVersion
();
exposeMaths
();
exposeCollisionGeometries
();
...
...
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