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
2d8d1be4
Commit
2d8d1be4
authored
5 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
Implement kDOP::overlap with lower bound.
parent
8754b233
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/hpp/fcl/BV/kDOP.h
+7
-8
7 additions, 8 deletions
include/hpp/fcl/BV/kDOP.h
src/BV/kDOP.cpp
+24
-0
24 additions, 0 deletions
src/BV/kDOP.cpp
with
31 additions
and
8 deletions
include/hpp/fcl/BV/kDOP.h
+
7
−
8
View file @
2d8d1be4
...
...
@@ -103,16 +103,15 @@ public:
/// @brief Creating kDOP containing two points
KDOP
(
const
Vec3f
&
a
,
const
Vec3f
&
b
);
/// @brief Check whether two KDOPs
are
overlap
ped
/// @brief Check whether two KDOPs overlap
.
bool
overlap
(
const
KDOP
<
N
>&
other
)
const
;
/// Not implemented
bool
overlap
(
const
KDOP
<
N
>&
other
,
const
CollisionRequest
&
,
FCL_REAL
&
sqrDistLowerBound
)
const
{
sqrDistLowerBound
=
sqrt
(
-
1
);
return
overlap
(
other
);
}
/// @brief Check whether two KDOPs overlap.
/// @return true if collision happens.
/// @retval sqrDistLowerBound squared lower bound on distance between boxes if
/// they do not overlap.
bool
overlap
(
const
KDOP
<
N
>&
other
,
const
CollisionRequest
&
request
,
FCL_REAL
&
sqrDistLowerBound
)
const
;
/// @brief The distance between two KDOP<N>. Not implemented.
FCL_REAL
distance
(
const
KDOP
<
N
>&
other
,
Vec3f
*
P
=
NULL
,
Vec3f
*
Q
=
NULL
)
const
;
...
...
This diff is collapsed.
Click to expand it.
src/BV/kDOP.cpp
+
24
−
0
View file @
2d8d1be4
...
...
@@ -39,6 +39,8 @@
#include
<limits>
#include
<iostream>
#include
<hpp/fcl/collision_data.h>
namespace
hpp
{
namespace
fcl
...
...
@@ -155,6 +157,28 @@ bool KDOP<N>::overlap(const KDOP<N>& other) const
return
true
;
}
template
<
short
N
>
bool
KDOP
<
N
>::
overlap
(
const
KDOP
<
N
>&
other
,
const
CollisionRequest
&
request
,
FCL_REAL
&
sqrDistLowerBound
)
const
{
const
FCL_REAL
breakDistance
(
request
.
break_distance
+
request
.
security_margin
);
FCL_REAL
a
=
(
dist_
.
template
head
<
N
/
2
>()
-
other
.
dist_
.
template
tail
<
N
/
2
>()).
minCoeff
();
if
(
a
>
breakDistance
)
{
sqrDistLowerBound
=
a
*
a
;
return
false
;
}
FCL_REAL
b
=
(
other
.
dist_
.
template
head
<
N
/
2
>()
-
dist_
.
template
tail
<
N
/
2
>()).
minCoeff
();
if
(
b
>
breakDistance
)
{
sqrDistLowerBound
=
b
*
b
;
return
false
;
}
sqrDistLowerBound
=
std
::
min
(
a
,
b
);
return
true
;
}
template
<
short
N
>
bool
KDOP
<
N
>::
inside
(
const
Vec3f
&
p
)
const
{
...
...
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