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
798c0ade
Commit
798c0ade
authored
Jul 28, 2012
by
jpan
Browse files
remove exhaustive in request
git-svn-id:
https://kforge.ros.org/fcl/fcl_ros@145
253336fb-580f-4252-a368-f3cef5a2a82b
parent
f0220fea
Changes
8
Hide whitespace changes
Inline
Side-by-side
trunk/fcl/include/fcl/collision_data.h
View file @
798c0ade
...
...
@@ -87,18 +87,15 @@ struct CostSource
struct
CollisionRequest
{
bool
exhaustive
;
size_t
num_max_contacts
;
bool
enable_contact
;
size_t
num_max_cost_sources
;
bool
enable_cost
;
CollisionRequest
(
bool
exhaustive_
=
false
,
size_t
num_max_contacts_
=
1
,
CollisionRequest
(
size_t
num_max_contacts_
=
1
,
bool
enable_contact_
=
false
,
size_t
num_max_cost_sources_
=
1
,
bool
enable_cost_
=
false
)
:
exhaustive
(
exhaustive_
),
num_max_contacts
(
num_max_contacts_
),
bool
enable_cost_
=
false
)
:
num_max_contacts
(
num_max_contacts_
),
enable_contact
(
enable_contact_
),
num_max_cost_sources
(
num_max_cost_sources_
),
enable_cost
(
enable_cost_
)
...
...
trunk/fcl/include/fcl/traversal_node_bvh_shape.h
View file @
798c0ade
...
...
@@ -219,7 +219,7 @@ public:
bool
canStop
()
const
{
return
(
!
this
->
request
.
exhaustive
)
&&
(
!
this
->
request
.
enable_cost
)
&&
(
this
->
result
->
isCollision
())
&&
(
this
->
request
.
num_max_contacts
<=
this
->
result
->
numContacts
());
return
(
!
this
->
request
.
enable_cost
)
&&
(
this
->
result
->
isCollision
())
&&
(
this
->
request
.
num_max_contacts
<=
this
->
result
->
numContacts
());
}
Vec3f
*
vertices
;
...
...
@@ -469,7 +469,7 @@ public:
bool
canStop
()
const
{
return
(
!
this
->
request
.
exhaustive
)
&&
(
!
this
->
request
.
enable_cost
)
&&
(
this
->
result
->
isCollision
())
&&
(
this
->
request
.
num_max_contacts
<=
this
->
result
->
numContacts
());
return
(
!
this
->
request
.
enable_cost
)
&&
(
this
->
result
->
isCollision
())
&&
(
this
->
request
.
num_max_contacts
<=
this
->
result
->
numContacts
());
}
Vec3f
*
vertices
;
...
...
trunk/fcl/include/fcl/traversal_node_bvhs.h
View file @
798c0ade
...
...
@@ -201,11 +201,9 @@ public:
&
normal
))
{
is_intersect
=
true
;
if
(
!
this
->
request
.
exhaustive
)
{
if
(
this
->
request
.
num_max_contacts
<
n_contacts
+
this
->
result
->
numContacts
())
n_contacts
=
(
this
->
request
.
num_max_contacts
>=
this
->
result
->
numContacts
())
?
(
this
->
request
.
num_max_contacts
-
this
->
result
->
numContacts
())
:
0
;
}
if
(
this
->
request
.
num_max_contacts
<
n_contacts
+
this
->
result
->
numContacts
())
n_contacts
=
(
this
->
request
.
num_max_contacts
>=
this
->
result
->
numContacts
())
?
(
this
->
request
.
num_max_contacts
-
this
->
result
->
numContacts
())
:
0
;
for
(
unsigned
int
i
=
0
;
i
<
n_contacts
;
++
i
)
{
...
...
@@ -235,7 +233,7 @@ public:
/** \brief Whether the traversal process can stop early */
bool
canStop
()
const
{
return
(
!
this
->
request
.
exhaustive
)
&&
(
!
this
->
request
.
enable_cost
)
&&
(
this
->
result
->
isCollision
())
&&
(
this
->
request
.
num_max_contacts
<=
this
->
result
->
numContacts
());
return
(
!
this
->
request
.
enable_cost
)
&&
(
this
->
result
->
isCollision
())
&&
(
this
->
request
.
num_max_contacts
<=
this
->
result
->
numContacts
());
}
Vec3f
*
vertices1
;
...
...
@@ -388,7 +386,7 @@ public:
bool
canStop
()
const
{
return
(
pairs
.
size
()
>
0
)
&&
(
!
this
->
request
.
exhaustive
)
&&
(
this
->
request
.
num_max_contacts
<=
pairs
.
size
());
return
(
pairs
.
size
()
>
0
)
&&
(
this
->
request
.
num_max_contacts
<=
pairs
.
size
());
}
Vec3f
*
vertices1
;
...
...
@@ -486,7 +484,7 @@ public:
bool
canStop
()
const
{
return
(
pairs
.
size
()
>
0
)
&&
(
!
this
->
request
.
exhaustive
)
&&
(
this
->
request
.
num_max_contacts
<=
pairs
.
size
());
return
(
pairs
.
size
()
>
0
)
&&
(
this
->
request
.
num_max_contacts
<=
pairs
.
size
());
}
Vec3f
*
vertices1
;
...
...
@@ -651,7 +649,7 @@ public:
bool
canStop
()
const
{
return
(
pairs
.
size
()
>
0
)
&&
(
!
this
->
request
.
exhaustive
)
&&
(
this
->
request
.
num_max_contacts
<=
pairs
.
size
());
return
(
pairs
.
size
()
>
0
)
&&
(
this
->
request
.
num_max_contacts
<=
pairs
.
size
());
}
Vec3f
*
vertices1
;
...
...
@@ -736,7 +734,7 @@ public:
bool
canStop
()
const
{
return
(
pairs
.
size
()
>
0
)
&&
(
!
this
->
request
.
exhaustive
)
&&
(
this
->
request
.
num_max_contacts
<=
pairs
.
size
());
return
(
pairs
.
size
()
>
0
)
&&
(
this
->
request
.
num_max_contacts
<=
pairs
.
size
());
}
Vec3f
*
vertices1
;
...
...
@@ -819,7 +817,7 @@ public:
bool
canStop
()
const
{
return
(
pairs
.
size
()
>
0
)
&&
(
!
this
->
request
.
exhaustive
)
&&
(
this
->
request
.
num_max_contacts
<=
pairs
.
size
());
return
(
pairs
.
size
()
>
0
)
&&
(
this
->
request
.
num_max_contacts
<=
pairs
.
size
());
}
Vec3f
*
vertices1
;
...
...
trunk/fcl/include/fcl/traversal_node_octree.h
View file @
798c0ade
...
...
@@ -325,7 +325,7 @@ private:
cresult
->
addCostSource
(
CostSource
(
overlap_part
,
root1
->
getOccupancy
()
*
s
.
cost_density
));
}
return
(
!
crequest
->
exhaustive
)
&&
(
!
crequest
->
enable_cost
)
&&
(
cresult
->
isCollision
())
&&
(
crequest
->
num_max_contacts
<=
cresult
->
numContacts
());
return
(
!
crequest
->
enable_cost
)
&&
(
cresult
->
isCollision
())
&&
(
crequest
->
num_max_contacts
<=
cresult
->
numContacts
());
}
else
return
false
;
}
...
...
@@ -528,7 +528,7 @@ private:
cresult
->
addCostSource
(
CostSource
(
overlap_part
,
root1
->
getOccupancy
()
*
tree2
->
cost_density
));
}
return
(
!
crequest
->
exhaustive
)
&&
(
!
crequest
->
enable_cost
)
&&
(
cresult
->
isCollision
())
&&
(
crequest
->
num_max_contacts
<=
cresult
->
numContacts
());
return
(
!
crequest
->
enable_cost
)
&&
(
cresult
->
isCollision
())
&&
(
crequest
->
num_max_contacts
<=
cresult
->
numContacts
());
}
else
return
false
;
...
...
@@ -743,7 +743,7 @@ private:
cresult
->
addCostSource
(
CostSource
(
overlap_part
,
root1
->
getOccupancy
()
*
root2
->
getOccupancy
()));
}
return
(
!
crequest
->
exhaustive
)
&&
(
!
crequest
->
enable_cost
)
&&
(
cresult
->
isCollision
())
&&
(
crequest
->
num_max_contacts
<=
cresult
->
numContacts
());
return
(
!
crequest
->
enable_cost
)
&&
(
cresult
->
isCollision
())
&&
(
crequest
->
num_max_contacts
<=
cresult
->
numContacts
());
}
else
if
(
!
tree1
->
isNodeFree
(
root1
)
&&
!
tree2
->
isNodeFree
(
root2
)
&&
crequest
->
enable_cost
)
// uncertain area (here means both are uncertain or one uncertain and one occupied)
{
...
...
trunk/fcl/src/broad_phase_collision.cpp
View file @
798c0ade
...
...
@@ -59,7 +59,7 @@ bool defaultCollisionFunction(CollisionObject* o1, CollisionObject* o2, void* cd
collide
(
o1
,
o2
,
request
,
result
);
if
(
(
!
request
.
exhaustive
)
&&
(
result
.
isCollision
())
&&
(
result
.
numContacts
()
>=
request
.
num_max_contacts
))
if
(
(
result
.
isCollision
())
&&
(
result
.
numContacts
()
>=
request
.
num_max_contacts
))
cdata
->
done
=
true
;
return
cdata
->
done
;
...
...
trunk/fcl/src/collision.cpp
View file @
798c0ade
...
...
@@ -75,7 +75,7 @@ int collide(const CollisionGeometry* o1, const SimpleTransform& tf1,
const
CollisionFunctionMatrix
<
NarrowPhaseSolver
>&
looktable
=
getCollisionFunctionLookTable
<
NarrowPhaseSolver
>
();
int
res
;
if
(
request
.
num_max_contacts
==
0
&&
!
request
.
exhaustive
)
if
(
request
.
num_max_contacts
==
0
)
{
std
::
cerr
<<
"Warning: should stop early as num_max_contact is "
<<
request
.
num_max_contacts
<<
" !"
<<
std
::
endl
;
res
=
0
;
...
...
trunk/fcl/src/conservative_advancement.cpp
View file @
798c0ade
...
...
@@ -55,7 +55,7 @@ int conservativeAdvancement(const CollisionGeometry* o1,
CollisionResult
&
result
,
FCL_REAL
&
toc
)
{
if
(
(
request
.
num_max_contacts
==
0
)
&&
!
request
.
exhaustive
)
if
(
request
.
num_max_contacts
==
0
)
{
std
::
cerr
<<
"Warning: should stop early as num_max_contact is "
<<
request
.
num_max_contacts
<<
" !"
<<
std
::
endl
;
return
0
;
...
...
trunk/fcl/src/traversal_node_bvhs.cpp
View file @
798c0ade
...
...
@@ -100,12 +100,10 @@ static inline void meshCollisionOrientedNodeLeafTesting(int b1, int b2,
&
normal
))
{
is_intersect
=
true
;
if
(
!
request
.
exhaustive
)
{
if
(
request
.
num_max_contacts
<
result
.
numContacts
()
+
n_contacts
)
n_contacts
=
(
request
.
num_max_contacts
>
result
.
numContacts
())
?
(
request
.
num_max_contacts
-
result
.
numContacts
())
:
0
;
}
if
(
request
.
num_max_contacts
<
result
.
numContacts
()
+
n_contacts
)
n_contacts
=
(
request
.
num_max_contacts
>
result
.
numContacts
())
?
(
request
.
num_max_contacts
-
result
.
numContacts
())
:
0
;
for
(
unsigned
int
i
=
0
;
i
<
n_contacts
;
++
i
)
{
result
.
addContact
(
Contact
(
model1
,
model2
,
primitive_id1
,
primitive_id2
,
tf1
.
transform
(
contacts
[
i
]),
tf1
.
getQuatRotation
().
transform
(
normal
),
penetration
));
...
...
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