38 #ifndef COAL_BROAD_PHASE_DYNAMIC_AABB_TREE_INL_H
39 #define COAL_BROAD_PHASE_DYNAMIC_AABB_TREE_INL_H
55 namespace dynamic_AABB_tree {
60 template <
typename Derived>
64 const Eigen::MatrixBase<Derived>& translation2,
72 if (root1->
bv.overlap(root2_bv_t)) {
83 return (*callback)(obj1, &obj2);
87 if (collisionRecurse_(root1->
children[0], tree2,
nullptr, root2_bv,
88 translation2, callback))
90 if (collisionRecurse_(root1->
children[1], tree2,
nullptr, root2_bv,
91 translation2, callback))
101 if (root1->
bv.overlap(root2_bv_t)) {
112 return (*callback)(obj1, &obj2);
120 if (tree2->
isNodeFree(root2) || !root1->
bv.overlap(root2_bv_t))
return false;
123 (!root1->
isLeaf() && (root1->
bv.size() > root2_bv.
size()))) {
124 if (collisionRecurse_(root1->
children[0], tree2, root2, root2_bv,
125 translation2, callback))
127 if (collisionRecurse_(root1->
children[1], tree2, root2, root2_bv,
128 translation2, callback))
131 for (
unsigned int i = 0; i < 8; ++i) {
135 computeChildBV(root2_bv, i, child_bv);
137 if (collisionRecurse_(root1, tree2, child, child_bv, translation2,
142 computeChildBV(root2_bv, i, child_bv);
143 if (collisionRecurse_(root1, tree2,
nullptr, child_bv, translation2,
153 template <
typename Derived>
156 const AABB& root2_bv,
157 const Eigen::MatrixBase<Derived>& translation2,
176 (!root1->
isLeaf() && (root1->
bv.size() > root2_bv.
size()))) {
183 if (distanceRecurse_(root1->
children[1], tree2, root2, root2_bv,
184 translation2, callback, min_dist))
189 if (distanceRecurse_(root1->
children[0], tree2, root2, root2_bv,
190 translation2, callback, min_dist))
195 if (distanceRecurse_(root1->
children[0], tree2, root2, root2_bv,
196 translation2, callback, min_dist))
201 if (distanceRecurse_(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);
214 Scalar d = root1->
bv.distance(aabb2);
217 if (distanceRecurse_(root1, tree2, child, child_bv, translation2,
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
Definition: AABB.h:55
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:214
Octree is one type of collision geometry which can encode uncertainty information in the sensor data.
Definition: octree.h:53
bool nodeChildExists(const OcTreeNode *node, unsigned int childIdx) const
return true if the child at childIdx exists
Definition: octree.h:259
Scalar 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
OcTreeNode * getNodeChild(OcTreeNode *node, unsigned int childIdx)
Definition: octree.h:240
octomap::OcTreeNode OcTreeNode
Definition: octree.h:63
bool isNodeFree(const OcTreeNode *node) const
whether one node is completely free
Definition: octree.h:165
bool isNodeOccupied(const OcTreeNode *node) const
whether one node is completely occupied
Definition: octree.h:159
Scalar distance(const AABB &other) const
Distance between two AABBs.
KDOP< N > translate(const KDOP< N > &bv, const Vec3s &t)
translate the KDOP BV
Scalar size() const
Size of the AABB (used in BV_Splitter to order two AABBs)
Definition: AABB.h:161
Scalar cost_density
collision cost for unit volume
Definition: collision_object.h:164
Scalar threshold_occupied
threshold for occupied ( >= is occupied)
Definition: collision_object.h:167
const shared_ptr< const CollisionGeometry > collisionGeometry() const
get shared pointer to collision geometry of the object instance
Definition: collision_object.h:311
Main namespace.
Definition: broadphase_bruteforce.h:44
void constructBox(const AABB &bv, Box &box, Transform3s &tf)
construct a box shape (with a configuration) from a given bounding volume
double Scalar
Definition: data_types.h:68
Base callback class for collision queries. This class can be supersed by child classes to provide des...
Definition: broadphase_callbacks.h:49
Base callback class for distance queries. This class can be supersed by child classes to provide desi...
Definition: broadphase_callbacks.h:72
dynamic AABB tree node
Definition: node_base.h:49
NodeBase< BV > * children[2]
for leaf node, children nodes
Definition: node_base.h:64
void * data
Definition: node_base.h:65
bool isLeaf() const
whether is a leaf
Definition: node_base-inl.h:54
BV bv
the bounding volume for the node
Definition: node_base.h:51