shape_mesh_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_SHAPEMESHDISTANCETRAVERSALNODE_H
39 #define FCL_TRAVERSAL_SHAPEMESHDISTANCETRAVERSALNODE_H
40 
43 
44 namespace fcl
45 {
46 
47 namespace detail
48 {
49 
51 template <typename Shape, typename BV, typename NarrowPhaseSolver>
53  : public ShapeBVHDistanceTraversalNode<Shape, BV>
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 
78 template <typename Shape, typename BV, typename NarrowPhaseSolver>
79 bool initialize(
81  const Shape& model1,
82  const Transform3<typename BV::S>& tf1,
83  BVHModel<BV>& model2,
85  const NarrowPhaseSolver* nsolver,
86  const DistanceRequest<typename BV::S>& request,
88  bool use_refit = false,
89  bool refit_bottomup = false);
90 
91 template <typename Shape, typename NarrowPhaseSolver>
94  Shape, RSS<typename Shape::S>, NarrowPhaseSolver>
95 {
96 public:
97 
98  using S = typename Shape::S;
99 
101 
102  void preprocess();
103 
104  void postprocess();
105 
106  S BVTesting(int b1, int b2) const;
107 
108  void leafTesting(int b1, int b2) const;
109 
110 };
111 
114 template <typename Shape, typename NarrowPhaseSolver>
115 bool initialize(
117  const Shape& model1,
119  const BVHModel<RSS<typename Shape::S>>& model2,
121  const NarrowPhaseSolver* nsolver,
122  const DistanceRequest<typename Shape::S>& request,
124 
125 template <typename Shape, typename NarrowPhaseSolver>
128  Shape, kIOS<typename Shape::S>, NarrowPhaseSolver>
129 {
130 public:
131 
132  using S = typename Shape::S;
133 
135 
136  void preprocess();
137 
138  void postprocess();
139 
140  S BVTesting(int b1, int b2) const;
141 
142  void leafTesting(int b1, int b2) const;
143 
144 };
145 
148 template <typename Shape, typename NarrowPhaseSolver>
149 bool initialize(
151  const Shape& model1,
153  const BVHModel<kIOS<typename Shape::S>>& model2,
155  const NarrowPhaseSolver* nsolver,
156  const DistanceRequest<typename Shape::S>& request,
158 
159 template <typename Shape, typename NarrowPhaseSolver>
162  Shape, OBBRSS<typename Shape::S>, NarrowPhaseSolver>
163 {
164 public:
165 
166  using S = typename Shape::S;
167 
169 
170  void preprocess();
171 
172  void postprocess();
173 
174  S BVTesting(int b1, int b2) const;
175 
176  void leafTesting(int b1, int b2) const;
177 
178 };
179 
182 template <typename Shape, typename NarrowPhaseSolver>
183 bool initialize(
185  const Shape& model1,
187  const BVHModel<OBBRSS<typename Shape::S>>& model2,
189  const NarrowPhaseSolver* nsolver,
190  const DistanceRequest<typename Shape::S>& request,
192 
193 } // namespace detail
194 } // namespace fcl
195 
197 
198 #endif
fcl::DistanceRequest
request to the distance computation
Definition: distance_request.h:52
fcl::detail::ShapeMeshDistanceTraversalNodekIOS
Definition: shape_mesh_distance_traversal_node.h:126
fcl::Transform3
Eigen::Transform< S, 3, Eigen::Isometry > Transform3
Definition: types.h:91
fcl::kIOS
A class describing the kIOS collision structure, which is a set of spheres.
Definition: kIOS.h:48
fcl::detail::ShapeMeshDistanceTraversalNodeOBBRSS
Definition: shape_mesh_distance_traversal_node.h:160
fcl::detail::ShapeMeshDistanceTraversalNode::abs_err
S abs_err
Definition: shape_mesh_distance_traversal_node.h:71
BVH_model.h
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::detail::ShapeMeshDistanceTraversalNode::vertices
Vector3< S > * vertices
Definition: shape_mesh_distance_traversal_node.h:67
fcl::DistanceResult
distance result
Definition: distance_request.h:48
fcl::detail::ShapeBVHDistanceTraversalNode
Traversal node for distance computation between shape and BVH.
Definition: shape_bvh_distance_traversal_node.h:53
fcl::Vector3
Eigen::Matrix< S, 3, 1 > Vector3
Definition: types.h:70
shape_mesh_distance_traversal_node-inl.h
fcl::detail::ShapeMeshDistanceTraversalNodeRSS::S
typename Shape::S S
Definition: shape_mesh_distance_traversal_node.h:98
fcl::detail::ShapeMeshDistanceTraversalNodekIOS::S
typename Shape::S S
Definition: shape_mesh_distance_traversal_node.h:132
shape_bvh_distance_traversal_node.h
fcl::detail::ShapeMeshDistanceTraversalNode
Traversal node for distance between shape and mesh.
Definition: shape_mesh_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::ShapeMeshDistanceTraversalNode::rel_err
S rel_err
Definition: shape_mesh_distance_traversal_node.h:70
fcl::detail::ShapeMeshDistanceTraversalNode::nsolver
const NarrowPhaseSolver * nsolver
Definition: shape_mesh_distance_traversal_node.h:73
fcl::OBBRSS
Class merging the OBB and RSS, can handle collision and distance simultaneously.
Definition: OBBRSS.h:50
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::ShapeMeshDistanceTraversalNodeRSS
Definition: shape_mesh_distance_traversal_node.h:92
fcl::detail::ShapeMeshDistanceTraversalNodeOBBRSS::S
typename Shape::S S
Definition: shape_mesh_distance_traversal_node.h:166
fcl
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
fcl::detail::ShapeMeshDistanceTraversalNode::tri_indices
Triangle * tri_indices
Definition: shape_mesh_distance_traversal_node.h:68
fcl::detail::ShapeBVHDistanceTraversalNode< Shape, kIOS< Shape::S > >::S
typename kIOS< Shape::S > ::S S
Definition: shape_bvh_distance_traversal_node.h:58


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