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 
38 #ifndef HPP_FCL_COLLISION_DATA_H
39 #define HPP_FCL_COLLISION_DATA_H
40 
41 #include <vector>
42 #include <set>
43 #include <limits>
44 
46 #include <hpp/fcl/config.hh>
47 #include <hpp/fcl/data_types.h>
48 #include <hpp/fcl/timings.h>
49 
50 namespace hpp {
51 namespace fcl {
52 
54 struct HPP_FCL_DLLAPI Contact {
57 
60 
65  int b1;
66 
71  int b2;
72 
75 
78 
81 
83  static const int NONE = -1;
84 
86  Contact() : o1(NULL), o2(NULL), b1(NONE), b2(NONE) {}
87 
88  Contact(const CollisionGeometry* o1_, const CollisionGeometry* o2_, int b1_,
89  int b2_)
90  : o1(o1_), o2(o2_), b1(b1_), b2(b2_) {}
91 
92  Contact(const CollisionGeometry* o1_, const CollisionGeometry* o2_, int b1_,
93  int b2_, const Vec3f& pos_, const Vec3f& normal_, FCL_REAL depth_)
94  : o1(o1_),
95  o2(o2_),
96  b1(b1_),
97  b2(b2_),
98  normal(normal_),
99  pos(pos_),
100  penetration_depth(depth_) {}
101 
102  bool operator<(const Contact& other) const {
103  if (b1 == other.b1) return b2 < other.b2;
104  return b1 < other.b1;
105  }
106 
107  bool operator==(const Contact& other) const {
108  return o1 == other.o1 && o2 == other.o2 && b1 == other.b1 &&
109  b2 == other.b2 && normal == other.normal && pos == other.pos &&
110  penetration_depth == other.penetration_depth;
111  }
112 
113  bool operator!=(const Contact& other) const { return !(*this == other); }
114 };
115 
116 struct QueryResult;
117 
119 struct HPP_FCL_DLLAPI QueryRequest {
120  // @briefInitial guess to use for the GJK algorithm
122 
125  HPP_FCL_DEPRECATED_MESSAGE("Use gjk_initial_guess instead")
126  bool enable_cached_gjk_guess;
127 
129  GJKVariant gjk_variant;
130 
132  GJKConvergenceCriterion gjk_convergence_criterion;
133 
135  GJKConvergenceCriterionType gjk_convergence_criterion_type;
136 
138  FCL_REAL gjk_tolerance;
139 
141  size_t gjk_max_iterations;
142 
144  Vec3f cached_gjk_guess;
145 
147  support_func_guess_t cached_support_func_guess;
148 
150  bool enable_timings;
151 
153  FCL_REAL collision_distance_threshold;
154 
159  : gjk_initial_guess(GJKInitialGuess::DefaultGuess),
160  enable_cached_gjk_guess(false),
161  gjk_variant(GJKVariant::DefaultGJK),
162  gjk_convergence_criterion(GJKConvergenceCriterion::VDB),
163  gjk_convergence_criterion_type(GJKConvergenceCriterionType::Relative),
164  gjk_tolerance(1e-6),
165  gjk_max_iterations(128),
166  cached_gjk_guess(1, 0, 0),
167  cached_support_func_guess(support_func_guess_t::Zero()),
168  enable_timings(false),
169  collision_distance_threshold(
170  Eigen::NumTraits<FCL_REAL>::dummy_precision()) {}
171 
173  QueryRequest(const QueryRequest& other) = default;
174 
176  QueryRequest& operator=(const QueryRequest& other) = default;
178 
179  void updateGuess(const QueryResult& result);
180 
182  inline bool operator==(const QueryRequest& other) const {
185  return gjk_initial_guess == other.gjk_initial_guess &&
186  enable_cached_gjk_guess == other.enable_cached_gjk_guess &&
187  cached_gjk_guess == other.cached_gjk_guess &&
188  cached_support_func_guess == other.cached_support_func_guess &&
189  enable_timings == other.enable_timings;
191  }
192 };
193 
195 struct HPP_FCL_DLLAPI QueryResult {
198 
201 
204 
206  : cached_gjk_guess(Vec3f::Zero()),
207  cached_support_func_guess(support_func_guess_t::Constant(-1)) {}
208 };
209 
210 inline void QueryRequest::updateGuess(const QueryResult& result) {
214  }
215  // TODO: use gjk_initial_guess instead
221  }
223 }
224 
225 struct CollisionResult;
226 
229  CONTACT = 0x00001,
231  NO_REQUEST = 0x01000
232 };
233 
235 struct HPP_FCL_DLLAPI CollisionRequest : QueryRequest {
238 
242 
245 
252 
256 
264 
270  CollisionRequest(const CollisionRequestFlag flag, size_t num_max_contacts_)
271  : num_max_contacts(num_max_contacts_),
272  enable_contact(flag & CONTACT),
273  enable_distance_lower_bound(flag & DISTANCE_LOWER_BOUND),
274  security_margin(0),
275  break_distance(1e-3),
276  distance_upper_bound((std::numeric_limits<FCL_REAL>::max)()) {}
277 
280  : num_max_contacts(1),
281  enable_contact(false),
282  enable_distance_lower_bound(false),
283  security_margin(0),
284  break_distance(1e-3),
285  distance_upper_bound((std::numeric_limits<FCL_REAL>::max)()) {}
286 
287  bool isSatisfied(const CollisionResult& result) const;
288 
290  inline bool operator==(const CollisionRequest& other) const {
291  return QueryRequest::operator==(other) &&
293  enable_contact == other.enable_contact &&
294  enable_distance_lower_bound == other.enable_distance_lower_bound &&
295  security_margin == other.security_margin &&
296  break_distance == other.break_distance &&
297  distance_upper_bound == other.distance_upper_bound;
298  }
299 };
300 
302 struct HPP_FCL_DLLAPI CollisionResult : QueryResult {
303  private:
305  std::vector<Contact> contacts;
306 
307  public:
313 
317  Vec3f nearest_points[2];
318 
319  public:
321  : distance_lower_bound((std::numeric_limits<FCL_REAL>::max)()) {}
322 
324  inline void updateDistanceLowerBound(const FCL_REAL& distance_lower_bound_) {
325  if (distance_lower_bound_ < distance_lower_bound)
326  distance_lower_bound = distance_lower_bound_;
327  }
328 
330  inline void addContact(const Contact& c) { contacts.push_back(c); }
331 
333  inline bool operator==(const CollisionResult& other) const {
334  return contacts == other.contacts &&
336  }
337 
339  bool isCollision() const { return contacts.size() > 0; }
340 
342  size_t numContacts() const { return contacts.size(); }
343 
345  const Contact& getContact(size_t i) const {
346  if (contacts.size() == 0)
347  throw std::invalid_argument(
348  "The number of contacts is zero. No Contact can be returned.");
349 
350  if (i < contacts.size())
351  return contacts[i];
352  else
353  return contacts.back();
354  }
355 
357  void setContact(size_t i, const Contact& c) {
358  if (contacts.size() == 0)
359  throw std::invalid_argument(
360  "The number of contacts is zero. No Contact can be returned.");
361 
362  if (i < contacts.size())
363  contacts[i] = c;
364  else
365  contacts.back() = c;
366  }
367 
369  void getContacts(std::vector<Contact>& contacts_) const {
370  contacts_.resize(contacts.size());
371  std::copy(contacts.begin(), contacts.end(), contacts_.begin());
372  }
373 
374  const std::vector<Contact>& getContacts() const { return contacts; }
375 
377  void clear() {
378  distance_lower_bound = (std::numeric_limits<FCL_REAL>::max)();
379  contacts.clear();
380  distance_lower_bound = (std::numeric_limits<FCL_REAL>::max)();
381  timings.clear();
382  }
383 
386  void swapObjects();
387 };
388 
389 struct DistanceResult;
390 
392 struct HPP_FCL_DLLAPI DistanceRequest : QueryRequest {
395 
397  FCL_REAL rel_err; // relative error, between 0 and 1
398  FCL_REAL abs_err; // absolute error
399 
403  DistanceRequest(bool enable_nearest_points_ = false, FCL_REAL rel_err_ = 0.0,
404  FCL_REAL abs_err_ = 0.0)
405  : enable_nearest_points(enable_nearest_points_),
406  rel_err(rel_err_),
407  abs_err(abs_err_) {}
408 
409  bool isSatisfied(const DistanceResult& result) const;
410 
412  inline bool operator==(const DistanceRequest& other) const {
413  return QueryRequest::operator==(other) &&
414  enable_nearest_points == other.enable_nearest_points &&
415  rel_err == other.rel_err && abs_err == other.abs_err;
416  }
417 };
418 
420 struct HPP_FCL_DLLAPI DistanceResult : QueryResult {
421  public:
425 
427  Vec3f nearest_points[2];
428 
431 
434 
437 
442  int b1;
443 
448  int b2;
449 
451  static const int NONE = -1;
452 
454  FCL_REAL min_distance_ = (std::numeric_limits<FCL_REAL>::max)())
455  : min_distance(min_distance_), o1(NULL), o2(NULL), b1(NONE), b2(NONE) {
456  const Vec3f nan(
457  Vec3f::Constant(std::numeric_limits<FCL_REAL>::quiet_NaN()));
458  nearest_points[0] = nearest_points[1] = normal = nan;
459  }
460 
463  const CollisionGeometry* o2_, int b1_, int b2_) {
464  if (min_distance > distance) {
465  min_distance = distance;
466  o1 = o1_;
467  o2 = o2_;
468  b1 = b1_;
469  b2 = b2_;
470  }
471  }
472 
475  const CollisionGeometry* o2_, int b1_, int b2_, const Vec3f& p1,
476  const Vec3f& p2, const Vec3f& normal_) {
477  if (min_distance > distance) {
478  min_distance = distance;
479  o1 = o1_;
480  o2 = o2_;
481  b1 = b1_;
482  b2 = b2_;
483  nearest_points[0] = p1;
484  nearest_points[1] = p2;
485  normal = normal_;
486  }
487  }
488 
490  void update(const DistanceResult& other_result) {
491  if (min_distance > other_result.min_distance) {
492  min_distance = other_result.min_distance;
493  o1 = other_result.o1;
494  o2 = other_result.o2;
495  b1 = other_result.b1;
496  b2 = other_result.b2;
497  nearest_points[0] = other_result.nearest_points[0];
498  nearest_points[1] = other_result.nearest_points[1];
499  normal = other_result.normal;
500  }
501  }
502 
504  void clear() {
505  const Vec3f nan(
506  Vec3f::Constant(std::numeric_limits<FCL_REAL>::quiet_NaN()));
507  min_distance = (std::numeric_limits<FCL_REAL>::max)();
508  o1 = NULL;
509  o2 = NULL;
510  b1 = NONE;
511  b2 = NONE;
512  nearest_points[0] = nearest_points[1] = normal = nan;
513  timings.clear();
514  }
515 
517  inline bool operator==(const DistanceResult& other) const {
518  bool is_same = min_distance == other.min_distance &&
519  nearest_points[0] == other.nearest_points[0] &&
520  nearest_points[1] == other.nearest_points[1] &&
521  normal == other.normal && o1 == other.o1 && o2 == other.o2 &&
522  b1 == other.b1 && b2 == other.b2;
523 
524  // TODO: check also that two GeometryObject are indeed equal.
525  if ((o1 != NULL) ^ (other.o1 != NULL)) return false;
526  is_same &= (o1 == other.o1);
527  // else if (o1 != NULL and other.o1 != NULL) is_same &= *o1 == *other.o1;
528 
529  if ((o2 != NULL) ^ (other.o2 != NULL)) return false;
530  is_same &= (o2 == other.o2);
531  // else if (o2 != NULL and other.o2 != NULL) is_same &= *o2 == *other.o2;
532 
533  return is_same;
534  }
535 };
536 
537 namespace internal {
539  CollisionResult& res,
540  const FCL_REAL& sqrDistLowerBound) {
541  // BV cannot find negative distance.
542  if (res.distance_lower_bound <= 0) return;
543  FCL_REAL new_dlb = std::sqrt(sqrDistLowerBound); // - req.security_margin;
544  if (new_dlb < res.distance_lower_bound) res.distance_lower_bound = new_dlb;
545 }
546 
548  CollisionResult& res,
549  const FCL_REAL& distance,
550  const Vec3f& p0, const Vec3f& p1) {
551  if (distance < res.distance_lower_bound) {
552  res.distance_lower_bound = distance;
553  res.nearest_points[0] = p0;
554  res.nearest_points[1] = p1;
555  }
556 }
557 } // namespace internal
558 
560  return static_cast<CollisionRequestFlag>(~static_cast<int>(a));
561 }
562 
565  return static_cast<CollisionRequestFlag>(static_cast<int>(a) |
566  static_cast<int>(b));
567 }
568 
571  return static_cast<CollisionRequestFlag>(static_cast<int>(a) &
572  static_cast<int>(b));
573 }
574 
577  return static_cast<CollisionRequestFlag>(static_cast<int>(a) ^
578  static_cast<int>(b));
579 }
580 
583  return (CollisionRequestFlag&)((int&)(a) |= static_cast<int>(b));
584 }
585 
588  return (CollisionRequestFlag&)((int&)(a) &= static_cast<int>(b));
589 }
590 
593  return (CollisionRequestFlag&)((int&)(a) ^= static_cast<int>(b));
594 }
595 
596 } // namespace fcl
597 
598 } // namespace hpp
599 
600 #endif
hpp::fcl::operator&=
CollisionRequestFlag & operator&=(CollisionRequestFlag &a, CollisionRequestFlag b)
Definition: collision_data.h:586
hpp::fcl::CachedGuess
@ CachedGuess
Definition: data_types.h:80
hpp::fcl::Contact::operator<
bool operator<(const Contact &other) const
Definition: collision_data.h:102
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:448
data_types.h
hpp::fcl::GJKConvergenceCriterionType
GJKConvergenceCriterionType
Wether the convergence criterion is scaled on the norm of the solution or not.
Definition: data_types.h:93
Eigen
hpp::fcl::CollisionResult::addContact
void addContact(const Contact &c)
add one contact into result structure
Definition: collision_data.h:330
hpp::fcl::Vec3f
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition: data_types.h:66
hpp::fcl::operator|
CollisionRequestFlag operator|(CollisionRequestFlag a, CollisionRequestFlag b)
Definition: collision_data.h:563
hpp::fcl::internal::updateDistanceLowerBoundFromLeaf
void updateDistanceLowerBoundFromLeaf(const CollisionRequest &, CollisionResult &res, const FCL_REAL &distance, const Vec3f &p0, const Vec3f &p1)
Definition: collision_data.h:547
collision_object.h
hpp::fcl::CollisionRequest::break_distance
FCL_REAL break_distance
Distance below which bounding volumes are broken down. See Collision.
Definition: collision_data.h:255
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
#define HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
Definition: include/hpp/fcl/fwd.hh:84
hpp::fcl::DistanceResult::nearest_points
Vec3f nearest_points[2]
nearest points
Definition: collision_data.h:427
hpp::fcl::VDB
@ VDB
Definition: data_types.h:89
hpp::fcl::CollisionRequest::CollisionRequest
CollisionRequest()
Default constructor.
Definition: collision_data.h:279
hpp::fcl::QueryRequest::updateGuess
HPP_FCL_COMPILER_DIAGNOSTIC_POP void updateGuess(const QueryResult &result)
Definition: collision_data.h:210
hpp::fcl::QueryRequest::operator==
bool operator==(const QueryRequest &other) const
whether two QueryRequest are the same or not
Definition: collision_data.h:182
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:244
hpp::fcl::CollisionRequest::operator==
bool operator==(const CollisionRequest &other) const
whether two CollisionRequest are the same or not
Definition: collision_data.h:290
hpp::fcl::DefaultGJK
@ DefaultGJK
Definition: data_types.h:83
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:65
hpp::fcl::CONTACT
@ CONTACT
Definition: collision_data.h:229
hpp::fcl::GJKConvergenceCriterion
GJKConvergenceCriterion
Which convergence criterion is used to stop the algorithm (when the shapes are not in collision)....
Definition: data_types.h:89
hpp::fcl::CollisionResult::getContact
const Contact & getContact(size_t i) const
get the i-th contact calculated
Definition: collision_data.h:345
hpp::fcl::CollisionResult::numContacts
size_t numContacts() const
number of contacts found
Definition: collision_data.h:342
hpp::fcl::QueryResult
base class for all query results
Definition: collision_data.h:195
hpp::fcl::QueryResult::QueryResult
QueryResult()
Definition: collision_data.h:205
hpp::fcl::DistanceResult::o1
const CollisionGeometry * o1
collision object 1
Definition: collision_data.h:433
hpp::fcl::QueryRequest::gjk_initial_guess
GJKInitialGuess gjk_initial_guess
Definition: collision_data.h:121
hpp::fcl::distance
HPP_FCL_DLLAPI 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.
Definition: kIOS.cpp:181
hpp::fcl::operator|=
CollisionRequestFlag & operator|=(CollisionRequestFlag &a, CollisionRequestFlag b)
Definition: collision_data.h:581
hpp::fcl::CollisionGeometry
The geometry for the object for collision or distance computation.
Definition: collision_object.h:95
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:71
hpp::fcl::DistanceRequest::abs_err
FCL_REAL abs_err
Definition: collision_data.h:398
hpp::fcl::DistanceResult::clear
void clear()
clear the result
Definition: collision_data.h:504
timings.h
a
list a
distance_lower_bound
Definition: distance_lower_bound.py:1
res
res
hpp::fcl::FCL_REAL
double FCL_REAL
Definition: data_types.h:65
hpp::fcl::DistanceResult::DistanceResult
DistanceResult(FCL_REAL min_distance_=(std::numeric_limits< FCL_REAL >::max)())
Definition: collision_data.h:453
hpp::fcl::internal::updateDistanceLowerBoundFromBV
void updateDistanceLowerBoundFromBV(const CollisionRequest &, CollisionResult &res, const FCL_REAL &sqrDistLowerBound)
Definition: collision_data.h:538
hpp::fcl::QueryRequest::enable_timings
bool enable_timings
enable timings when performing collision/distance request
Definition: collision_data.h:150
hpp::fcl::DistanceResult::normal
Vec3f normal
In case both objects are in collision, store the normal.
Definition: collision_data.h:430
hpp::fcl::CollisionRequestFlag
CollisionRequestFlag
flag declaration for specifying required params in CollisionResult
Definition: collision_data.h:228
hpp::fcl::CollisionRequest::CollisionRequest
CollisionRequest(const CollisionRequestFlag flag, size_t num_max_contacts_)
Constructor from a flag and a maximal number of contacts.
Definition: collision_data.h:270
hpp::fcl::CPUTimes
Definition: timings.h:17
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:442
hpp::fcl::QueryResult::timings
CPUTimes timings
timings for the given request
Definition: collision_data.h:203
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:403
hpp::fcl::CollisionRequest::security_margin
FCL_REAL security_margin
Distance below which objects are considered in collision. See Collision.
Definition: collision_data.h:251
c
c
hpp::fcl::CollisionRequest::enable_contact
bool enable_contact
whether the contact information (normal, penetration depth and contact position) will return
Definition: collision_data.h:241
hpp::fcl::Contact::o2
const CollisionGeometry * o2
collision object 2
Definition: collision_data.h:59
hpp::fcl::support_func_guess_t
Eigen::Vector2i support_func_guess_t
Definition: data_types.h:72
hpp::fcl::CollisionResult::CollisionResult
CollisionResult()
Definition: collision_data.h:320
hpp::fcl::QueryRequest::cached_gjk_guess
Vec3f cached_gjk_guess
the gjk initial guess set by user
Definition: collision_data.h:144
hpp::fcl::Contact::normal
Vec3f normal
contact normal, pointing from o1 to o2
Definition: collision_data.h:74
HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
#define HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
Definition: include/hpp/fcl/fwd.hh:82
hpp::fcl::CollisionResult::setContact
void setContact(size_t i, const Contact &c)
set the i-th contact calculated
Definition: collision_data.h:357
hpp::fcl::CollisionResult::clear
void clear()
clear the results obtained
Definition: collision_data.h:377
hpp
Main namespace.
Definition: broadphase_bruteforce.h:44
hpp::fcl::CollisionRequest
request to the collision algorithm
Definition: collision_data.h:235
hpp::fcl::QueryResult::cached_gjk_guess
Vec3f cached_gjk_guess
stores the last GJK ray when relevant.
Definition: collision_data.h:197
hpp::fcl::CollisionResult
collision result
Definition: collision_data.h:302
octree.pos
pos
Definition: octree.py:7
hpp::fcl::CollisionResult::isCollision
bool isCollision() const
return binary collision result
Definition: collision_data.h:339
hpp::fcl::Contact::Contact
Contact()
Default constructor.
Definition: collision_data.h:86
hpp::fcl::Relative
@ Relative
Definition: data_types.h:93
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:424
hpp::fcl::Contact::operator==
bool operator==(const Contact &other) const
Definition: collision_data.h:107
octree.p1
tuple p1
Definition: octree.py:54
hpp::fcl::Contact::Contact
Contact(const CollisionGeometry *o1_, const CollisionGeometry *o2_, int b1_, int b2_)
Definition: collision_data.h:88
hpp::fcl::CollisionResult::contacts
std::vector< Contact > contacts
contact information
Definition: collision_data.h:305
hpp::fcl::QueryRequest::enable_cached_gjk_guess
bool enable_cached_gjk_guess
whether enable gjk initial guess @Deprecated Use gjk_initial_guess instead
Definition: collision_data.h:126
hpp::fcl::CollisionRequest::num_max_contacts
size_t num_max_contacts
The maximum number of contacts will return.
Definition: collision_data.h:237
generate_distance_plot.b
float b
Definition: generate_distance_plot.py:7
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:474
hpp::fcl::GJKInitialGuess
GJKInitialGuess
Initial guess to use for the GJK algorithm DefaultGuess: Vec3f(1, 0, 0) CachedGuess: previous vector ...
Definition: data_types.h:80
hpp::fcl::operator^
CollisionRequestFlag operator^(CollisionRequestFlag a, CollisionRequestFlag b)
Definition: collision_data.h:575
hpp::fcl::DistanceResult::operator==
bool operator==(const DistanceResult &other) const
whether two DistanceResult are the same or not
Definition: collision_data.h:517
hpp::fcl::QueryRequest::cached_support_func_guess
support_func_guess_t cached_support_func_guess
the support function initial guess set by user
Definition: collision_data.h:147
hpp::fcl::DistanceRequest
request to the distance computation
Definition: collision_data.h:392
hpp::fcl::operator&
CollisionRequestFlag operator&(CollisionRequestFlag a, CollisionRequestFlag b)
Definition: collision_data.h:569
hpp::fcl::DistanceRequest::rel_err
FCL_REAL rel_err
error threshold for approximate distance
Definition: collision_data.h:397
hpp::fcl::operator~
CollisionRequestFlag operator~(CollisionRequestFlag a)
Definition: collision_data.h:559
hpp::fcl::DefaultGuess
@ DefaultGuess
Definition: data_types.h:80
hpp::fcl::DistanceResult
distance result
Definition: collision_data.h:420
hpp::fcl::CollisionResult::getContacts
const std::vector< Contact > & getContacts() const
Definition: collision_data.h:374
hpp::fcl::operator^=
CollisionRequestFlag & operator^=(CollisionRequestFlag &a, CollisionRequestFlag b)
Definition: collision_data.h:591
hpp::fcl::DistanceResult::o2
const CollisionGeometry * o2
collision object 2
Definition: collision_data.h:436
HPP_FCL_COMPILER_DIAGNOSTIC_POP
#define HPP_FCL_COMPILER_DIAGNOSTIC_POP
Definition: include/hpp/fcl/fwd.hh:83
hpp::fcl::CollisionResult::operator==
bool operator==(const CollisionResult &other) const
whether two CollisionResult are the same or not
Definition: collision_data.h:333
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:462
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:263
hpp::fcl::QueryRequest
base class for all query requests
Definition: collision_data.h:119
hpp::fcl::DistanceRequest::enable_nearest_points
bool enable_nearest_points
whether to return the nearest points
Definition: collision_data.h:394
num_max_contacts
int num_max_contacts
Definition: test/collision.cpp:65
hpp::fcl::Contact::o1
const CollisionGeometry * o1
collision object 1
Definition: collision_data.h:56
hpp::fcl::CollisionResult::getContacts
void getContacts(std::vector< Contact > &contacts_) const
get all the contacts
Definition: collision_data.h:369
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:200
hpp::fcl::DistanceResult::update
void update(const DistanceResult &other_result)
add distance information into the result
Definition: collision_data.h:490
hpp::fcl::Contact::penetration_depth
FCL_REAL penetration_depth
penetration depth
Definition: collision_data.h:80
hpp::fcl::Contact::operator!=
bool operator!=(const Contact &other) const
Definition: collision_data.h:113
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:92
hpp::fcl::DISTANCE_LOWER_BOUND
@ DISTANCE_LOWER_BOUND
Definition: collision_data.h:230
hpp::fcl::DistanceRequest::operator==
bool operator==(const DistanceRequest &other) const
whether two DistanceRequest are the same or not
Definition: collision_data.h:412
hpp::fcl::Contact::pos
Vec3f pos
contact position, in world space
Definition: collision_data.h:77
hpp::fcl::GJKVariant
GJKVariant
Variant to use for the GJK algorithm.
Definition: data_types.h:83
hpp::fcl::CollisionResult::updateDistanceLowerBound
void updateDistanceLowerBound(const FCL_REAL &distance_lower_bound_)
Update the lower bound only if the distance is inferior.
Definition: collision_data.h:324
hpp::fcl::CollisionResult::distance_lower_bound
FCL_REAL distance_lower_bound
Definition: collision_data.h:312
hpp::fcl::Contact
Contact information returned by collision.
Definition: collision_data.h:54
hpp::fcl::NO_REQUEST
@ NO_REQUEST
Definition: collision_data.h:231


hpp-fcl
Author(s):
autogenerated on Fri Aug 2 2024 02:45:13