Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
coal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coal
coal
Commits
abcdb7e7
Verified
Commit
abcdb7e7
authored
5 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
python: full expose of AABB
parent
69212ab8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/collision-geometries.cc
+78
-1
78 additions, 1 deletion
python/collision-geometries.cc
with
78 additions
and
1 deletion
python/collision-geometries.cc
+
78
−
1
View file @
abcdb7e7
//
// Software License Agreement (BSD License)
//
// Copyright (c) 2019 CNRS-LAAS INRIA
// Copyright (c) 2019
-2020
CNRS-LAAS INRIA
// Author: Joseph Mirabel
// All rights reserved.
//
...
...
@@ -183,6 +183,13 @@ void exposeShapes ()
}
boost
::
python
::
tuple
AABB_distance_proxy
(
const
AABB
&
self
,
const
AABB
&
other
)
{
Vec3f
P
,
Q
;
FCL_REAL
distance
=
self
.
distance
(
other
,
&
P
,
&
Q
);
return
boost
::
python
::
tuple
((
distance
,
P
,
Q
));
}
void
exposeCollisionGeometries
()
{
...
...
@@ -220,6 +227,76 @@ void exposeCollisionGeometries ()
.
value
(
"GEOM_OCTREE"
,
GEOM_OCTREE
)
;
}
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
)
.
def
(
init
<>
(
"Default constructor"
))
.
def
(
init
<
Vec3f
>
(
bp
::
arg
(
"v"
),
"Creating an AABB at position v with zero size."
))
.
def
(
init
<
Vec3f
,
Vec3f
>
(
bp
::
args
(
"a"
,
"b"
),
"Creating an AABB with two endpoints a and b."
))
.
def
(
init
<
AABB
,
Vec3f
>
(
bp
::
args
(
"core"
,
"delta"
),
"Creating an AABB centered as core and is of half-dimension delta."
))
.
def
(
init
<
Vec3f
,
Vec3f
,
Vec3f
>
(
bp
::
args
(
"a"
,
"b"
,
"c"
),
"Creating an AABB contains three points."
))
.
def
(
"contain"
,
(
bool
(
AABB
::*
)(
const
Vec3f
&
)
const
)
&
AABB
::
contain
,
bp
::
args
(
"self"
,
"p"
),
"Check whether the AABB contains a point p."
)
.
def
(
"contain"
,
(
bool
(
AABB
::*
)(
const
AABB
&
)
const
)
&
AABB
::
contain
,
bp
::
args
(
"self"
,
"other"
),
"Check whether the AABB contains another AABB."
)
.
def
(
"overlap"
,
(
bool
(
AABB
::*
)(
const
AABB
&
)
const
)
&
AABB
::
overlap
,
bp
::
args
(
"self"
,
"other"
),
"Check whether two AABB are overlap."
)
.
def
(
"overlap"
,
(
bool
(
AABB
::*
)(
const
AABB
&
,
AABB
&
)
const
)
&
AABB
::
overlap
,
bp
::
args
(
"self"
,
"other"
,
"overlapping_part"
),
"Check whether two AABB are overlaping and return the overloaping part if true."
)
.
def
(
"distance"
,
(
FCL_REAL
(
AABB
::*
)(
const
AABB
&
)
const
)
&
AABB
::
distance
,
bp
::
args
(
"self"
,
"other"
),
"Distance between two AABBs."
)
// .def("distance",
// AABB_distance_proxy,
// bp::args("self","other"),
// "Distance between two AABBs.")
.
def
(
bp
::
self
+
bp
::
self
)
.
def
(
bp
::
self
+=
bp
::
self
)
.
def
(
bp
::
self
+=
Vec3f
())
.
def
(
"size"
,
&
AABB
::
volume
,
bp
::
arg
(
"self"
),
"Size of the AABB."
)
.
def
(
"center"
,
&
AABB
::
center
,
bp
::
arg
(
"self"
),
"Center of the AABB."
)
.
def
(
"width"
,
&
AABB
::
width
,
bp
::
arg
(
"self"
),
"Width of the AABB."
)
.
def
(
"height"
,
&
AABB
::
height
,
bp
::
arg
(
"self"
),
"Height of the AABB."
)
.
def
(
"depth"
,
&
AABB
::
depth
,
bp
::
arg
(
"self"
),
"Depth of the AABB."
)
.
def
(
"volume"
,
&
AABB
::
volume
,
bp
::
arg
(
"self"
),
"Volume of the AABB."
)
.
def
(
"expand"
,
(
AABB
&
(
AABB
::*
)(
const
AABB
&
,
FCL_REAL
))
&
AABB
::
expand
,
bp
::
args
(
"self"
,
"core"
,
"ratio"
),
"Expand the AABB by increase the thickness of the plate by a ratio."
,
bp
::
return_internal_reference
<>
())
.
def
(
"expand"
,
(
AABB
&
(
AABB
::*
)(
const
Vec3f
&
))
&
AABB
::
expand
,
bp
::
args
(
"self"
,
"delta"
),
"Expand the half size of the AABB by delta, and keep the center unchanged."
,
bp
::
return_internal_reference
<>
());
def
(
"translate"
,
(
AABB
(
*
)(
const
AABB
&
,
const
Vec3f
&
))
&
translate
,
bp
::
args
(
"aabb"
,
"t"
),
"Translate the center of AABB by t"
);
def
(
"rotate"
,
(
AABB
(
*
)(
const
AABB
&
,
const
Matrix3f
&
))
&
rotate
,
bp
::
args
(
"aabb"
,
"R"
),
"Rotate the AABB object by R"
);
if
(
!
eigenpy
::
register_symbolic_link_to_registered_type
<
CollisionGeometry
>
())
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment