mesh_shape_distance_traversal_node.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2011-2014, Willow Garage, Inc.
5  * Copyright (c) 2014-2016, Open Source Robotics Foundation
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of Open Source Robotics Foundation nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
38 #ifndef FCL_TRAVERSAL_MESHSHAPEDISTANCETRAVERSALNODE_H
39 #define FCL_TRAVERSAL_MESHSHAPEDISTANCETRAVERSALNODE_H
40 
43 
44 namespace fcl
45 {
46 
47 namespace detail
48 {
49 
51 template <typename BV, typename Shape, typename NarrowPhaseSolver>
53  : public BVHShapeDistanceTraversalNode<BV, Shape>
54 {
55 public:
56 
57  using S = typename BV::S;
58 
60 
62  void leafTesting(int b1, int b2) const;
63 
65  bool canStop(S c) const;
66 
69 
72 
73  const NarrowPhaseSolver* nsolver;
74 };
75 
76 template <typename BV, typename Shape, typename NarrowPhaseSolver>
78  int b1, int /* b2 */,
79  const BVHModel<BV>* model1,
80  const Shape& model2,
81  Vector3<typename BV::S>* vertices,
82  Triangle* tri_indices,
83  const Transform3<typename BV::S>& tf1,
84  const Transform3<typename BV::S>& tf2,
85  const NarrowPhaseSolver* nsolver,
86  bool enable_statistics,
87  int & num_leaf_tests,
88  const DistanceRequest<typename BV::S>& /* request */,
90 
91 
92 template <typename BV, typename Shape, typename NarrowPhaseSolver>
94  const BVHModel<BV>* model1,
95  Vector3<typename BV::S>* vertices,
96  Triangle* tri_indices,
97  int init_tri_id,
98  const Shape& model2,
99  const Transform3<typename BV::S>& tf1,
100  const Transform3<typename BV::S>& tf2,
101  const NarrowPhaseSolver* nsolver,
102  const DistanceRequest<typename BV::S>& /* request */,
104 
107 template <typename BV, typename Shape, typename NarrowPhaseSolver>
108 bool initialize(
110  BVHModel<BV>& model1,
112  const Shape& model2,
113  const Transform3<typename BV::S>& tf2,
114  const NarrowPhaseSolver* nsolver,
115  const DistanceRequest<typename BV::S>& request,
117  bool use_refit = false, bool refit_bottomup = false);
118 
120 template <typename Shape, typename NarrowPhaseSolver>
123  RSS<typename Shape::S>, Shape, NarrowPhaseSolver>
124 {
125 public:
126  using S = typename Shape::S;
127 
129 
130  void preprocess();
131 
132  void postprocess();
133 
134  S BVTesting(int b1, int b2) const;
135 
136  void leafTesting(int b1, int b2) const;
137 };
138 
139 template <typename Shape, typename NarrowPhaseSolver>
140 bool initialize(
142  const BVHModel<RSS<typename Shape::S>>& model1,
144  const Shape& model2,
146  const NarrowPhaseSolver* nsolver,
147  const DistanceRequest<typename Shape::S>& request,
149 
150 template <typename Shape, typename NarrowPhaseSolver>
152  : public MeshShapeDistanceTraversalNode<kIOS<typename Shape::S>, Shape, NarrowPhaseSolver>
153 {
154 public:
155  using S = typename Shape::S;
156 
158 
159  void preprocess();
160 
161  void postprocess();
162 
163  S BVTesting(int b1, int b2) const;
164 
165  void leafTesting(int b1, int b2) const;
166 
167 };
168 
170 template <typename Shape, typename NarrowPhaseSolver>
171 bool initialize(
174  const Shape& model2, const Transform3<typename Shape::S>& tf2,
175  const NarrowPhaseSolver* nsolver,
176  const DistanceRequest<typename Shape::S>& request,
178 
179 template <typename Shape, typename NarrowPhaseSolver>
181  : public MeshShapeDistanceTraversalNode<OBBRSS<typename Shape::S>, Shape, NarrowPhaseSolver>
182 {
183 public:
184  using S = typename Shape::S;
185 
187 
188  void preprocess();
189 
190  void postprocess();
191 
192  S BVTesting(int b1, int b2) const;
193 
194  void leafTesting(int b1, int b2) const;
195 
196 };
197 
199 template <typename Shape, typename NarrowPhaseSolver>
200 bool initialize(
202  const BVHModel<OBBRSS<typename Shape::S>>& model1,
204  const Shape& model2,
206  const NarrowPhaseSolver* nsolver,
207  const DistanceRequest<typename Shape::S>& request,
209 
210 } // namespace detail
211 } // namespace fcl
212 
214 
215 #endif
fcl::DistanceRequest
request to the distance computation
Definition: distance_request.h:52
fcl::detail::MeshShapeDistanceTraversalNodeOBBRSS
Definition: mesh_shape_distance_traversal_node.h:180
fcl::detail::MeshShapeDistanceTraversalNode
Traversal node for distance between mesh and shape.
Definition: mesh_shape_distance_traversal_node.h:52
fcl::Transform3
Eigen::Transform< S, 3, Eigen::Isometry > Transform3
Definition: types.h:91
utility.h
fcl::kIOS
A class describing the kIOS collision structure, which is a set of spheres.
Definition: kIOS.h:48
fcl::detail::MeshShapeDistanceTraversalNode::nsolver
const NarrowPhaseSolver * nsolver
Definition: mesh_shape_distance_traversal_node.h:73
fcl::detail::MeshShapeDistanceTraversalNodeOBBRSS::S
typename Shape::S S
Definition: mesh_shape_distance_traversal_node.h:184
mesh_shape_distance_traversal_node-inl.h
fcl::detail::MeshShapeDistanceTraversalNodeRSS
Traversal node for distance between mesh and shape, when mesh BVH is one of the oriented node (RSS,...
Definition: mesh_shape_distance_traversal_node.h:121
fcl::detail::MeshShapeDistanceTraversalNode::abs_err
S abs_err
Definition: mesh_shape_distance_traversal_node.h:71
fcl::RSS
A class for rectangle swept sphere bounding volume.
Definition: RSS.h:58
fcl::Triangle
Triangle with 3 indices for points.
Definition: triangle.h:48
fcl::DistanceResult
distance result
Definition: distance_request.h:48
fcl::Vector3
Eigen::Matrix< S, 3, 1 > Vector3
Definition: types.h:70
fcl::detail::distancePreprocessOrientedNode
void distancePreprocessOrientedNode(const BVHModel< BV > *model1, const BVHModel< BV > *model2, const Vector3< typename BV::S > *vertices1, Vector3< typename BV::S > *vertices2, Triangle *tri_indices1, Triangle *tri_indices2, int init_tri_id1, int init_tri_id2, const Matrix3< typename BV::S > &R, const Vector3< typename BV::S > &T, const DistanceRequest< typename BV::S > &request, DistanceResult< typename BV::S > &result)
Definition: mesh_distance_traversal_node-inl.h:503
fcl::detail::meshShapeDistanceOrientedNodeLeafTesting
void meshShapeDistanceOrientedNodeLeafTesting(int b1, int, const BVHModel< BV > *model1, const Shape &model2, Vector3< typename BV::S > *vertices, Triangle *tri_indices, const Transform3< typename BV::S > &tf1, const Transform3< typename BV::S > &tf2, const NarrowPhaseSolver *nsolver, bool enable_statistics, int &num_leaf_tests, const DistanceRequest< typename BV::S > &, DistanceResult< typename BV::S > &result)
Definition: mesh_shape_distance_traversal_node-inl.h:164
fcl::detail::MeshShapeDistanceTraversalNode::vertices
Vector3< S > * vertices
Definition: mesh_shape_distance_traversal_node.h:67
fcl::detail::BVHShapeDistanceTraversalNode
Traversal node for distance computation between BVH and shape.
Definition: bvh_shape_distance_traversal_node.h:52
fcl::detail::initialize
template bool initialize(MeshCollisionTraversalNodeOBB< double > &node, const BVHModel< OBB< double >> &model1, const Transform3< double > &tf1, const BVHModel< OBB< double >> &model2, const Transform3< double > &tf2, const CollisionRequest< double > &request, CollisionResult< double > &result)
fcl::detail::MeshShapeDistanceTraversalNode::rel_err
S rel_err
Definition: mesh_shape_distance_traversal_node.h:70
fcl::OBBRSS
Class merging the OBB and RSS, can handle collision and distance simultaneously.
Definition: OBBRSS.h:50
bvh_shape_distance_traversal_node.h
fcl::detail::MeshShapeDistanceTraversalNodeRSS::S
typename Shape::S S
Definition: mesh_shape_distance_traversal_node.h:126
fcl::BVHModel
A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as ...
Definition: BVH_model.h:57
fcl::detail::MeshShapeDistanceTraversalNodekIOS
Definition: mesh_shape_distance_traversal_node.h:151
fcl::detail::BVHShapeDistanceTraversalNode< kIOS< Shape::S >, Shape >::S
typename kIOS< Shape::S > ::S S
Definition: bvh_shape_distance_traversal_node.h:57
fcl
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
fcl::detail::MeshShapeDistanceTraversalNodekIOS::S
typename Shape::S S
Definition: mesh_shape_distance_traversal_node.h:155
fcl::detail::MeshShapeDistanceTraversalNode::tri_indices
Triangle * tri_indices
Definition: mesh_shape_distance_traversal_node.h:68


fcl
Author(s):
autogenerated on Tue Dec 5 2023 03:40:48