hpp-fcl: include/hpp/fcl/collision_data.h Source File

hpp-fcl 1.7.3 HPP fork of FCL -- The Flexible Collision Library

collision_data.h
Go to the documentation of this file.
1 /*
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2011-2014, Willow Garage, Inc.
5 * Copyright (c) 2014-2015, Open Source Robotics Foundation
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer in the documentation and/or other materials provided
17 * with the distribution.
18 * * Neither the name of Open Source Robotics Foundation nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
39 #ifndef HPP_FCL_COLLISION_DATA_H
40 #define HPP_FCL_COLLISION_DATA_H
41
42 #include <vector>
43 #include <set>
44 #include <limits>
45
46 #include <hpp/fcl/collision_object.h>
47 #include <hpp/fcl/config.hh>
48 #include <hpp/fcl/data_types.h>
49 #include <hpp/fcl/timings.h>
50
51 namespace hpp
52 {
53 namespace fcl
54 {
55
57 struct HPP_FCL_DLLAPI Contact
58 {
60 const CollisionGeometry* o1;
61
63 const CollisionGeometry* o2;
64
69 int b1;
70
75 int b2;
76
78 Vec3f normal;
79
81 Vec3f pos;
82
84 FCL_REAL penetration_depth;
85
87 static const int NONE = -1;
88
89 Contact() : o1(NULL),
90 o2(NULL),
91 b1(NONE),
92 b2(NONE)
93 {}
94
95 Contact(const CollisionGeometry* o1_, const CollisionGeometry* o2_, int b1_, int b2_) : o1(o1_),
96 o2(o2_),
97 b1(b1_),
98 b2(b2_)
99 {}
100
101 Contact(const CollisionGeometry* o1_, const CollisionGeometry* o2_, int b1_, int b2_,
102 const Vec3f& pos_, const Vec3f& normal_, FCL_REAL depth_) : o1(o1_),
103 o2(o2_),
104 b1(b1_),
105 b2(b2_),
106 normal(normal_),
107 pos(pos_),
108 penetration_depth(depth_)
109 {}
110
111 bool operator < (const Contact& other) const
112 {
113 if(b1 == other.b1)
114 return b2 < other.b2;
115 return b1 < other.b1;
116 }
117
118 bool operator == (const Contact& other) const
119 {
120 return o1 == other.o1
121 && o2 == other.o2
122 && b1 == other.b1
123 && b2 == other.b2
124 && normal == other.normal
125 && pos == other.pos
126 && penetration_depth == other.penetration_depth;
127 }
128
129 bool operator != (const Contact& other) const
130 {
131 return !(*this == other);
132 }
133 };
134
135 struct QueryResult;
136
138 struct HPP_FCL_DLLAPI QueryRequest
139 {
141 bool enable_cached_gjk_guess;
142
144 Vec3f cached_gjk_guess;
145
147 support_func_guess_t cached_support_func_guess;
148
150 bool enable_timings;
151
152 QueryRequest () :
153 enable_cached_gjk_guess (false),
154 cached_gjk_guess (1,0,0),
155 cached_support_func_guess(support_func_guess_t::Zero()),
156 enable_timings(false)
157 {}
158
159 void updateGuess(const QueryResult& result);
160
162 inline bool operator ==(const QueryRequest& other) const
163 {
164 return enable_cached_gjk_guess == other.enable_cached_gjk_guess
165 && cached_gjk_guess == other.cached_gjk_guess
166 && cached_support_func_guess == other.cached_support_func_guess
167 && enable_timings == other.enable_timings;
168 }
169 };
170
172 struct HPP_FCL_DLLAPI QueryResult
173 {
175 Vec3f cached_gjk_guess;
176
178 support_func_guess_t cached_support_func_guess;
179
181 CPUTimes timings;
182
183 QueryResult()
184 : cached_gjk_guess(Vec3f::Zero())
185 , cached_support_func_guess(support_func_guess_t::Constant(-1))
186 {}
187 };
188
189 inline void QueryRequest::updateGuess(const QueryResult& result)
190 {
191 if (enable_cached_gjk_guess) {
192 cached_gjk_guess = result.cached_gjk_guess;
193 cached_support_func_guess = result.cached_support_func_guess;
194 }
195 }
196
197 struct CollisionResult;
198
200 enum CollisionRequestFlag
201 {
202 CONTACT = 0x00001,
203 DISTANCE_LOWER_BOUND = 0x00002,
204 NO_REQUEST = 0x01000
205 };
206
208 struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest
209 {
211 size_t num_max_contacts;
212
214 bool enable_contact;
215
217 bool enable_distance_lower_bound;
218
221 FCL_REAL security_margin;
222
225 FCL_REAL break_distance;
226
231 FCL_REAL distance_upper_bound;
232
233 explicit CollisionRequest(const CollisionRequestFlag flag, size_t num_max_contacts_) :
234 num_max_contacts(num_max_contacts_),
235 enable_contact(flag & CONTACT),
236 enable_distance_lower_bound (flag & DISTANCE_LOWER_BOUND),
237 security_margin (0),
238 break_distance (1e-3),
239 distance_upper_bound ((std::numeric_limits<FCL_REAL>::max)())
240 {
241 }
242
243 CollisionRequest() :
244 num_max_contacts(1),
245 enable_contact(false),
246 enable_distance_lower_bound (false),
247 security_margin (0),
248 break_distance (1e-3),
249 distance_upper_bound ((std::numeric_limits<FCL_REAL>::max)())
250 {
251 }
252
253 bool isSatisfied(const CollisionResult& result) const;
254
256 inline bool operator ==(const CollisionRequest& other) const
257 {
258 return QueryRequest::operator==(other)
259 && num_max_contacts == other.num_max_contacts
260 && enable_contact == other.enable_contact
261 && enable_distance_lower_bound == other.enable_distance_lower_bound
262 && security_margin == other.security_margin
263 && break_distance == other.break_distance
264 && distance_upper_bound == other.distance_upper_bound;
265 }
266 };
267
269 struct HPP_FCL_DLLAPI CollisionResult : QueryResult
270 {
271 private:
273 std::vector<Contact> contacts;
274
275 public:
280 FCL_REAL distance_lower_bound;
281
282 public:
283 CollisionResult()
284 : distance_lower_bound ((std::numeric_limits<FCL_REAL>::max)())
285 {
286 }
287
289 inline void updateDistanceLowerBound (const FCL_REAL& distance_lower_bound_)
290 {
291 if (distance_lower_bound_ < distance_lower_bound)
292 distance_lower_bound = distance_lower_bound_;
293 }
294
296 inline void addContact(const Contact& c)
297 {
298 contacts.push_back(c);
299 }
300
302 inline bool operator ==(const CollisionResult& other) const
303 {
304 return contacts == other.contacts
305 && distance_lower_bound == other.distance_lower_bound;
306 }
307
309 bool isCollision() const
310 {
311 return contacts.size() > 0;
312 }
313
315 size_t numContacts() const
316 {
317 return contacts.size();
318 }
319
321 const Contact& getContact(size_t i) const
322 {
323 if(contacts.size() == 0)
324 throw std::invalid_argument("The number of contacts is zero. No Contact can be returned.");
325
326 if(i < contacts.size())
327 return contacts[i];
328 else
329 return contacts.back();
330 }
331
333 void getContacts(std::vector<Contact>& contacts_) const
334 {
335 contacts_.resize(contacts.size());
336 std::copy(contacts.begin(), contacts.end(), contacts_.begin());
337 }
338
339 const std::vector<Contact> & getContacts() const
340 {
341 return contacts;
342 }
343
345 void clear()
346 {
347 distance_lower_bound = (std::numeric_limits<FCL_REAL>::max)();
348 contacts.clear();
349 distance_lower_bound = (std::numeric_limits<FCL_REAL>::max)();
350 timings.clear();
351 }
352
355 void swapObjects();
356 };
357
358 struct DistanceResult;
359
361 struct HPP_FCL_DLLAPI DistanceRequest : QueryRequest
362 {
364 bool enable_nearest_points;
365
367 FCL_REAL rel_err; // relative error, between 0 and 1
368 FCL_REAL abs_err; // absoluate error
369
373 DistanceRequest(bool enable_nearest_points_ = false,
374 FCL_REAL rel_err_ = 0.0,
375 FCL_REAL abs_err_ = 0.0) :
376 enable_nearest_points(enable_nearest_points_),
377 rel_err(rel_err_),
378 abs_err(abs_err_)
379 {
380 }
381
382 bool isSatisfied(const DistanceResult& result) const;
383
385 inline bool operator ==(const DistanceRequest& other) const
386 {
387 return QueryRequest::operator==(other)
388 && enable_nearest_points == other.enable_nearest_points
389 && rel_err == other.rel_err
390 && abs_err == other.abs_err;
391 }
392 };
393
395 struct HPP_FCL_DLLAPI DistanceResult : QueryResult
396 {
397
398 public:
399
401 FCL_REAL min_distance;
402
404 Vec3f nearest_points[2];
405
407 Vec3f normal;
408
410 const CollisionGeometry* o1;
411
413 const CollisionGeometry* o2;
414
419 int b1;
420
425 int b2;
426
428 static const int NONE = -1;
429
430 DistanceResult(FCL_REAL min_distance_ =
431 (std::numeric_limits<FCL_REAL>::max)()):
432 min_distance(min_distance_), o1(NULL), o2(NULL), b1(NONE), b2(NONE)
433 {
434 const Vec3f nan (Vec3f::Constant(std::numeric_limits<FCL_REAL>::quiet_NaN()));
435 nearest_points [0] = nearest_points [1] = normal = nan;
436 }
437
438
440 void update(FCL_REAL distance, const CollisionGeometry* o1_, const CollisionGeometry* o2_, int b1_, int b2_)
441 {
442 if(min_distance > distance)
443 {
444 min_distance = distance;
445 o1 = o1_;
446 o2 = o2_;
447 b1 = b1_;
448 b2 = b2_;
449 }
450 }
451
453 void update(FCL_REAL distance, const CollisionGeometry* o1_,
454 const CollisionGeometry* o2_, int b1_, int b2_,
455 const Vec3f& p1, const Vec3f& p2, const Vec3f& normal_)
456 {
457 if(min_distance > distance)
458 {
459 min_distance = distance;
460 o1 = o1_;
461 o2 = o2_;
462 b1 = b1_;
463 b2 = b2_;
464 nearest_points[0] = p1;
465 nearest_points[1] = p2;
466 normal = normal_;
467 }
468 }
469
471 void update(const DistanceResult& other_result)
472 {
473 if(min_distance > other_result.min_distance)
474 {
475 min_distance = other_result.min_distance;
476 o1 = other_result.o1;
477 o2 = other_result.o2;
478 b1 = other_result.b1;
479 b2 = other_result.b2;
480 nearest_points[0] = other_result.nearest_points[0];
481 nearest_points[1] = other_result.nearest_points[1];
482 normal = other_result.normal;
483 }
484 }
485
487 void clear()
488 {
489 const Vec3f nan (Vec3f::Constant(std::numeric_limits<FCL_REAL>::quiet_NaN()));
490 min_distance = (std::numeric_limits<FCL_REAL>::max)();
491 o1 = NULL;
492 o2 = NULL;
493 b1 = NONE;
494 b2 = NONE;
495 nearest_points [0] = nearest_points [1] = normal = nan;
496 timings.clear();
497 }
498
500 inline bool operator ==(const DistanceResult& other) const
501 {
502 bool is_same = min_distance == other.min_distance
503 && nearest_points[0] == other.nearest_points[0]
504 && nearest_points[1] == other.nearest_points[1]
505 && normal == other.normal
506 && o1 == other.o1
507 && o2 == other.o2
508 && b1 == other.b1
509 && b2 == other.b2;
510
511 // TODO: check also that two GeometryObject are indeed equal.
512 if ((o1 != NULL) ^ (other.o1 != NULL)) return false;
513 is_same &= (o1 == other.o1);
514 // else if (o1 != NULL and other.o1 != NULL) is_same &= *o1 == *other.o1;
515
516 if ((o2 != NULL) ^ (other.o2 != NULL)) return false;
517 is_same &= (o2 == other.o2);
518 // else if (o2 != NULL and other.o2 != NULL) is_same &= *o2 == *other.o2;
519
520 return is_same;
521 }
522
523 };
524
525 inline CollisionRequestFlag operator~(CollisionRequestFlag a)
526 {return static_cast<CollisionRequestFlag>(~static_cast<const int>(a));}
527
528 inline CollisionRequestFlag operator|(CollisionRequestFlag a, CollisionRequestFlag b)
529 {return static_cast<CollisionRequestFlag>(static_cast<const int>(a) | static_cast<const int>(b));}
530
531 inline CollisionRequestFlag operator&(CollisionRequestFlag a, CollisionRequestFlag b)
532 {return static_cast<CollisionRequestFlag>(static_cast<const int>(a) & static_cast<const int>(b));}
533
534 inline CollisionRequestFlag operator^(CollisionRequestFlag a, CollisionRequestFlag b)
535 {return static_cast<CollisionRequestFlag>(static_cast<const int>(a) ^ static_cast<const int>(b));}
536
537 inline CollisionRequestFlag& operator|=(CollisionRequestFlag& a, CollisionRequestFlag b)
538 {return (CollisionRequestFlag&)((int&)(a) |= static_cast<const int>(b));}
539
540 inline CollisionRequestFlag& operator&=(CollisionRequestFlag& a, CollisionRequestFlag b)
541 {return (CollisionRequestFlag&)((int&)(a) &= static_cast<const int>(b));}
542
543 inline CollisionRequestFlag& operator^=(CollisionRequestFlag& a, CollisionRequestFlag b)
544 {return (CollisionRequestFlag&)((int&)(a) ^= static_cast<const int>(b));}
545
546 }
547
548 } // namespace hpp
549
550 #endif
hpp::fcl::CollisionGeometry
The geometry for the object for collision or distance computation.
Definition: collision_object.h:66
collision_object.h
data_types.h
hpp::fcl::distance
FCL_REAL distance(const Matrix3f &R0, const Vec3f &T0, const kIOS &b1, const kIOS &b2, Vec3f *P=NULL, Vec3f *Q=NULL)
Approximate distance between two kIOS bounding volumes.
hpp::fcl::operator&
CollisionRequestFlag operator&(CollisionRequestFlag a, CollisionRequestFlag b)
Definition: collision_data.h:531
hpp::fcl::operator^=
CollisionRequestFlag & operator^=(CollisionRequestFlag &a, CollisionRequestFlag b)
Definition: collision_data.h:543
hpp::fcl::Vec3f
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition: data_types.h:67
hpp::fcl::operator&=
CollisionRequestFlag & operator&=(CollisionRequestFlag &a, CollisionRequestFlag b)
Definition: collision_data.h:540
hpp::fcl::operator~
CollisionRequestFlag operator~(CollisionRequestFlag a)
Definition: collision_data.h:525
hpp::fcl::CollisionRequestFlag
CollisionRequestFlag
flag declaration for specifying required params in CollisionResult
Definition: collision_data.h:201
hpp::fcl::NO_REQUEST
@ NO_REQUEST
Definition: collision_data.h:204
hpp::fcl::DISTANCE_LOWER_BOUND
@ DISTANCE_LOWER_BOUND
Definition: collision_data.h:203
hpp::fcl::CONTACT
@ CONTACT
Definition: collision_data.h:202
hpp::fcl::operator^
CollisionRequestFlag operator^(CollisionRequestFlag a, CollisionRequestFlag b)
Definition: collision_data.h:534
hpp::fcl::operator|
CollisionRequestFlag operator|(CollisionRequestFlag a, CollisionRequestFlag b)
Definition: collision_data.h:528
hpp::fcl::FCL_REAL
double FCL_REAL
Definition: data_types.h:66
hpp::fcl::support_func_guess_t
Eigen::Vector2i support_func_guess_t
Definition: data_types.h:71
hpp::fcl::operator|=
CollisionRequestFlag & operator|=(CollisionRequestFlag &a, CollisionRequestFlag b)
Definition: collision_data.h:537
hpp
Main namespace.
Definition: AABB.h:44
hpp::fcl::CPUTimes
Definition: timings.h:17
hpp::fcl::CollisionRequest
request to the collision algorithm
Definition: collision_data.h:209
hpp::fcl::CollisionRequest::num_max_contacts
size_t num_max_contacts
The maximum number of contacts will return.
Definition: collision_data.h:211
hpp::fcl::CollisionRequest::enable_distance_lower_bound
bool enable_distance_lower_bound
Whether a lower bound on distance is returned when objects are disjoint.
Definition: collision_data.h:217
hpp::fcl::CollisionRequest::distance_upper_bound
FCL_REAL distance_upper_bound
Distance above which GJK solver makes an early stopping. GJK stops searching for the closest points w...
Definition: collision_data.h:231
hpp::fcl::CollisionRequest::CollisionRequest
CollisionRequest(const CollisionRequestFlag flag, size_t num_max_contacts_)
Definition: collision_data.h:233
hpp::fcl::CollisionRequest::security_margin
FCL_REAL security_margin
Distance below which objects are considered in collision. See Collision detection and distance lower ...
Definition: collision_data.h:221
hpp::fcl::CollisionRequest::enable_contact
bool enable_contact
whether the contact information (normal, penetration depth and contact position) will return
Definition: collision_data.h:214
hpp::fcl::CollisionRequest::isSatisfied
bool isSatisfied(const CollisionResult &result) const
hpp::fcl::CollisionRequest::CollisionRequest
CollisionRequest()
Definition: collision_data.h:243
hpp::fcl::CollisionRequest::break_distance
FCL_REAL break_distance
Distance below which bounding volumes are broken down. See Collision detection and distance lower bou...
Definition: collision_data.h:225
hpp::fcl::CollisionResult
collision result
Definition: collision_data.h:270
hpp::fcl::CollisionResult::clear
void clear()
clear the results obtained
Definition: collision_data.h:345
hpp::fcl::CollisionResult::updateDistanceLowerBound
void updateDistanceLowerBound(const FCL_REAL &distance_lower_bound_)
Update the lower bound only if the distance in inferior.
Definition: collision_data.h:289
hpp::fcl::CollisionResult::addContact
void addContact(const Contact &c)
add one contact into result structure
Definition: collision_data.h:296
hpp::fcl::CollisionResult::getContact
const Contact & getContact(size_t i) const
get the i-th contact calculated
Definition: collision_data.h:321
hpp::fcl::CollisionResult::isCollision
bool isCollision() const
return binary collision result
Definition: collision_data.h:309
hpp::fcl::CollisionResult::getContacts
const std::vector< Contact > & getContacts() const
Definition: collision_data.h:339
hpp::fcl::CollisionResult::getContacts
void getContacts(std::vector< Contact > &contacts_) const
get all the contacts
Definition: collision_data.h:333
hpp::fcl::CollisionResult::distance_lower_bound
FCL_REAL distance_lower_bound
Definition: collision_data.h:280
hpp::fcl::CollisionResult::CollisionResult
CollisionResult()
Definition: collision_data.h:283
hpp::fcl::CollisionResult::numContacts
size_t numContacts() const
number of contacts found
Definition: collision_data.h:315
hpp::fcl::CollisionResult::swapObjects
void swapObjects()
reposition Contact objects when fcl inverts them during their construction.
hpp::fcl::Contact
Contact information returned by collision.
Definition: collision_data.h:58
hpp::fcl::Contact::penetration_depth
FCL_REAL penetration_depth
penetration depth
Definition: collision_data.h:84
hpp::fcl::Contact::Contact
Contact()
Definition: collision_data.h:89
hpp::fcl::Contact::pos
Vec3f pos
contact position, in world space
Definition: collision_data.h:81
hpp::fcl::Contact::b1
int b1
contact primitive in object 1 if object 1 is mesh or point cloud, it is the triangle or point id if o...
Definition: collision_data.h:69
hpp::fcl::Contact::Contact
Contact(const CollisionGeometry *o1_, const CollisionGeometry *o2_, int b1_, int b2_, const Vec3f &pos_, const Vec3f &normal_, FCL_REAL depth_)
Definition: collision_data.h:101
hpp::fcl::Contact::b2
int b2
contact primitive in object 2 if object 2 is mesh or point cloud, it is the triangle or point id if o...
Definition: collision_data.h:75
hpp::fcl::Contact::o2
const CollisionGeometry * o2
collision object 2
Definition: collision_data.h:63
hpp::fcl::Contact::o1
const CollisionGeometry * o1
collision object 1
Definition: collision_data.h:60
hpp::fcl::Contact::normal
Vec3f normal
contact normal, pointing from o1 to o2
Definition: collision_data.h:78
hpp::fcl::Contact::Contact
Contact(const CollisionGeometry *o1_, const CollisionGeometry *o2_, int b1_, int b2_)
Definition: collision_data.h:95
hpp::fcl::DistanceRequest
request to the distance computation
Definition: collision_data.h:362
hpp::fcl::DistanceRequest::enable_nearest_points
bool enable_nearest_points
whether to return the nearest points
Definition: collision_data.h:364
hpp::fcl::DistanceRequest::rel_err
FCL_REAL rel_err
error threshold for approximate distance
Definition: collision_data.h:367
hpp::fcl::DistanceRequest::DistanceRequest
DistanceRequest(bool enable_nearest_points_=false, FCL_REAL rel_err_=0.0, FCL_REAL abs_err_=0.0)
Definition: collision_data.h:373
hpp::fcl::DistanceRequest::isSatisfied
bool isSatisfied(const DistanceResult &result) const
hpp::fcl::DistanceRequest::abs_err
FCL_REAL abs_err
Definition: collision_data.h:368
hpp::fcl::DistanceResult
distance result
Definition: collision_data.h:396
hpp::fcl::DistanceResult::o2
const CollisionGeometry * o2
collision object 2
Definition: collision_data.h:413
hpp::fcl::DistanceResult::DistanceResult
DistanceResult(FCL_REAL min_distance_=(std::numeric_limits< FCL_REAL >::max)())
Definition: collision_data.h:430
hpp::fcl::DistanceResult::update
void update(FCL_REAL distance, const CollisionGeometry *o1_, const CollisionGeometry *o2_, int b1_, int b2_)
add distance information into the result
Definition: collision_data.h:440
hpp::fcl::DistanceResult::update
void update(const DistanceResult &other_result)
add distance information into the result
Definition: collision_data.h:471
hpp::fcl::DistanceResult::normal
Vec3f normal
In case both objects are in collision, store the normal.
Definition: collision_data.h:407
hpp::fcl::DistanceResult::o1
const CollisionGeometry * o1
collision object 1
Definition: collision_data.h:410
hpp::fcl::DistanceResult::update
void update(FCL_REAL distance, const CollisionGeometry *o1_, const CollisionGeometry *o2_, int b1_, int b2_, const Vec3f &p1, const Vec3f &p2, const Vec3f &normal_)
add distance information into the result
Definition: collision_data.h:453
hpp::fcl::DistanceResult::b2
int b2
information about the nearest point in object 2 if object 2 is mesh or point cloud,...
Definition: collision_data.h:425
hpp::fcl::DistanceResult::nearest_points
Vec3f nearest_points[2]
nearest points
Definition: collision_data.h:404
hpp::fcl::DistanceResult::b1
int b1
information about the nearest point in object 1 if object 1 is mesh or point cloud,...
Definition: collision_data.h:419
hpp::fcl::DistanceResult::clear
void clear()
clear the result
Definition: collision_data.h:487
hpp::fcl::DistanceResult::min_distance
FCL_REAL min_distance
minimum distance between two objects. if two objects are in collision, min_distance <= 0.
Definition: collision_data.h:401
hpp::fcl::QueryRequest
base class for all query requests
Definition: collision_data.h:139
hpp::fcl::QueryRequest::cached_gjk_guess
Vec3f cached_gjk_guess
the gjk intial guess set by user
Definition: collision_data.h:144
hpp::fcl::QueryRequest::operator==
bool operator==(const QueryRequest &other) const
whether two QueryRequest are the same or not
Definition: collision_data.h:162
hpp::fcl::QueryRequest::cached_support_func_guess
support_func_guess_t cached_support_func_guess
the support function intial guess set by user
Definition: collision_data.h:147
hpp::fcl::QueryRequest::QueryRequest
QueryRequest()
Definition: collision_data.h:152
hpp::fcl::QueryRequest::updateGuess
void updateGuess(const QueryResult &result)
Definition: collision_data.h:189
hpp::fcl::QueryRequest::enable_timings
bool enable_timings
enable timings when performing collision/distance request
Definition: collision_data.h:150
hpp::fcl::QueryRequest::enable_cached_gjk_guess
bool enable_cached_gjk_guess
whether enable gjk intial guess
Definition: collision_data.h:141
hpp::fcl::QueryResult
base class for all query results
Definition: collision_data.h:173
hpp::fcl::QueryResult::cached_support_func_guess
support_func_guess_t cached_support_func_guess
stores the last support function vertex index, when relevant.
Definition: collision_data.h:178
hpp::fcl::QueryResult::cached_gjk_guess
Vec3f cached_gjk_guess
stores the last GJK ray when relevant.
Definition: collision_data.h:175
hpp::fcl::QueryResult::QueryResult
QueryResult()
Definition: collision_data.h:183
hpp::fcl::QueryResult::timings
CPUTimes timings
timings for the given request
Definition: collision_data.h:181
timings.h