-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
collisions_exist_callback.h
54 lines (43 loc) · 1.79 KB
/
collisions_exist_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
#pragma once
#include <fcl/fcl.h>
#include "drake/common/drake_assert.h"
#include "drake/geometry/geometry_ids.h"
#include "drake/geometry/proximity/collision_filter.h"
namespace drake {
namespace geometry {
namespace internal {
namespace has_collisions {
/* Supporting data for the collisions exist callback (see Callback below).
It includes:
- A collision filter instance.
- A boolean of whether any collisions exist.
*/
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. */
explicit CallbackData(const CollisionFilter* collision_filter_in);
/* The collision filter system. */
const CollisionFilter& collision_filter;
/* The parameters for the fcl object-object collision function. */
fcl::CollisionRequestd request;
/* The result of the collisions exist query. */
bool collisions_exist{false};
};
/* The callback function for computing if there is a collision.
@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 for whether collisions exist.
@returns true if there is a collision so that the broadphase can terminate its
process early.
*/
bool Callback(fcl::CollisionObjectd* object_A_ptr,
fcl::CollisionObjectd* object_B_ptr,
void* callback_data);
} // namespace has_collisions
} // namespace internal
} // namespace geometry
} // namespace drake