38 #ifndef HPP_FCL_BROAD_PHASE_DYNAMIC_AABB_TREE_ARRAY_INL_H
39 #define HPP_FCL_BROAD_PHASE_DYNAMIC_AABB_TREE_ARRAY_INL_H
44 #if HPP_FCL_HAVE_OCTOMAP
51 namespace dynamic_AABB_tree_array {
53 #if HPP_FCL_HAVE_OCTOMAP
56 template <
typename Derived>
57 bool collisionRecurse_(
60 const AABB& root2_bv,
const Eigen::MatrixBase<Derived>& translation2,
70 if (root1->
bv.overlap(root_bv_t)) {
80 return (*callback)(obj1, &obj2);
84 if (collisionRecurse_(nodes1, root1->
children[0], tree2,
nullptr,
85 root2_bv, translation2, callback))
87 if (collisionRecurse_(nodes1, root1->
children[1], tree2,
nullptr,
88 root2_bv, translation2, callback))
97 if (root1->
bv.overlap(root_bv_t)) {
108 return (*callback)(obj1, &obj2);
116 if (tree2->
isNodeFree(root2) || !root1->
bv.overlap(root_bv_t))
return false;
119 (!root1->
isLeaf() && (root1->
bv.size() > root2_bv.
size()))) {
120 if (collisionRecurse_(nodes1, root1->
children[0], tree2, root2, root2_bv,
121 translation2, callback))
123 if (collisionRecurse_(nodes1, root1->
children[1], tree2, root2, root2_bv,
124 translation2, callback))
127 for (
unsigned int i = 0; i < 8; ++i) {
131 computeChildBV(root2_bv, i, child_bv);
133 if (collisionRecurse_(nodes1, root1_id, tree2, child, child_bv,
134 translation2, callback))
138 computeChildBV(root2_bv, i, child_bv);
139 if (collisionRecurse_(nodes1, root1_id, tree2,
nullptr, child_bv,
140 translation2, callback))
150 template <
typename Derived>
151 bool distanceRecurse_(
154 const AABB& root2_bv,
const Eigen::MatrixBase<Derived>& translation2,
175 (!root1->
isLeaf() && (root1->
bv.size() > root2_bv.
size()))) {
183 if (distanceRecurse_(nodes1, root1->
children[1], tree2, root2, root2_bv,
184 translation2, callback, min_dist))
189 if (distanceRecurse_(nodes1, root1->
children[0], tree2, root2, root2_bv,
190 translation2, callback, min_dist))
195 if (distanceRecurse_(nodes1, root1->
children[0], tree2, root2, root2_bv,
196 translation2, callback, min_dist))
201 if (distanceRecurse_(nodes1, root1->
children[1], tree2, root2, root2_bv,
202 translation2, callback, min_dist))
207 for (
unsigned int i = 0; i < 8; ++i) {
211 computeChildBV(root2_bv, i, child_bv);
217 if (distanceRecurse_(nodes1, root1_id, tree2, child, child_bv,
218 translation2, callback, min_dist))
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
Definition: AABB.h:56
Center at zero point, axis aligned box.
Definition: geometric_shapes.h:164
the object for collision or distance computation, contains the geometry and the transform information
Definition: collision_object.h:215
Octree is one type of collision geometry which can encode uncertainty information in the sensor data.
Definition: octree.h:54
bool isNodeOccupied(const OcTreeNode *node) const
whether one node is completely occupied
Definition: octree.h:159
FCL_REAL getDefaultOccupancy() const
Definition: octree.h:231
octomap::OcTreeNode OcTreeNode
Definition: octree.h:64
OcTreeNode * getNodeChild(OcTreeNode *node, unsigned int childIdx)
Definition: octree.h:240
bool nodeChildExists(const OcTreeNode *node, unsigned int childIdx) const
return true if the child at childIdx exists
Definition: octree.h:259
FCL_REAL getOccupancyThres() const
the threshold used to decide whether one node is occupied, this is NOT the octree occupied_thresold
Definition: octree.h:225
bool nodeHasChildren(const OcTreeNode *node) const
return true if node has at least one child
Definition: octree.h:268
bool isNodeFree(const OcTreeNode *node) const
whether one node is completely free
Definition: octree.h:165
FCL_REAL distance(const AABB &other) const
Distance between two AABBs.
FCL_REAL size() const
Size of the AABB (used in BV_Splitter to order two AABBs)
Definition: AABB.h:162
KDOP< N > translate(const KDOP< N > &bv, const Vec3f &t)
translate the KDOP BV
const shared_ptr< const CollisionGeometry > collisionGeometry() const
get shared pointer to collision geometry of the object instance
Definition: collision_object.h:312
FCL_REAL cost_density
collision cost for unit volume
Definition: collision_object.h:165
FCL_REAL threshold_occupied
threshold for occupied ( >= is occupied)
Definition: collision_object.h:168
void constructBox(const AABB &bv, Box &box, Transform3f &tf)
construct a box shape (with a configuration) from a given bounding volume
double FCL_REAL
Definition: data_types.h:66
Main namespace.
Definition: broadphase_bruteforce.h:44
Base callback class for collision queries. This class can be supersed by child classes to provide des...
Definition: broadphase_callbacks.h:50
Base callback class for distance queries. This class can be supersed by child classes to provide desi...
Definition: broadphase_callbacks.h:73
Definition: node_base_array.h:51
void * data
Definition: node_base_array.h:61
size_t children[2]
Definition: node_base_array.h:60
BV bv
Definition: node_base_array.h:52
bool isLeaf() const
Definition: node_base_array-inl.h:52