Go to the documentation of this file.
40 #include <../src/collision_node.h>
44 #include <../src/traits_traversal.h>
48 #ifdef COAL_HAS_OCTOMAP
50 template <
typename TypeA,
typename TypeB>
51 CoalScalar Distance(
const CollisionGeometry* o1,
const Transform3s&
tf1,
52 const CollisionGeometry* o2,
const Transform3s&
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);
64 return result.min_distance;
81 <<
" is not yet supported.",
82 std::invalid_argument);
85 template <
typename T_BVH,
typename T_SH>
92 MeshShapeDistanceTraversalNode<T_BVH, T_SH> node;
96 const T_SH* obj2 =
static_cast<const T_SH*
>(o2);
98 initialize(node, *obj1_tmp, tf1_tmp, *obj2,
tf2, nsolver, request, result);
109 template <
typename OrientedMeshShapeDistanceTraversalNode,
typename T_BVH,
119 OrientedMeshShapeDistanceTraversalNode node;
121 const T_SH* obj2 =
static_cast<const T_SH*
>(o2);
131 template <
typename T_SH>
141 o1,
tf1, o2,
tf2, nsolver, request, result);
145 template <
typename T_SH>
155 o1,
tf1, o2,
tf2, nsolver, request, result);
159 template <
typename T_SH>
169 o1,
tf1, o2,
tf2, nsolver, request, result);
173 template <
typename T_HF,
typename T_SH>
186 "Distance between a height field and a shape is not implemented",
187 std::invalid_argument);
202 template <
typename T_BVH>
207 MeshDistanceTraversalNode<T_BVH> node;
215 initialize(node, *obj1_tmp, tf1_tmp, *obj2_tmp, tf2_tmp, request, result);
224 template <
typename OrientedMeshDistanceTraversalNode,
typename T_BVH>
232 OrientedMeshDistanceTraversalNode node;
249 return details::orientedMeshDistance<MeshDistanceTraversalNodeRSS, RSS>(
250 o1,
tf1, o2,
tf2, request, result);
260 return details::orientedMeshDistance<MeshDistanceTraversalNodekIOS, kIOS>(
261 o1,
tf1, o2,
tf2, request, result);
271 return details::orientedMeshDistance<MeshDistanceTraversalNodeOBBRSS, OBBRSS>(
272 o1,
tf1, o2,
tf2, request, result);
275 template <
typename T_BVH>
280 return BVHDistance<T_BVH>(o1,
tf1, o2,
tf2, request, result);
298 &ShapeShapeDistance<Box, Ellipsoid>;
309 &ShapeShapeDistance<Sphere, ConvexBase>;
314 &ShapeShapeDistance<Sphere, Ellipsoid>;
317 &ShapeShapeDistance<Ellipsoid, Box>;
319 &ShapeShapeDistance<Ellipsoid, Sphere>;
321 &ShapeShapeDistance<Ellipsoid, Capsule>;
323 &ShapeShapeDistance<Ellipsoid, Cone>;
325 &ShapeShapeDistance<Ellipsoid, Cylinder>;
327 &ShapeShapeDistance<Ellipsoid, ConvexBase>;
333 &ShapeShapeDistance<Ellipsoid, Ellipsoid>;
342 &ShapeShapeDistance<Capsule, Cylinder>;
344 &ShapeShapeDistance<Capsule, ConvexBase>;
350 &ShapeShapeDistance<Capsule, Ellipsoid>;
357 &ShapeShapeDistance<Cone, Cylinder>;
359 &ShapeShapeDistance<Cone, ConvexBase>;
364 &ShapeShapeDistance<Cone, Ellipsoid>;
370 &ShapeShapeDistance<Cylinder, Capsule>;
372 &ShapeShapeDistance<Cylinder, Cone>;
374 &ShapeShapeDistance<Cylinder, Cylinder>;
376 &ShapeShapeDistance<Cylinder, ConvexBase>;
382 &ShapeShapeDistance<Cylinder, Ellipsoid>;
386 &ShapeShapeDistance<ConvexBase, Sphere>;
388 &ShapeShapeDistance<ConvexBase, Capsule>;
390 &ShapeShapeDistance<ConvexBase, Cone>;
392 &ShapeShapeDistance<ConvexBase, Cylinder>;
394 &ShapeShapeDistance<ConvexBase, ConvexBase>;
400 &ShapeShapeDistance<ConvexBase, Ellipsoid>;
609 #ifdef COAL_HAS_OCTOMAP
635 &Distance<OcTree, BVHModel<OBBRSS> >;
638 &Distance<OcTree, BVHModel<KDOP<16> > >;
640 &Distance<OcTree, BVHModel<KDOP<18> > >;
642 &Distance<OcTree, BVHModel<KDOP<24> > >;
650 &Distance<BVHModel<KDOP<16> >,
OcTree>;
652 &Distance<BVHModel<KDOP<18> >,
OcTree>;
654 &Distance<BVHModel<KDOP<24> >,
OcTree>;
CoalScalar ShapeShapeDistance< Ellipsoid, Plane >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
virtual NODE_TYPE getNodeType() const
get the node type
static CoalScalar distance(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *nsolver, const DistanceRequest &request, DistanceResult &result)
CoalScalar ShapeShapeDistance< Box, Halfspace >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
COAL_LOCAL CoalScalar distance_function_not_implemented(const CollisionGeometry *o1, const Transform3s &, const CollisionGeometry *o2, const Transform3s &, const GJKSolver *, const DistanceRequest &, DistanceResult &)
static CoalScalar distance(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *nsolver, const DistanceRequest &request, DistanceResult &result)
CoalScalar ShapeShapeDistance< Plane, Sphere >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
NODE_TYPE
traversal node type: bounding volume (AABB, OBB, RSS, kIOS, OBBRSS, KDOP16, KDOP18,...
double distance(const std::vector< Transform3s > &tf, const BVHModel< BV > &m1, const BVHModel< BV > &m2, bool verbose)
CoalScalar ShapeShapeDistance< ConvexBase, Plane >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Plane, Plane >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Halfspace, Halfspace >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
A class describing the kIOS collision structure, which is a set of spheres.
collision and distance solver based on the GJK and EPA algorithms. Originally, GJK and EPA were imple...
CoalScalar ShapeShapeDistance< Halfspace, Sphere >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
COAL_DLLAPI CoalScalar distance(const Matrix3s &R0, const Vec3s &T0, const kIOS &b1, const kIOS &b2, Vec3s *P=NULL, Vec3s *Q=NULL)
Approximate distance between two kIOS bounding volumes.
CoalScalar ShapeShapeDistance< Capsule, Halfspace >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Cone, Plane >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Halfspace, Box >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Halfspace, Cone >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
The geometry for the object for collision or distance computation.
CoalScalar ShapeShapeDistance< Halfspace, Capsule >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Halfspace, Cylinder >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Halfspace, Ellipsoid >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Sphere, Sphere >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< ConvexBase, Halfspace >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Sphere, Cylinder >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Halfspace, Plane >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar min_distance
minimum distance between two objects. If two objects are in collision and DistanceRequest::enable_sig...
CoalScalar ShapeShapeDistance< Ellipsoid, Halfspace >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Plane, Ellipsoid >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
#define COAL_UNUSED_VARIABLE(var)
request to the distance computation
CoalScalar ShapeShapeDistance< Plane, Capsule >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar orientedMeshDistance(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const DistanceRequest &request, DistanceResult &result)
#define COAL_THROW_PRETTY(message, exception)
CoalScalar BVHDistance< RSS >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const DistanceRequest &request, DistanceResult &result)
CoalScalar ShapeShapeDistance< Cone, Halfspace >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar BVHDistance(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const DistanceRequest &request, DistanceResult &result)
CoalScalar ShapeShapeDistance< Capsule, Plane >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Sphere, Capsule >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Cylinder, Plane >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
DistanceFunc distance_matrix[NODE_COUNT][NODE_COUNT]
each item in the distance matrix is a function to handle distance between objects of type1 and type2
CoalScalar ShapeShapeDistance< Sphere, Plane >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
const char * get_node_type_name(NODE_TYPE node_type)
Returns the name associated to a NODE_TYPE.
COAL_COMPILER_DIAGNOSTIC_POP bool isSatisfied(const DistanceResult &result) const
CoalScalar ShapeShapeDistance< Plane, ConvexBase >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as ...
Octree is one type of collision geometry which can encode uncertainty information in the sensor data.
CoalScalar ShapeShapeDistance< Box, Sphere >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Halfspace, ConvexBase >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
static CoalScalar distance(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *nsolver, const DistanceRequest &request, DistanceResult &result)
CoalScalar ShapeShapeDistance< Box, Plane >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Sphere, Box >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar BVHDistance< OBBRSS >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const DistanceRequest &request, DistanceResult &result)
CoalScalar orientedBVHShapeDistance(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *nsolver, const DistanceRequest &request, DistanceResult &result)
CoalScalar ShapeShapeDistance< Capsule, Capsule >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &wp1, Vec3s &wp2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Plane, Halfspace >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Capsule, Sphere >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Plane, Cylinder >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Plane, Box >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Sphere, Halfspace >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Cylinder, Sphere >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
bool initialize(MeshCollisionTraversalNode< BV, RelativeTransformationIsIdentity > &node, BVHModel< BV > &model1, Transform3s &tf1, BVHModel< BV > &model2, Transform3s &tf2, CollisionResult &result, bool use_refit=false, bool refit_bottomup=false)
Initialize traversal node for collision between two meshes, given the current transforms.
CoalScalar BVHDistance< kIOS >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const DistanceRequest &request, DistanceResult &result)
CoalScalar ShapeShapeDistance< Cylinder, Halfspace >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
CoalScalar ShapeShapeDistance< Plane, Cone >(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const GJKSolver *, const bool, Vec3s &p1, Vec3s &p2, Vec3s &normal)
hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:58