-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
find_collision_candidates_callback.h
61 lines (49 loc) · 2.05 KB
/
find_collision_candidates_callback.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#include <optional>
#include <utility>
#include <vector>
#include <fcl/fcl.h>
#include <fmt/format.h>
#include "drake/common/sorted_pair.h"
#include "drake/geometry/geometry_ids.h"
#include "drake/geometry/proximity/collision_filter.h"
namespace drake {
namespace geometry {
namespace internal {
namespace find_collision_candidates {
/* Supporting data for the collision candidates callback (see Callback below).
It includes:
- A collision filter instance.
- A vector of geometry pairs -- each pair of geometries are possibly in
contact.
*/
struct CallbackData {
/* Constructs the fully-specified callback data. The values are as described
in the class documentation. The parameters are all aliased in the data and
must remain valid at least as long as the %CallbackData instance.
@param collision_filter_in The collision filter system. Aliased.
@param pairs_in The output results. Aliased. */
CallbackData(const CollisionFilter* collision_filter_in,
std::vector<SortedPair<GeometryId>>* pairs_in);
/* The collision filter system. */
const CollisionFilter& collision_filter;
/* The results of the collision candidates query. */
std::vector<SortedPair<GeometryId>>& pairs;
};
/* The callback function that stores the geometry ids of two shapes identified
as potentially being in contact by the collision candidates query.
@param object_A_ptr Pointer to the first object in the pair (the order has
no significance).
@param object_B_ptr Pointer to the second object in the pair (the order has
no significance).
@param callback_data Supporting data to find collision candidates.
@returns False; the broadphase should *not* terminate its process.
*/
bool Callback(fcl::CollisionObjectd* object_A_ptr,
fcl::CollisionObjectd* object_B_ptr,
// NOLINTNEXTLINE
void* callback_data);
} // namespace find_collision_candidates
} // namespace internal
} // namespace geometry
} // namespace drake