broadphase_collision_1.cpp
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-2016, Open Source Robotics Foundation
6  * Copyright (c) 2022, INRIA
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of Open Source Robotics Foundation nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  */
38 #define BOOST_TEST_MODULE COAL_BROADPHASE_COLLISION_1
39 #include <boost/test/included/unit_test.hpp>
40 
51 #include "utility.h"
52 
53 #include <boost/math/constants/constants.hpp>
54 
55 #if USE_GOOGLEHASH
56 #include <sparsehash/sparse_hash_map>
57 #include <sparsehash/dense_hash_map>
58 #include <hash_map>
59 #endif
60 
61 #include <iostream>
62 #include <iomanip>
63 
64 using namespace coal;
65 
69  std::size_t env_size,
70  bool verbose = false);
71 
74  std::size_t env_size,
75  std::size_t query_size,
76  std::size_t num_max_contacts = 1,
77  bool exhaustive = false,
78  bool use_mesh = false);
79 
80 #if USE_GOOGLEHASH
81 template <typename U, typename V>
82 struct GoogleSparseHashTable
83  : public google::sparse_hash_map<U, V, std::tr1::hash<size_t>,
84  std::equal_to<size_t>> {};
85 
86 template <typename U, typename V>
87 struct GoogleDenseHashTable
88  : public google::dense_hash_map<U, V, std::tr1::hash<size_t>,
89  std::equal_to<size_t>> {
90  GoogleDenseHashTable()
91  : google::dense_hash_map<U, V, std::tr1::hash<size_t>,
92  std::equal_to<size_t>>() {
93  this->set_empty_key(nullptr);
94  }
95 };
96 #endif
97 
100 BOOST_AUTO_TEST_CASE(test_broad_phase_dont_duplicate_check) {
101 #ifdef NDEBUG
103 #else
105 #endif
106 }
107 
109 BOOST_AUTO_TEST_CASE(test_core_bf_broad_phase_update_collision_binary) {
110 #ifdef NDEBUG
111  broad_phase_update_collision_test(2000, 100, 1000, 1, false);
112  broad_phase_update_collision_test(2000, 1000, 1000, 1, false);
113 #else
114  broad_phase_update_collision_test(2000, 10, 100, 1, false);
115  broad_phase_update_collision_test(2000, 100, 100, 1, false);
116 #endif
117 }
118 
120 BOOST_AUTO_TEST_CASE(test_core_bf_broad_phase_update_collision) {
121 #ifdef NDEBUG
122  broad_phase_update_collision_test(2000, 100, 1000, 10, false);
123  broad_phase_update_collision_test(2000, 1000, 1000, 10, false);
124 #else
125  broad_phase_update_collision_test(2000, 10, 100, 10, false);
126  broad_phase_update_collision_test(2000, 100, 100, 10, false);
127 #endif
128 }
129 
131 BOOST_AUTO_TEST_CASE(test_core_bf_broad_phase_update_collision_exhaustive) {
132 #ifdef NDEBUG
133  broad_phase_update_collision_test(2000, 100, 1000, 1, true);
134  broad_phase_update_collision_test(2000, 1000, 1000, 1, true);
135 #else
136  broad_phase_update_collision_test(2000, 10, 100, 1, true);
137  broad_phase_update_collision_test(2000, 100, 100, 1, true);
138 #endif
139 }
140 
143  test_core_mesh_bf_broad_phase_update_collision_mesh_binary) {
144 #ifdef NDEBUG
145  broad_phase_update_collision_test(2000, 100, 1000, 1, false, true);
146  broad_phase_update_collision_test(2000, 1000, 1000, 1, false, true);
147 #else
148  broad_phase_update_collision_test(2000, 2, 4, 1, false, true);
149  broad_phase_update_collision_test(2000, 4, 4, 1, false, true);
150 #endif
151 }
152 
154 BOOST_AUTO_TEST_CASE(test_core_mesh_bf_broad_phase_update_collision_mesh) {
155 #ifdef NDEBUG
156  broad_phase_update_collision_test(2000, 100, 1000, 10, false, true);
157  broad_phase_update_collision_test(2000, 1000, 1000, 10, false, true);
158 #else
159  broad_phase_update_collision_test(200, 2, 4, 10, false, true);
160  broad_phase_update_collision_test(200, 4, 4, 10, false, true);
161 #endif
162 }
163 
166  test_core_mesh_bf_broad_phase_update_collision_mesh_exhaustive) {
167 #ifdef NDEBUG
168  broad_phase_update_collision_test(2000, 100, 1000, 1, true, true);
169  broad_phase_update_collision_test(2000, 1000, 1000, 1, true, true);
170 #else
171  broad_phase_update_collision_test(2000, 2, 4, 1, true, true);
172  broad_phase_update_collision_test(2000, 4, 4, 1, true, true);
173 #endif
174 }
175 
176 //==============================================================================
178  std::set<std::pair<CollisionObject*, CollisionObject*>> checkedPairs;
179 
181  auto search = checkedPairs.find(std::make_pair(o1, o2));
182 
183  if (search != checkedPairs.end()) return false;
184 
185  checkedPairs.emplace(o1, o2);
186 
187  return true;
188  }
189 };
190 
191 //==============================================================================
194  BOOST_CHECK(data.checkUniquenessAndAddPair(o1, o2));
195  return false;
196  }
197 
199 };
200 
201 //==============================================================================
203  std::size_t env_size, bool verbose) {
204  std::vector<TStruct> ts;
205  std::vector<BenchTimer> timers;
206 
207  std::vector<CollisionObject*> env;
208  generateEnvironments(env, env_scale, env_size);
209 
210  std::vector<BroadPhaseCollisionManager*> managers;
211  managers.push_back(new NaiveCollisionManager());
212  managers.push_back(new SSaPCollisionManager());
213  managers.push_back(new SaPCollisionManager());
214  managers.push_back(new IntervalTreeCollisionManager());
215  Vec3s lower_limit, upper_limit;
216  SpatialHashingCollisionManager<>::computeBound(env, lower_limit, upper_limit);
217  CoalScalar cell_size =
218  std::min(std::min((upper_limit[0] - lower_limit[0]) / 20,
219  (upper_limit[1] - lower_limit[1]) / 20),
220  (upper_limit[2] - lower_limit[2]) / 20);
221  managers.push_back(
224  cell_size, lower_limit, upper_limit));
225 #if USE_GOOGLEHASH
226  managers.push_back(
228  AABB, CollisionObject*, detail::SpatialHash, GoogleSparseHashTable>>(
229  cell_size, lower_limit, upper_limit));
230  managers.push_back(
232  AABB, CollisionObject*, detail::SpatialHash, GoogleDenseHashTable>>(
233  cell_size, lower_limit, upper_limit));
234 #endif
235  managers.push_back(new DynamicAABBTreeCollisionManager());
236  managers.push_back(new DynamicAABBTreeArrayCollisionManager());
237 
238  {
240  m->tree_init_level = 2;
241  managers.push_back(m);
242  }
243 
244  {
247  m->tree_init_level = 2;
248  managers.push_back(m);
249  }
250 
251  ts.resize(managers.size());
252  timers.resize(managers.size());
253 
254  for (size_t i = 0; i < managers.size(); ++i) {
255  timers[i].start();
256  managers[i]->registerObjects(env);
257  timers[i].stop();
258  ts[i].push_back(timers[i].getElapsedTime());
259  }
260 
261  for (size_t i = 0; i < managers.size(); ++i) {
262  timers[i].start();
263  managers[i]->setup();
264  timers[i].stop();
265  ts[i].push_back(timers[i].getElapsedTime());
266  }
267 
268  // update the environment
269  CoalScalar delta_angle_max =
270  10 / 360.0 * 2 * boost::math::constants::pi<CoalScalar>();
271  CoalScalar delta_trans_max = 0.01 * env_scale;
272  for (size_t i = 0; i < env.size(); ++i) {
273  CoalScalar rand_angle_x =
274  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_angle_max;
275  CoalScalar rand_trans_x =
276  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_trans_max;
277  CoalScalar rand_angle_y =
278  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_angle_max;
279  CoalScalar rand_trans_y =
280  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_trans_max;
281  CoalScalar rand_angle_z =
282  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_angle_max;
283  CoalScalar rand_trans_z =
284  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_trans_max;
285 
286  Matrix3s dR(Eigen::AngleAxisd(rand_angle_x, Vec3s::UnitX()) *
287  Eigen::AngleAxisd(rand_angle_y, Vec3s::UnitY()) *
288  Eigen::AngleAxisd(rand_angle_z, Vec3s::UnitZ()));
289  Vec3s dT(rand_trans_x, rand_trans_y, rand_trans_z);
290 
291  Matrix3s R = env[i]->getRotation();
292  Vec3s T = env[i]->getTranslation();
293  env[i]->setTransform(dR * R, dR * T + dT);
294  env[i]->computeAABB();
295  }
296 
297  for (size_t i = 0; i < managers.size(); ++i) {
298  timers[i].start();
299  managers[i]->update();
300  timers[i].stop();
301  ts[i].push_back(timers[i].getElapsedTime());
302  }
303 
304  std::vector<CollisionDataForUniquenessChecking> self_data(managers.size());
305 
306  for (size_t i = 0; i < managers.size(); ++i) {
308  timers[i].start();
309  managers[i]->collide(&callback);
310  timers[i].stop();
311  ts[i].push_back(timers[i].getElapsedTime());
312  }
313 
314  for (auto obj : env) delete obj;
315 
316  if (!verbose) return;
317 
318  std::cout.setf(std::ios_base::left, std::ios_base::adjustfield);
319  int w = 7;
320 
321  std::cout << "collision timing summary" << std::endl;
322  std::cout << env_size << " objs" << std::endl;
323  std::cout << "register time" << std::endl;
324  for (size_t i = 0; i < ts.size(); ++i)
325  std::cout << std::setw(w) << ts[i].records[0] << " ";
326  std::cout << std::endl;
327 
328  std::cout << "setup time" << std::endl;
329  for (size_t i = 0; i < ts.size(); ++i)
330  std::cout << std::setw(w) << ts[i].records[1] << " ";
331  std::cout << std::endl;
332 
333  std::cout << "update time" << std::endl;
334  for (size_t i = 0; i < ts.size(); ++i)
335  std::cout << std::setw(w) << ts[i].records[2] << " ";
336  std::cout << std::endl;
337 
338  std::cout << "self collision time" << std::endl;
339  for (size_t i = 0; i < ts.size(); ++i)
340  std::cout << std::setw(w) << ts[i].records[3] << " ";
341  std::cout << std::endl;
342 
343  std::cout << "collision time" << std::endl;
344  for (size_t i = 0; i < ts.size(); ++i) {
345  CoalScalar tmp = 0;
346  for (size_t j = 4; j < ts[i].records.size(); ++j) tmp += ts[i].records[j];
347  std::cout << std::setw(w) << tmp << " ";
348  }
349  std::cout << std::endl;
350 
351  std::cout << "overall time" << std::endl;
352  for (size_t i = 0; i < ts.size(); ++i)
353  std::cout << std::setw(w) << ts[i].overall_time << " ";
354  std::cout << std::endl;
355  std::cout << std::endl;
356 }
357 
359  std::size_t env_size,
360  std::size_t query_size,
361  std::size_t num_max_contacts,
362  bool exhaustive, bool use_mesh) {
363  std::vector<TStruct> ts;
364  std::vector<BenchTimer> timers;
365 
366  std::vector<CollisionObject*> env;
367  if (use_mesh)
368  generateEnvironmentsMesh(env, env_scale, env_size);
369  else
370  generateEnvironments(env, env_scale, env_size);
371 
372  std::vector<CollisionObject*> query;
373  if (use_mesh)
374  generateEnvironmentsMesh(query, env_scale, query_size);
375  else
376  generateEnvironments(query, env_scale, query_size);
377 
378  std::vector<BroadPhaseCollisionManager*> managers;
379 
380  managers.push_back(new NaiveCollisionManager());
381  managers.push_back(new SSaPCollisionManager());
382 
383  managers.push_back(new SaPCollisionManager());
384  managers.push_back(new IntervalTreeCollisionManager());
385 
386  Vec3s lower_limit, upper_limit;
387  SpatialHashingCollisionManager<>::computeBound(env, lower_limit, upper_limit);
388  CoalScalar cell_size =
389  std::min(std::min((upper_limit[0] - lower_limit[0]) / 20,
390  (upper_limit[1] - lower_limit[1]) / 20),
391  (upper_limit[2] - lower_limit[2]) / 20);
392  // managers.push_back(new SpatialHashingCollisionManager(cell_size,
393  // lower_limit, upper_limit));
394  managers.push_back(
397  cell_size, lower_limit, upper_limit));
398 #if USE_GOOGLEHASH
399  managers.push_back(
401  AABB, CollisionObject*, detail::SpatialHash, GoogleSparseHashTable>>(
402  cell_size, lower_limit, upper_limit));
403  managers.push_back(
405  AABB, CollisionObject*, detail::SpatialHash, GoogleDenseHashTable>>(
406  cell_size, lower_limit, upper_limit));
407 #endif
408  managers.push_back(new DynamicAABBTreeCollisionManager());
409  managers.push_back(new DynamicAABBTreeArrayCollisionManager());
410 
411  {
413  m->tree_init_level = 2;
414  managers.push_back(m);
415  }
416 
417  {
420  m->tree_init_level = 2;
421  managers.push_back(m);
422  }
423 
424  ts.resize(managers.size());
425  timers.resize(managers.size());
426 
427  for (size_t i = 0; i < managers.size(); ++i) {
428  timers[i].start();
429  managers[i]->registerObjects(env);
430  timers[i].stop();
431  ts[i].push_back(timers[i].getElapsedTime());
432  }
433 
434  for (size_t i = 0; i < managers.size(); ++i) {
435  timers[i].start();
436  managers[i]->setup();
437  timers[i].stop();
438  ts[i].push_back(timers[i].getElapsedTime());
439  }
440 
441  // update the environment
442  CoalScalar delta_angle_max =
443  10 / 360.0 * 2 * boost::math::constants::pi<CoalScalar>();
444  CoalScalar delta_trans_max = 0.01 * env_scale;
445  for (size_t i = 0; i < env.size(); ++i) {
446  CoalScalar rand_angle_x =
447  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_angle_max;
448  CoalScalar rand_trans_x =
449  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_trans_max;
450  CoalScalar rand_angle_y =
451  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_angle_max;
452  CoalScalar rand_trans_y =
453  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_trans_max;
454  CoalScalar rand_angle_z =
455  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_angle_max;
456  CoalScalar rand_trans_z =
457  2 * (rand() / (CoalScalar)RAND_MAX - 0.5) * delta_trans_max;
458 
459  Matrix3s dR(Eigen::AngleAxisd(rand_angle_x, Vec3s::UnitX()) *
460  Eigen::AngleAxisd(rand_angle_y, Vec3s::UnitY()) *
461  Eigen::AngleAxisd(rand_angle_z, Vec3s::UnitZ()));
462  Vec3s dT(rand_trans_x, rand_trans_y, rand_trans_z);
463 
464  Matrix3s R = env[i]->getRotation();
465  Vec3s T = env[i]->getTranslation();
466  env[i]->setTransform(dR * R, dR * T + dT);
467  env[i]->computeAABB();
468  }
469 
470  for (size_t i = 0; i < managers.size(); ++i) {
471  timers[i].start();
472  managers[i]->update();
473  timers[i].stop();
474  ts[i].push_back(timers[i].getElapsedTime());
475  }
476 
477  std::vector<CollisionData> self_data(managers.size());
478  for (size_t i = 0; i < managers.size(); ++i) {
479  if (exhaustive)
480  self_data[i].request.num_max_contacts = 100000;
481  else
482  self_data[i].request.num_max_contacts = num_max_contacts;
483  }
484 
485  for (size_t i = 0; i < managers.size(); ++i) {
487  timers[i].start();
488  managers[i]->collide(&callback);
489  timers[i].stop();
490  ts[i].push_back(timers[i].getElapsedTime());
491  }
492 
493  for (size_t i = 0; i < managers.size(); ++i)
494  std::cout << self_data[i].result.numContacts() << " ";
495  std::cout << std::endl;
496 
497  if (exhaustive) {
498  for (size_t i = 1; i < managers.size(); ++i)
499  BOOST_CHECK(self_data[i].result.numContacts() ==
500  self_data[0].result.numContacts());
501  } else {
502  std::vector<bool> self_res(managers.size());
503  for (size_t i = 0; i < self_res.size(); ++i)
504  self_res[i] = (self_data[i].result.numContacts() > 0);
505 
506  for (size_t i = 1; i < self_res.size(); ++i)
507  BOOST_CHECK(self_res[0] == self_res[i]);
508 
509  for (size_t i = 1; i < managers.size(); ++i)
510  BOOST_CHECK(self_data[i].result.numContacts() ==
511  self_data[0].result.numContacts());
512  }
513 
514  for (size_t i = 0; i < query.size(); ++i) {
515  std::vector<CollisionCallBackDefault> query_callbacks(managers.size());
516 
517  for (size_t j = 0; j < query_callbacks.size(); ++j) {
518  if (exhaustive)
519  query_callbacks[j].data.request.num_max_contacts = 100000;
520  else
521  query_callbacks[j].data.request.num_max_contacts = num_max_contacts;
522  }
523 
524  for (size_t j = 0; j < query_callbacks.size(); ++j) {
525  timers[j].start();
526  managers[j]->collide(query[i], &query_callbacks[j]);
527  timers[j].stop();
528  ts[j].push_back(timers[j].getElapsedTime());
529  }
530 
531  // for(size_t j = 0; j < managers.size(); ++j)
532  // std::cout << query_callbacks[j].result.numContacts() << " ";
533  // std::cout << std::endl;
534 
535  if (exhaustive) {
536  for (size_t j = 1; j < managers.size(); ++j)
537  BOOST_CHECK(query_callbacks[j].data.result.numContacts() ==
538  query_callbacks[0].data.result.numContacts());
539  } else {
540  std::vector<bool> query_res(managers.size());
541  for (size_t j = 0; j < query_res.size(); ++j)
542  query_res[j] = (query_callbacks[j].data.result.numContacts() > 0);
543  for (size_t j = 1; j < query_res.size(); ++j)
544  BOOST_CHECK(query_res[0] == query_res[j]);
545 
546  for (size_t j = 1; j < managers.size(); ++j)
547  BOOST_CHECK(query_callbacks[j].data.result.numContacts() ==
548  query_callbacks[0].data.result.numContacts());
549  }
550  }
551 
552  for (size_t i = 0; i < env.size(); ++i) delete env[i];
553  for (size_t i = 0; i < query.size(); ++i) delete query[i];
554 
555  for (size_t i = 0; i < managers.size(); ++i) delete managers[i];
556 
557  std::cout.setf(std::ios_base::left, std::ios_base::adjustfield);
558  int w = 7;
559 
560  std::cout << "collision timing summary" << std::endl;
561  std::cout << env_size << " objs, " << query_size << " queries" << std::endl;
562  std::cout << "register time" << std::endl;
563  for (size_t i = 0; i < ts.size(); ++i)
564  std::cout << std::setw(w) << ts[i].records[0] << " ";
565  std::cout << std::endl;
566 
567  std::cout << "setup time" << std::endl;
568  for (size_t i = 0; i < ts.size(); ++i)
569  std::cout << std::setw(w) << ts[i].records[1] << " ";
570  std::cout << std::endl;
571 
572  std::cout << "update time" << std::endl;
573  for (size_t i = 0; i < ts.size(); ++i)
574  std::cout << std::setw(w) << ts[i].records[2] << " ";
575  std::cout << std::endl;
576 
577  std::cout << "self collision time" << std::endl;
578  for (size_t i = 0; i < ts.size(); ++i)
579  std::cout << std::setw(w) << ts[i].records[3] << " ";
580  std::cout << std::endl;
581 
582  std::cout << "collision time" << std::endl;
583  for (size_t i = 0; i < ts.size(); ++i) {
584  CoalScalar tmp = 0;
585  for (size_t j = 4; j < ts[i].records.size(); ++j) tmp += ts[i].records[j];
586  std::cout << std::setw(w) << tmp << " ";
587  }
588  std::cout << std::endl;
589 
590  std::cout << "overall time" << std::endl;
591  for (size_t i = 0; i < ts.size(); ++i)
592  std::cout << std::setw(w) << ts[i].overall_time << " ";
593  std::cout << std::endl;
594  std::cout << std::endl;
595 }
verbose
bool verbose
Definition: benchmark.cpp:32
coal::SpatialHashingCollisionManager
spatial hashing collision mananger
Definition: coal/broadphase/broadphase_spatialhash.h:54
U
U
generate_distance_plot.m
float m
Definition: generate_distance_plot.py:6
coal::Vec3s
Eigen::Matrix< CoalScalar, 3, 1 > Vec3s
Definition: coal/data_types.h:77
V
V
broadphase_dynamic_AABB_tree.h
collision_manager.callback
callback
Definition: collision_manager.py:27
broadphase_SaP.h
coal::CollisionCallBackDefault
Default collision callback to check collision between collision objects.
Definition: coal/broadphase/default_broadphase_callbacks.h:196
coal::DynamicAABBTreeCollisionManager
Definition: coal/broadphase/broadphase_dynamic_AABB_tree.h:53
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(test_broad_phase_dont_duplicate_check)
Definition: broadphase_collision_1.cpp:100
CollisionFunctionForUniquenessChecking
Definition: broadphase_collision_1.cpp:192
coal::generateEnvironments
void generateEnvironments(std::vector< CollisionObject * > &env, CoalScalar env_scale, std::size_t n)
Definition: utility.cpp:392
coal::generateEnvironmentsMesh
void generateEnvironmentsMesh(std::vector< CollisionObject * > &env, CoalScalar env_scale, std::size_t n)
Definition: utility.cpp:423
data
data
coal::detail::SparseHashTable
A hash table implemented using unordered_map.
Definition: coal/broadphase/detail/sparse_hash_table.h:61
coal
Main namespace.
Definition: coal/broadphase/broadphase_bruteforce.h:44
spatial_hash.h
utility.h
R
R
CollisionDataForUniquenessChecking
Definition: broadphase_collision_1.cpp:177
default_broadphase_callbacks.h
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
sparse_hash_table.h
coal::SSaPCollisionManager
Simple SAP collision manager.
Definition: coal/broadphase/broadphase_SSaP.h:47
CollisionFunctionForUniquenessChecking::data
CollisionDataForUniquenessChecking data
Definition: broadphase_collision_1.cpp:198
coal::UnitZ
const Vec3s UnitZ
Definition: utility.cpp:90
CollisionDataForUniquenessChecking::checkUniquenessAndAddPair
bool checkUniquenessAndAddPair(CollisionObject *o1, CollisionObject *o2)
Definition: broadphase_collision_1.cpp:180
broad_phase_update_collision_test
void broad_phase_update_collision_test(CoalScalar env_scale, std::size_t env_size, std::size_t query_size, std::size_t num_max_contacts=1, bool exhaustive=false, bool use_mesh=false)
test for broad phase update
Definition: broadphase_collision_1.cpp:358
coal::NaiveCollisionManager
Brute force N-body collision manager.
Definition: coal/broadphase/broadphase_bruteforce.h:47
coal::DynamicAABBTreeArrayCollisionManager
Definition: coal/broadphase/broadphase_dynamic_AABB_tree_array.h:54
coal::detail::SpatialHash
Spatial hash function: hash an AABB to a set of integer values.
Definition: coal/broadphase/detail/spatial_hash.h:49
broad_phase_duplicate_check_test
void broad_phase_duplicate_check_test(CoalScalar env_scale, std::size_t env_size, bool verbose=false)
make sure if broadphase algorithms doesn't check twice for the same collision object pair
Definition: broadphase_collision_1.cpp:202
coal::IntervalTreeCollisionManager
Collision manager based on interval tree.
Definition: coal/broadphase/broadphase_interval_tree.h:50
broadphase_spatialhash.h
coal::CollisionObject
the object for collision or distance computation, contains the geometry and the transform information
Definition: coal/collision_object.h:214
coal::UnitX
const Vec3s UnitX
Definition: utility.cpp:88
broadphase_bruteforce.h
broadphase_dynamic_AABB_tree_array.h
coal::Matrix3s
Eigen::Matrix< CoalScalar, 3, 3 > Matrix3s
Definition: coal/data_types.h:81
coal::SpatialHashingCollisionManager::computeBound
static void computeBound(std::vector< CollisionObject * > &objs, Vec3s &l, Vec3s &u)
compute the bound for the environent
Definition: coal/broadphase/broadphase_spatialhash-inl.h:501
ts
ts
CollisionDataForUniquenessChecking::checkedPairs
std::set< std::pair< CollisionObject *, CollisionObject * > > checkedPairs
Definition: broadphase_collision_1.cpp:178
coal::UnitY
const Vec3s UnitY
Definition: utility.cpp:89
num_max_contacts
int num_max_contacts
Definition: test/collision.cpp:73
broadphase_SSaP.h
coal::CollisionCallBackBase
Base callback class for collision queries. This class can be supersed by child classes to provide des...
Definition: coal/broadphase/broadphase_callbacks.h:49
coal::CoalScalar
double CoalScalar
Definition: coal/data_types.h:76
broadphase_interval_tree.h
CollisionFunctionForUniquenessChecking::collide
bool collide(CollisionObject *o1, CollisionObject *o2)
Collision evaluation between two objects in collision. This callback will cause the broadphase evalua...
Definition: broadphase_collision_1.cpp:193
coal::SaPCollisionManager
Rigorous SAP collision manager.
Definition: coal/broadphase/broadphase_SaP.h:49


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