40 #include <../src/collision_node.h> 43 #include <../src/traits_traversal.h> 48 #ifdef HPP_FCL_HAS_OCTOMAP 50 template <
typename TypeA,
typename TypeB>
51 FCL_REAL Distance(
const CollisionGeometry* o1,
const Transform3f&
tf1,
52 const CollisionGeometry* o2,
const Transform3f&
tf2,
53 const GJKSolver* nsolver,
const DistanceRequest& request,
54 DistanceResult& result) {
55 if (request.isSatisfied(result))
return result.min_distance;
56 typename TraversalTraitsDistance<TypeA, TypeB>::CollisionTraversal_t node;
57 const TypeA* obj1 = static_cast<const TypeA*>(o1);
58 const TypeB* obj2 =
static_cast<const TypeB*
>(o2);
59 OcTreeSolver otsolver(nsolver);
61 initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, request, result);
64 return result.min_distance;
69 template <
typename T_SH1,
typename T_SH2>
76 ShapeDistanceTraversalNode<T_SH1, T_SH2> node;
77 const T_SH1* obj1 = static_cast<const T_SH1*>(o1);
78 const T_SH2* obj2 =
static_cast<const T_SH2*
>(o2);
80 initialize(node, *obj1, tf1, *obj2, tf2, nsolver, request, result);
86 template <
typename T_BVH,
typename T_SH>
94 MeshShapeDistanceTraversalNode<T_BVH, T_SH> node;
98 const T_SH* obj2 =
static_cast<const T_SH*
>(o2);
100 initialize(node, *obj1_tmp, tf1_tmp, *obj2, tf2, nsolver, request, result);
110 template <
typename OrientedMeshShapeDistanceTraversalNode,
typename T_BVH,
120 OrientedMeshShapeDistanceTraversalNode node;
122 const T_SH* obj2 =
static_cast<const T_SH*
>(o2);
124 initialize(node, *obj1, tf1, *obj2, tf2, nsolver, request, result);
132 template <
typename T_SH>
141 o1,
tf1, o2,
tf2, nsolver, request, result);
145 template <
typename T_SH>
154 o1,
tf1, o2,
tf2, nsolver, request, result);
158 template <
typename T_SH>
167 o1,
tf1, o2,
tf2, nsolver, request, result);
171 template <
typename T_HF,
typename T_SH>
186 "Distance between a height field and a shape is not implemented",
187 std::invalid_argument);
201 template <
typename T_BVH>
206 MeshDistanceTraversalNode<T_BVH> node;
214 initialize(node, *obj1_tmp, tf1_tmp, *obj2_tmp, tf2_tmp, request, result);
223 template <
typename OrientedMeshDistanceTraversalNode,
typename T_BVH>
231 OrientedMeshDistanceTraversalNode node;
235 initialize(node, *obj1, tf1, *obj2, tf2, request, result);
248 return details::orientedMeshDistance<MeshDistanceTraversalNodeRSS, RSS>(
249 o1,
tf1, o2,
tf2, request, result);
257 return details::orientedMeshDistance<MeshDistanceTraversalNodekIOS, kIOS>(
258 o1,
tf1, o2,
tf2, request, result);
268 return details::orientedMeshDistance<MeshDistanceTraversalNodeOBBRSS, OBBRSS>(
269 o1,
tf1, o2,
tf2, request, result);
272 template <
typename T_BVH>
277 return BVHDistance<T_BVH>(o1,
tf1, o2,
tf2, request, result);
282 for (
int j = 0; j <
NODE_COUNT; ++j) distance_matrix[i][j] = NULL;
295 &ShapeShapeDistance<Box, Ellipsoid>;
301 &ShapeShapeDistance<Sphere, Capsule>;
306 &ShapeShapeDistance<Sphere, ConvexBase>;
311 &ShapeShapeDistance<Sphere, Ellipsoid>;
314 &ShapeShapeDistance<Ellipsoid, Box>;
316 &ShapeShapeDistance<Ellipsoid, Sphere>;
318 &ShapeShapeDistance<Ellipsoid, Capsule>;
320 &ShapeShapeDistance<Ellipsoid, Cone>;
322 &ShapeShapeDistance<Ellipsoid, Cylinder>;
324 &ShapeShapeDistance<Ellipsoid, ConvexBase>;
328 &ShapeShapeDistance<Ellipsoid, Ellipsoid>;
332 &ShapeShapeDistance<Capsule, Sphere>;
337 &ShapeShapeDistance<Capsule, Cylinder>;
339 &ShapeShapeDistance<Capsule, ConvexBase>;
345 &ShapeShapeDistance<Capsule, Ellipsoid>;
352 &ShapeShapeDistance<Cone, Cylinder>;
354 &ShapeShapeDistance<Cone, ConvexBase>;
359 &ShapeShapeDistance<Cone, Ellipsoid>;
365 &ShapeShapeDistance<Cylinder, Capsule>;
367 &ShapeShapeDistance<Cylinder, Cone>;
369 &ShapeShapeDistance<Cylinder, Cylinder>;
371 &ShapeShapeDistance<Cylinder, ConvexBase>;
377 &ShapeShapeDistance<Cylinder, Ellipsoid>;
381 &ShapeShapeDistance<ConvexBase, Sphere>;
383 &ShapeShapeDistance<ConvexBase, Capsule>;
385 &ShapeShapeDistance<ConvexBase, Cone>;
387 &ShapeShapeDistance<ConvexBase, Cylinder>;
389 &ShapeShapeDistance<ConvexBase, ConvexBase>;
391 &ShapeShapeDistance<ConvexBase, Plane>;
395 &ShapeShapeDistance<ConvexBase, Ellipsoid>;
405 &ShapeShapeDistance<Plane, ConvexBase>;
408 &ShapeShapeDistance<Plane, Halfspace>;
424 &ShapeShapeDistance<Halfspace, Plane>;
426 &ShapeShapeDistance<Halfspace, Halfspace>;
602 #ifdef HPP_FCL_HAS_OCTOMAP 628 &Distance<OcTree, BVHModel<OBBRSS> >;
631 &Distance<OcTree, BVHModel<KDOP<16> > >;
633 &Distance<OcTree, BVHModel<KDOP<18> > >;
635 &Distance<OcTree, BVHModel<KDOP<24> > >;
643 &Distance<BVHModel<KDOP<16> >, OcTree>;
645 &Distance<BVHModel<KDOP<18> >, OcTree>;
647 &Distance<BVHModel<KDOP<24> >, OcTree>;
request to the distance computation
FCL_REAL ShapeShapeDistance< Plane, Cylinder >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Sphere, Box >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Sphere, Plane >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< ConvexBase, Halfspace >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL BVHDistance< RSS >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const DistanceRequest &request, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Cone, Halfspace >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
bool initialize(MeshCollisionTraversalNode< BV, RelativeTransformationIsIdentity > &node, BVHModel< BV > &model1, Transform3f &tf1, BVHModel< BV > &model2, Transform3f &tf2, CollisionResult &result, bool use_refit=false, bool refit_bottomup=false)
Initialize traversal node for collision between two meshes, given the current transforms.
FCL_REAL ShapeShapeDistance< Capsule, Plane >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Cylinder, Halfspace >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL orientedBVHShapeDistance(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *nsolver, const DistanceRequest &request, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Halfspace, Cone >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Plane, Capsule >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
static FCL_REAL distance(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *nsolver, const DistanceRequest &request, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Cylinder, Sphere >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *nsolver, const DistanceRequest &request, DistanceResult &result)
FCL_REAL BVHDistance< kIOS >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const DistanceRequest &request, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Capsule, Capsule >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &request, DistanceResult &result)
A class describing the kIOS collision structure, which is a set of spheres.
Octree is one type of collision geometry which can encode uncertainty information in the sensor data...
HPP_FCL_DLLAPI FCL_REAL distance(const Matrix3f &R0, const Vec3f &T0, const kIOS &b1, const kIOS &b2, Vec3f *P=NULL, Vec3f *Q=NULL)
Approximate distance between two kIOS bounding volumes.
FCL_REAL ShapeShapeDistance< Halfspace, ConvexBase >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL BVHDistance< OBBRSS >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const DistanceRequest &request, DistanceResult &result)
#define HPP_FCL_UNUSED_VARIABLE(var)
bool isSatisfied(const DistanceResult &result) const
FCL_REAL min_distance
minimum distance between two objects. if two objects are in collision, min_distance <= 0...
FCL_REAL ShapeShapeDistance< Sphere, Halfspace >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as ...
FCL_REAL ShapeShapeDistance< Box, Sphere >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Cone, Plane >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL BVHDistance(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const DistanceRequest &request, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Plane, Sphere >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Cylinder, Plane >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Halfspace, Capsule >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Halfspace, Cylinder >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Plane, Cone >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Sphere, Cylinder >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
collision and distance solver based on GJK algorithm implemented in fcl (rewritten the code from the ...
FCL_REAL ShapeShapeDistance< Plane, Box >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Halfspace, Sphere >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Box, Halfspace >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Halfspace, Box >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
static FCL_REAL distance(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *nsolver, const DistanceRequest &request, DistanceResult &result)
The geometry for the object for collision or distance computation.
FCL_REAL orientedMeshDistance(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const DistanceRequest &request, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Box, Plane >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Sphere, Sphere >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
FCL_REAL ShapeShapeDistance< Capsule, Halfspace >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &, DistanceResult &result)
#define HPP_FCL_THROW_PRETTY(message, exception)
static FCL_REAL distance(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *nsolver, const DistanceRequest &request, DistanceResult &result)