38 #ifndef HPP_FCL_BROAD_PHASE_DYNAMIC_AABB_TREE_INL_H 39 #define HPP_FCL_BROAD_PHASE_DYNAMIC_AABB_TREE_INL_H 45 #if HPP_FCL_HAVE_OCTOMAP 56 namespace dynamic_AABB_tree {
58 #if HPP_FCL_HAVE_OCTOMAP 61 template <
typename Derived>
65 const Eigen::MatrixBase<Derived>& translation2,
73 if (root1->
bv.overlap(root2_bv_t)) {
84 return (*callback)(obj1, &obj2);
88 if (collisionRecurse_(root1->
children[0], tree2,
nullptr, root2_bv,
89 translation2, callback))
91 if (collisionRecurse_(root1->
children[1], tree2,
nullptr, root2_bv,
92 translation2, callback))
102 if (root1->
bv.overlap(root2_bv_t)) {
113 return (*callback)(obj1, &obj2);
121 if (tree2->
isNodeFree(root2) || !root1->
bv.overlap(root2_bv_t))
return false;
124 (!root1->
isLeaf() && (root1->
bv.size() > root2_bv.
size()))) {
125 if (collisionRecurse_(root1->
children[0], tree2, root2, root2_bv,
126 translation2, callback))
128 if (collisionRecurse_(root1->
children[1], tree2, root2, root2_bv,
129 translation2, callback))
132 for (
unsigned int i = 0; i < 8; ++i) {
138 if (collisionRecurse_(root1, tree2, child, child_bv, translation2,
144 if (collisionRecurse_(root1, tree2,
nullptr, child_bv, translation2,
154 template <
typename Derived>
157 const AABB& root2_bv,
158 const Eigen::MatrixBase<Derived>& translation2,
177 (!root1->
isLeaf() && (root1->
bv.size() > root2_bv.
size()))) {
184 if (distanceRecurse_(root1->
children[1], tree2, root2, root2_bv,
185 translation2, callback, min_dist))
190 if (distanceRecurse_(root1->
children[0], tree2, root2, root2_bv,
191 translation2, callback, min_dist))
196 if (distanceRecurse_(root1->
children[0], tree2, root2, root2_bv,
197 translation2, callback, min_dist))
202 if (distanceRecurse_(root1->
children[1], tree2, root2, root2_bv,
203 translation2, callback, min_dist))
208 for (
unsigned int i = 0; i < 8; ++i) {
218 if (distanceRecurse_(root1, tree2, child, child_bv, translation2,
bool isNodeFree(const OcTreeNode *node) const
whether one node is completely free
FCL_REAL cost_density
collision cost for unit volume
FCL_REAL getOccupancyThres() const
the threshold used to decide whether one node is occupied, this is NOT the octree occupied_thresold ...
bool isLeaf() const
whether is a leaf
double getOccupancy() const
Base callback class for collision queries. This class can be supersed by child classes to provide des...
static void computeChildBV(const AABB &root_bv, unsigned int i, AABB &child_bv)
compute the bounding volume of an octree node's i-th child
FCL_REAL threshold_occupied
threshold for occupied ( >= is occupied)
FCL_REAL size() const
Size of the AABB (used in BV_Splitter to order two AABBs)
Octree is one type of collision geometry which can encode uncertainty information in the sensor data...
NodeBase< BV > * children[2]
for leaf node, children nodes
Center at zero point, axis aligned box.
OcTreeNode * getNodeChild(OcTreeNode *node, unsigned int childIdx)
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
static AABB translate(const AABB &aabb, const Vec3f &t)
translate the center of AABB by t
const shared_ptr< const CollisionGeometry > collisionGeometry() const
get geometry from the object instance
FCL_REAL distance(const AABB &other) const
Distance between two AABBs.
BV bv
the bounding volume for the node
the object for collision or distance computation, contains the geometry and the transform information...
HPP_FCL_DLLAPI void constructBox(const AABB &bv, Box &box, Transform3f &tf)
construct a box shape (with a configuration) from a given bounding volume
bool isNodeOccupied(const OcTreeNode *node) const
whether one node is completely occupied
Base callback class for distance queries. This class can be supersed by child classes to provide desi...
bool nodeChildExists(const OcTreeNode *node, unsigned int childIdx) const
return true if the child at childIdx exists
bool nodeHasChildren(const OcTreeNode *node) const
return true if node has at least one child