security_margin.cpp
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2022, INRIA.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage, Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #define BOOST_TEST_MODULE COAL_SECURITY_MARGIN
36 #include <boost/test/included/unit_test.hpp>
37 
38 #include <cmath>
39 #include <iostream>
40 #include "coal/distance.h"
41 #include "coal/math/transform.h"
42 #include "coal/collision.h"
43 #include "coal/collision_object.h"
47 
48 #include "utility.h"
49 
50 using namespace coal;
57 using coal::Transform3s;
58 using coal::Vec3s;
59 
60 #define MATH_SQUARED(x) (x * x)
61 
63  CollisionGeometryPtr_t b1(new coal::Box(1, 1, 1));
64  CollisionGeometryPtr_t b2(new coal::Box(1, 1, 1));
65 
66  const Transform3s tf1;
67  const Transform3s tf2_collision(Vec3s(0, 1, 1));
68  coal::Box s1(1, 1, 1);
69  coal::Box s2(1, 1, 1);
70  const double tol = 1e-8;
71 
72  AABB bv1, bv2;
73  computeBV(s1, Transform3s(), bv1);
74  computeBV(s2, Transform3s(), bv2);
75 
76  // No security margin - collision
77  {
78  CollisionRequest collisionRequest(CONTACT, 1);
79  AABB bv2_transformed;
80  computeBV(s2, tf2_collision, bv2_transformed);
81  CoalScalar sqrDistLowerBound;
82  bool res =
83  bv1.overlap(bv2_transformed, collisionRequest, sqrDistLowerBound);
84  BOOST_CHECK(res);
85  BOOST_CHECK_CLOSE(sqrDistLowerBound, 0, tol);
86  }
87 
88  // No security margin - no collision
89  {
90  CollisionRequest collisionRequest(CONTACT, 1);
91  const double distance = 0.01;
92  Transform3s tf2_no_collision(
93  Vec3s(tf2_collision.getTranslation() + Vec3s(0, 0, distance)));
94  AABB bv2_transformed;
95  computeBV(s2, tf2_no_collision, bv2_transformed);
96  CoalScalar sqrDistLowerBound;
97  bool res =
98  bv1.overlap(bv2_transformed, collisionRequest, sqrDistLowerBound);
99  BOOST_CHECK(!res);
100  BOOST_CHECK_CLOSE(sqrDistLowerBound, MATH_SQUARED(distance), tol);
101  }
102 
103  // Security margin - collision
104  {
105  CollisionRequest collisionRequest(CONTACT, 1);
106  const double distance = 0.01;
107  collisionRequest.security_margin = distance;
108  Transform3s tf2_no_collision(
109  Vec3s(tf2_collision.getTranslation() + Vec3s(0, 0, distance)));
110  AABB bv2_transformed;
111  computeBV(s2, tf2_no_collision, bv2_transformed);
112  CoalScalar sqrDistLowerBound;
113  bool res =
114  bv1.overlap(bv2_transformed, collisionRequest, sqrDistLowerBound);
115  BOOST_CHECK(res);
116  BOOST_CHECK_SMALL(sqrDistLowerBound, tol);
117  }
118 
119  // Negative security margin - collion because the two boxes are in contact
120  {
121  CollisionRequest collisionRequest(CONTACT, 1);
122  const double distance = -0.01;
123  collisionRequest.security_margin = distance;
124  const Transform3s tf2(
125  Vec3s(tf2_collision.getTranslation() + Vec3s(0, distance, distance)));
126  AABB bv2_transformed;
127  computeBV(s2, tf2, bv2_transformed);
128  CoalScalar sqrDistLowerBound;
129  bool res =
130  bv1.overlap(bv2_transformed, collisionRequest, sqrDistLowerBound);
131  BOOST_CHECK(res);
132  BOOST_CHECK_SMALL(sqrDistLowerBound, tol);
133  }
134 
135  // Negative security margin - no collision
136  {
137  CollisionRequest collisionRequest(CONTACT, 1);
138  const double distance = -0.01;
139  collisionRequest.security_margin = distance;
140  AABB bv2_transformed;
141  computeBV(s2, tf2_collision, bv2_transformed);
142  CoalScalar sqrDistLowerBound;
143  bool res =
144  bv1.overlap(bv2_transformed, collisionRequest, sqrDistLowerBound);
145  BOOST_CHECK(!res);
146  BOOST_CHECK_CLOSE(
147  sqrDistLowerBound,
148  MATH_SQUARED((std::sqrt(2) * collisionRequest.security_margin)), tol);
149  }
150 }
151 
152 BOOST_AUTO_TEST_CASE(aabb_aabb_degenerated_cases) {
153  CollisionGeometryPtr_t b1(new coal::Box(1, 1, 1));
154  CollisionGeometryPtr_t b2(new coal::Box(1, 1, 1));
155 
156  const Transform3s tf1;
157  const Transform3s tf2_collision(Vec3s(0, 0, 0));
158  coal::Box s1(1, 1, 1);
159  coal::Box s2(1, 1, 1);
160 
161  AABB bv1, bv2;
162  computeBV(s1, Transform3s(), bv1);
163  computeBV(s2, Transform3s(), bv2);
164 
165  // The two AABB are collocated
166  {
167  CollisionRequest collisionRequest(CONTACT, 1);
168  const double distance = -2.;
169  collisionRequest.security_margin = distance;
170  AABB bv2_transformed;
171  computeBV(s2, tf2_collision, bv2_transformed);
172  CoalScalar sqrDistLowerBound;
173  bool res =
174  bv1.overlap(bv2_transformed, collisionRequest, sqrDistLowerBound);
175  BOOST_CHECK(!res);
176  }
177 
178  const AABB bv3;
179  BOOST_CHECK(!bv1.overlap(bv3));
180 }
181 
182 BOOST_AUTO_TEST_CASE(sphere_sphere) {
185 
186  const Transform3s tf1;
187  const Transform3s tf2_collision(Vec3s(0, 0, 3));
188 
189  // NOTE: when comparing a result to zero, **do not use BOOST_CHECK_CLOSE**!
190  // Zero is not close to any other number, so the test will always fail.
191  // Instead, use BOOST_CHECK_SMALL.
192 
193  // No security margin - collision
194  {
195  CollisionRequest collisionRequest(CONTACT, 1);
196  CollisionResult collisionResult;
197  collide(s1.get(), tf1, s2.get(), tf2_collision, collisionRequest,
198  collisionResult);
199  BOOST_CHECK(collisionResult.isCollision());
200  BOOST_CHECK_SMALL(collisionResult.distance_lower_bound, 1e-8);
201  BOOST_CHECK_SMALL(collisionResult.getContact(0).penetration_depth, 1e-8);
202  }
203 
204  // No security margin - no collision
205  {
206  CollisionRequest collisionRequest(CONTACT, 1);
207  CollisionResult collisionResult;
208  const double distance = 0.01;
209  Transform3s tf2_no_collision(
210  Vec3s(tf2_collision.getTranslation() + Vec3s(0, 0, distance)));
211  collide(s1.get(), tf1, s2.get(), tf2_no_collision, collisionRequest,
212  collisionResult);
213  BOOST_CHECK(!collisionResult.isCollision());
214  BOOST_CHECK_CLOSE(collisionResult.distance_lower_bound, distance, 1e-8);
215  }
216 
217  // Positive security margin - collision
218  {
219  CollisionRequest collisionRequest(CONTACT, 1);
220  CollisionResult collisionResult;
221  const double distance = 0.01;
222  collisionRequest.security_margin = distance;
224  Vec3s(tf2_collision.getTranslation() + Vec3s(0, 0, distance)));
225  collide(s1.get(), tf1, s2.get(), tf2, collisionRequest, collisionResult);
226  BOOST_CHECK(collisionResult.isCollision());
227  BOOST_CHECK_SMALL(collisionResult.distance_lower_bound, 1e-8);
228  BOOST_CHECK_CLOSE(collisionResult.getContact(0).penetration_depth, distance,
229  1e-8);
230  }
231 
232  // Negative security margin - collion because the two spheres are in contact
233  {
234  CollisionRequest collisionRequest(CONTACT, 1);
235  CollisionResult collisionResult;
236  const double distance = -0.01;
237  collisionRequest.security_margin = distance;
239  Vec3s(tf2_collision.getTranslation() + Vec3s(0, 0, distance)));
240  collide(s1.get(), tf1, s2.get(), tf2, collisionRequest, collisionResult);
241  BOOST_CHECK(collisionResult.isCollision());
242  BOOST_CHECK_SMALL(collisionResult.distance_lower_bound, 1e-8);
243  BOOST_CHECK_CLOSE(collisionResult.getContact(0).penetration_depth, distance,
244  1e-8);
245  }
246 
247  // Negative security margin - no collision
248  {
249  CollisionRequest collisionRequest(CONTACT, 1);
250  CollisionResult collisionResult;
251  collisionRequest.security_margin = -0.01;
252  collide(s1.get(), tf1, s2.get(), tf2_collision, collisionRequest,
253  collisionResult);
254  BOOST_CHECK(!collisionResult.isCollision());
255  BOOST_CHECK_CLOSE(collisionResult.distance_lower_bound,
256  -collisionRequest.security_margin, 1e-8);
257  }
258 }
259 
260 BOOST_AUTO_TEST_CASE(capsule_capsule) {
261  CollisionGeometryPtr_t c1(new coal::Capsule(0.5, 1.));
263 
264  const Transform3s tf1;
265  const Transform3s tf2_collision(Vec3s(0, 1., 0));
266 
267  // No security margin - collision
268  {
269  CollisionRequest collisionRequest(CONTACT, 1);
270  CollisionResult collisionResult;
271  collide(c1.get(), tf1, c2.get(), tf2_collision, collisionRequest,
272  collisionResult);
273  BOOST_CHECK(collisionResult.isCollision());
274  BOOST_CHECK_SMALL(collisionResult.distance_lower_bound, 1e-8);
275  BOOST_CHECK_SMALL(collisionResult.getContact(0).penetration_depth, 1e-8);
276  }
277 
278  // No security margin - no collision
279  {
280  CollisionRequest collisionRequest(CONTACT, 1);
281  CollisionResult collisionResult;
282  const double distance = 0.01;
283  Transform3s tf2_no_collision(
284  Vec3s(tf2_collision.getTranslation() + Vec3s(0, distance, 0)));
285  collide(c1.get(), tf1, c2.get(), tf2_no_collision, collisionRequest,
286  collisionResult);
287  BOOST_CHECK(!collisionResult.isCollision());
288  BOOST_CHECK_CLOSE(collisionResult.distance_lower_bound, distance, 1e-8);
289  }
290 
291  // Positive security margin - collision
292  {
293  CollisionRequest collisionRequest(CONTACT, 1);
294  CollisionResult collisionResult;
295  const double distance = 0.01;
296  collisionRequest.security_margin = distance;
297  Transform3s tf2_no_collision(
298  Vec3s(tf2_collision.getTranslation() + Vec3s(0, distance, 0)));
299  collide(c1.get(), tf1, c2.get(), tf2_no_collision, collisionRequest,
300  collisionResult);
301  BOOST_CHECK(collisionResult.isCollision());
302  BOOST_CHECK_SMALL(collisionResult.distance_lower_bound, 1e-8);
303  BOOST_CHECK_CLOSE(collisionResult.getContact(0).penetration_depth, distance,
304  1e-8);
305  }
306 
307  // Negative security margin - collion because the two capsules are in contact
308  {
309  CollisionRequest collisionRequest(CONTACT, 1);
310  CollisionResult collisionResult;
311  const double distance = -0.01;
312  collisionRequest.security_margin = distance;
314  Vec3s(tf2_collision.getTranslation() + Vec3s(0, distance, 0)));
315  collide(c1.get(), tf1, c2.get(), tf2, collisionRequest, collisionResult);
316  BOOST_CHECK(collisionResult.isCollision());
317  BOOST_CHECK_SMALL(collisionResult.distance_lower_bound, 1e-8);
318  BOOST_CHECK_CLOSE(collisionResult.getContact(0).penetration_depth, distance,
319  1e-8);
320  }
321 
322  // Negative security margin - no collision
323  {
324  CollisionRequest collisionRequest(CONTACT, 1);
325  CollisionResult collisionResult;
326  collisionRequest.security_margin = -0.01;
327  collide(c1.get(), tf1, c2.get(), tf2_collision, collisionRequest,
328  collisionResult);
329  BOOST_CHECK(!collisionResult.isCollision());
330  BOOST_CHECK_CLOSE(collisionResult.distance_lower_bound, 0.01, 1e-8);
331  }
332 }
333 
335  CollisionGeometryPtr_t b1(new coal::Box(1, 1, 1));
336  CollisionGeometryPtr_t b2(new coal::Box(1, 1, 1));
337 
338  const Transform3s tf1;
339  const Transform3s tf2_collision(Vec3s(0, 1, 1));
340 
341  const double tol = 1e-3;
342 
343  // No security margin - collision
344  {
345  CollisionRequest collisionRequest(CONTACT, 1);
346  CollisionResult collisionResult;
347  collide(b1.get(), tf1, b2.get(), tf2_collision, collisionRequest,
348  collisionResult);
349  BOOST_CHECK(collisionResult.isCollision());
350  BOOST_CHECK_SMALL(collisionResult.distance_lower_bound, tol);
351  BOOST_CHECK_SMALL(collisionResult.getContact(0).penetration_depth, 1e-8);
352  }
353 
354  // No security margin - no collision
355  {
356  CollisionRequest collisionRequest(CONTACT, 1);
357  const double distance = 0.01;
358  const Transform3s tf2_no_collision(
359  (tf2_collision.getTranslation() + Vec3s(0, 0, distance)).eval());
360 
361  CollisionResult collisionResult;
362  collide(b1.get(), tf1, b2.get(), tf2_no_collision, collisionRequest,
363  collisionResult);
364  BOOST_CHECK(!collisionResult.isCollision());
365  BOOST_CHECK_CLOSE(collisionResult.distance_lower_bound, distance, tol);
366  }
367 
368  // Positive security margin - collision
369  {
370  CollisionRequest collisionRequest(CONTACT, 1);
371  const double distance = 0.01;
372  collisionRequest.security_margin = distance;
373  CollisionResult collisionResult;
374  collide(b1.get(), tf1, b2.get(), tf2_collision, collisionRequest,
375  collisionResult);
376  BOOST_CHECK(collisionResult.isCollision());
377  BOOST_CHECK_CLOSE(collisionResult.distance_lower_bound,
378  -collisionRequest.security_margin, tol);
379  BOOST_CHECK_SMALL(collisionResult.getContact(0).penetration_depth, 1e-8);
380  }
381 
382  // Negative security margin - no collision
383  {
384  CollisionRequest collisionRequest(CONTACT, 1);
385  collisionRequest.security_margin = -0.01;
386  CollisionResult collisionResult;
387  collide(b1.get(), tf1, b2.get(), tf2_collision, collisionRequest,
388  collisionResult);
389  BOOST_CHECK(!collisionResult.isCollision());
390  BOOST_CHECK_CLOSE(collisionResult.distance_lower_bound,
391  -collisionRequest.security_margin, tol);
392  }
393 
394  // Negative security margin - collision
395  {
396  CollisionRequest collisionRequest(CONTACT, 1);
397  const CoalScalar distance = -0.01;
398  collisionRequest.security_margin = distance;
399  CollisionResult collisionResult;
400 
401  const Transform3s tf2((tf2_collision.getTranslation() +
402  Vec3s(0, collisionRequest.security_margin,
403  collisionRequest.security_margin))
404  .eval());
405  collide(b1.get(), tf1, b2.get(), tf2, collisionRequest, collisionResult);
406  BOOST_CHECK(collisionResult.isCollision());
407  BOOST_CHECK_SMALL(collisionResult.distance_lower_bound, tol);
408  BOOST_CHECK_CLOSE(collisionResult.getContact(0).penetration_depth, distance,
409  tol);
410  }
411 }
412 
413 template <typename ShapeType1, typename ShapeType2>
414 void test_shape_shape(const ShapeType1& shape1, const Transform3s& tf1,
415  const ShapeType2& shape2,
416  const Transform3s& tf2_collision, const CoalScalar tol) {
417  // No security margin - collision
418  {
419  CollisionRequest collisionRequest(CONTACT, 1);
420  CollisionResult collisionResult;
421  collide(&shape1, tf1, &shape2, tf2_collision, collisionRequest,
422  collisionResult);
423  BOOST_CHECK(collisionResult.isCollision());
424  BOOST_CHECK_SMALL(collisionResult.distance_lower_bound, tol);
425  BOOST_CHECK_SMALL(collisionResult.getContact(0).penetration_depth, 1e-8);
426  }
427 
428  // No security margin - no collision
429  {
430  CollisionRequest collisionRequest(CONTACT, 1);
431  const double distance = 0.01;
432  const Transform3s tf2_no_collision(
433  (tf2_collision.getTranslation() + Vec3s(0, 0, distance)).eval());
434 
435  CollisionResult collisionResult;
436  collide(&shape1, tf1, &shape2, tf2_no_collision, collisionRequest,
437  collisionResult);
438  BOOST_CHECK(!collisionResult.isCollision());
439  BOOST_CHECK_CLOSE(collisionResult.distance_lower_bound, distance, tol);
440  }
441 
442  // Positive security margin - collision
443  {
444  CollisionRequest collisionRequest(CONTACT, 1);
445  const double distance = 0.01;
446  collisionRequest.security_margin = distance;
447  CollisionResult collisionResult;
448  collide(&shape1, tf1, &shape2, tf2_collision, collisionRequest,
449  collisionResult);
450  BOOST_CHECK(collisionResult.isCollision());
451  BOOST_CHECK_CLOSE(collisionResult.distance_lower_bound,
452  -collisionRequest.security_margin, tol);
453  BOOST_CHECK_SMALL(collisionResult.getContact(0).penetration_depth, 1e-8);
454  }
455 
456  // Negative security margin - no collision
457  {
458  CollisionRequest collisionRequest(CONTACT, 1);
459  collisionRequest.security_margin = -0.01;
460  CollisionResult collisionResult;
461  collide(&shape1, tf1, &shape2, tf2_collision, collisionRequest,
462  collisionResult);
463  BOOST_CHECK(!collisionResult.isCollision());
464  BOOST_CHECK_CLOSE(
465  collisionResult.distance_lower_bound,
466  (collisionRequest.security_margin * tf2_collision.getTranslation())
467  .norm(),
468  tol);
469  }
470 
471  // Negative security margin - collision
472  {
473  CollisionRequest collisionRequest(CONTACT, 1);
474  const CoalScalar distance = -0.01;
475  collisionRequest.security_margin = distance;
476  CollisionResult collisionResult;
477 
478  const Transform3s tf2((tf2_collision.getTranslation() +
479  Vec3s(0, collisionRequest.security_margin,
480  collisionRequest.security_margin))
481  .eval());
482  collide(&shape1, tf1, &shape2, tf2, collisionRequest, collisionResult);
483  BOOST_CHECK(collisionResult.isCollision());
484  BOOST_CHECK_SMALL(collisionResult.distance_lower_bound, tol);
485  BOOST_CHECK_CLOSE(collisionResult.getContact(0).penetration_depth, distance,
486  tol);
487  }
488 }
489 
490 BOOST_AUTO_TEST_CASE(sphere_box) {
491  Box* box_ptr = new coal::Box(1, 1, 1);
492  CollisionGeometryPtr_t b1(box_ptr);
493  BVHModel<OBBRSS> box_bvh_model = BVHModel<OBBRSS>();
494  generateBVHModel(box_bvh_model, *box_ptr, Transform3s());
495  box_bvh_model.buildConvexRepresentation(false);
496  ConvexBase& box_convex = *box_bvh_model.convex.get();
498 
499  const Transform3s tf1;
500  const Transform3s tf2_collision(Vec3s(0, 0, 1));
501 
502  const double tol = 1e-6;
503 
504  test_shape_shape(*b1.get(), tf1, *s2.get(), tf2_collision, tol);
505  test_shape_shape(box_convex, tf1, *s2.get(), tf2_collision, tol);
506 }
collision.h
coal::CONTACT
@ CONTACT
Definition: coal/collision_data.h:305
coal::Vec3s
Eigen::Matrix< CoalScalar, 3, 1 > Vec3s
Definition: coal/data_types.h:77
coal::BVHModelBase::buildConvexRepresentation
void buildConvexRepresentation(bool share_memory)
Build this Convex<Triangle> representation of this model. The result is stored in attribute convex.
Definition: BVH_model.cpp:128
coal::CollisionResult::isCollision
bool isCollision() const
return binary collision result
Definition: coal/collision_data.h:443
gjk.tf1
tuple tf1
Definition: test/scripts/gjk.py:27
coal::CollisionRequest::security_margin
CoalScalar security_margin
Distance below which objects are considered in collision. See Collision.
Definition: coal/collision_data.h:328
coal::Capsule
Capsule It is where is the distance between the point x and the capsule segment AB,...
Definition: coal/shape/geometric_shapes.h:383
coal
Main namespace.
Definition: coal/broadphase/broadphase_bruteforce.h:44
utility.h
coal::distance
COAL_DLLAPI CoalScalar distance(const Matrix3s &R0, const Vec3s &T0, const kIOS &b1, const kIOS &b2, Vec3s *P=NULL, Vec3s *Q=NULL)
Approximate distance between two kIOS bounding volumes.
Definition: kIOS.cpp:180
collision_object.h
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(aabb_aabb)
Definition: security_margin.cpp:62
coal::Contact::penetration_depth
CoalScalar penetration_depth
penetration depth
Definition: coal/collision_data.h:105
coal::AABB
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
Definition: coal/BV/AABB.h:55
coal::CollisionResult::distance_lower_bound
CoalScalar distance_lower_bound
Definition: coal/collision_data.h:401
coal::Box
Center at zero point, axis aligned box.
Definition: coal/shape/geometric_shapes.h:166
coal::Sphere
Center at zero point sphere.
Definition: coal/shape/geometric_shapes.h:240
coal::Transform3s
Simple transform class used locally by InterpMotion.
Definition: coal/math/transform.h:55
res
res
transform.h
coal::AABB::overlap
bool overlap(const AABB &other) const
Check whether two AABB are overlap.
Definition: coal/BV/AABB.h:111
coal::DistanceRequest
request to the distance computation
Definition: coal/collision_data.h:985
test_shape_shape
void test_shape_shape(const ShapeType1 &shape1, const Transform3s &tf1, const ShapeType2 &shape2, const Transform3s &tf2_collision, const CoalScalar tol)
Definition: security_margin.cpp:414
MATH_SQUARED
#define MATH_SQUARED(x)
Definition: security_margin.cpp:60
coal::BVHModelBase::convex
shared_ptr< ConvexBase > convex
Convex<Triangle> representation of this object.
Definition: coal/BVH/BVH_model.h:86
coal::CollisionResult
collision result
Definition: coal/collision_data.h:390
coal::CollisionRequest
request to the collision algorithm
Definition: coal/collision_data.h:311
distance.h
coal::DistanceResult
distance result
Definition: coal/collision_data.h:1051
coal::CollisionObject
the object for collision or distance computation, contains the geometry and the transform information
Definition: coal/collision_object.h:214
gjk.tf2
tuple tf2
Definition: test/scripts/gjk.py:36
coal::BVHModel
A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as ...
Definition: coal/BVH/BVH_model.h:314
geometric_shapes_utility.h
geometric_shapes.h
coal::CollisionResult::getContact
const Contact & getContact(size_t i) const
get the i-th contact calculated
Definition: coal/collision_data.h:449
coal::computeBV
void computeBV(const S &s, const Transform3s &tf, BV &bv)
calculate a bounding volume for a shape in a specific configuration
Definition: coal/shape/geometric_shapes_utility.h:73
geometric_shape_to_BVH_model.h
coal::collide
COAL_DLLAPI std::size_t collide(const CollisionObject *o1, const CollisionObject *o2, const CollisionRequest &request, CollisionResult &result)
Main collision interface: given two collision objects, and the requirements for contacts,...
Definition: src/collision.cpp:61
c2
c2
coal::CoalScalar
double CoalScalar
Definition: coal/data_types.h:76
coal::generateBVHModel
void generateBVHModel(BVHModel< BV > &model, const Box &shape, const Transform3s &pose)
Generate BVH model from box.
Definition: coal/shape/geometric_shape_to_BVH_model.h:49
coal::CollisionGeometryPtr_t
shared_ptr< CollisionGeometry > CollisionGeometryPtr_t
Definition: include/coal/fwd.hh:134
coal::ConvexBase
Base for convex polytope.
Definition: coal/shape/geometric_shapes.h:645
coal::Transform3s::getTranslation
const Vec3s & getTranslation() const
get translation
Definition: coal/math/transform.h:101


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:59