mesh_shape_conservative_advancement_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_MESHSHAPECONSERVATIVEADVANCEMENTTRAVERSALNODE_H
39 #define FCL_TRAVERSAL_MESHSHAPECONSERVATIVEADVANCEMENTTRAVERSALNODE_H
40 
43 
44 namespace fcl
45 {
46 
47 namespace detail
48 {
49 
51 template <typename BV, typename Shape, typename NarrowPhaseSolver>
53  : public MeshShapeDistanceTraversalNode<BV, Shape, NarrowPhaseSolver>
54 {
55 public:
56 
57  using S = typename BV::S;
58 
60 
62  S BVTesting(int b1, int b2) const;
63 
65  void leafTesting(int b1, int b2) const;
66 
68  bool canStop(S c) const;
69 
70  mutable S min_distance;
71 
72  mutable Vector3<S> closest_p1, closest_p2;
73 
74  mutable int last_tri_id;
75 
77  S w;
78 
80  S toc;
82 
84  mutable S delta_t;
85 
89 
90  mutable std::vector<ConservativeAdvancementStackData<S>> stack;
91 };
92 
93 template <typename BV, typename Shape, typename NarrowPhaseSolver>
94 bool initialize(
96  BVHModel<BV>& model1,
97  const Transform3<typename BV::S>& tf1,
98  const Shape& model2,
99  const Transform3<typename BV::S>& tf2,
100  const NarrowPhaseSolver* nsolver,
101  typename BV::S w = 1,
102  bool use_refit = false,
103  bool refit_bottomup = false);
104 
105 template <typename BV, typename Shape, typename NarrowPhaseSolver>
107  int b1,
108  int /* b2 */,
109  const BVHModel<BV>* model1,
110  const Shape& model2,
111  const BV& model2_bv,
112  Vector3<typename BV::S>* vertices,
113  Triangle* tri_indices,
114  const Transform3<typename BV::S>& tf1,
115  const Transform3<typename BV::S>& tf2,
116  const MotionBase<typename BV::S>* motion1,
117  const MotionBase<typename BV::S>* motion2,
118  const NarrowPhaseSolver* nsolver,
119  bool enable_statistics,
120  typename BV::S& min_distance,
123  int& last_tri_id,
124  typename BV::S& delta_t,
125  int& num_leaf_tests);
126 
127 template <typename BV, typename Shape>
129  typename BV::S c,
130  typename BV::S min_distance,
131  typename BV::S abs_err,
132  typename BV::S rel_err,
133  typename BV::S w,
134  const BVHModel<BV>* model1,
135  const Shape& model2,
136  const BV& model2_bv,
137  const MotionBase<typename BV::S>* motion1,
138  const MotionBase<typename BV::S>* motion2,
140  typename BV::S& delta_t);
141 
142 template <typename Shape, typename NarrowPhaseSolver>
145  RSS<typename Shape::S>, Shape, NarrowPhaseSolver>
146 {
147 public:
148 
149  using S = typename Shape::S;
150 
152 
153  S BVTesting(int b1, int b2) const;
154 
155  void leafTesting(int b1, int b2) const;
156 
157  bool canStop(S c) const;
158 };
159 
160 template <typename Shape, typename NarrowPhaseSolver>
161 bool initialize(
163  const BVHModel<RSS<typename Shape::S>>& model1,
165  const Shape& model2,
167  const NarrowPhaseSolver* nsolver,
168  typename Shape::S w = 1);
169 
170 template <typename Shape, typename NarrowPhaseSolver>
173  OBBRSS<typename Shape::S>, Shape, NarrowPhaseSolver>
174 {
175 public:
176 
177  using S = typename Shape::S;
178 
180 
181  S BVTesting(int b1, int b2) const;
182 
183  void leafTesting(int b1, int b2) const;
184 
185  bool canStop(S c) const;
186 };
187 
188 template <typename Shape, typename NarrowPhaseSolver>
189 bool initialize(
191  const BVHModel<OBBRSS<typename Shape::S>>& model1,
193  const Shape& model2,
195  const NarrowPhaseSolver* nsolver,
196  typename Shape::S w = 1);
197 
198 } // namespace detail
199 } // namespace fcl
200 
202 
203 #endif
fcl::detail::MeshShapeConservativeAdvancementTraversalNodeOBBRSS::S
typename Shape::S S
Definition: mesh_shape_conservative_advancement_traversal_node.h:177
fcl::detail::MeshShapeConservativeAdvancementTraversalNode::delta_t
S delta_t
The delta_t each step.
Definition: mesh_shape_conservative_advancement_traversal_node.h:84
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
fcl::detail::MeshShapeConservativeAdvancementTraversalNodeRSS::S
typename Shape::S S
Definition: mesh_shape_conservative_advancement_traversal_node.h:149
fcl::detail::meshShapeConservativeAdvancementOrientedNodeLeafTesting
void meshShapeConservativeAdvancementOrientedNodeLeafTesting(int b1, int, const BVHModel< BV > *model1, const Shape &model2, const BV &model2_bv, Vector3< typename BV::S > *vertices, Triangle *tri_indices, const Transform3< typename BV::S > &tf1, const Transform3< typename BV::S > &tf2, const MotionBase< typename BV::S > *motion1, const MotionBase< typename BV::S > *motion2, const NarrowPhaseSolver *nsolver, bool enable_statistics, typename BV::S &min_distance, Vector3< typename BV::S > &p1, Vector3< typename BV::S > &p2, int &last_tri_id, typename BV::S &delta_t, int &num_leaf_tests)
Definition: mesh_shape_conservative_advancement_traversal_node-inl.h:217
conservative_advancement_stack_data.h
fcl::detail::ConservativeAdvancementStackData
Definition: conservative_advancement_stack_data.h:50
fcl::detail::MeshShapeConservativeAdvancementTraversalNode::closest_p2
Vector3< S > closest_p2
Definition: mesh_shape_conservative_advancement_traversal_node.h:72
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::MeshShapeConservativeAdvancementTraversalNode::motion2
const MotionBase< S > * motion2
Definition: mesh_shape_conservative_advancement_traversal_node.h:88
fcl::Vector3
Eigen::Matrix< S, 3, 1 > Vector3
Definition: types.h:70
fcl::MotionBase
Definition: bv_motion_bound_visitor.h:45
fcl::detail::MeshShapeConservativeAdvancementTraversalNode::last_tri_id
int last_tri_id
Definition: mesh_shape_conservative_advancement_traversal_node.h:74
fcl::detail::meshShapeConservativeAdvancementOrientedNodeCanStop
bool meshShapeConservativeAdvancementOrientedNodeCanStop(typename BV::S c, typename BV::S min_distance, typename BV::S abs_err, typename BV::S rel_err, typename BV::S w, const BVHModel< BV > *model1, const Shape &model2, const BV &model2_bv, const MotionBase< typename BV::S > *motion1, const MotionBase< typename BV::S > *motion2, std::vector< ConservativeAdvancementStackData< typename BV::S >> &stack, typename BV::S &delta_t)
Definition: mesh_shape_conservative_advancement_traversal_node-inl.h:285
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::MeshShapeConservativeAdvancementTraversalNode::t_err
S t_err
Definition: mesh_shape_conservative_advancement_traversal_node.h:81
fcl::detail::MeshShapeConservativeAdvancementTraversalNode::toc
S toc
The time from beginning point.
Definition: mesh_shape_conservative_advancement_traversal_node.h:80
fcl::OBBRSS
Class merging the OBB and RSS, can handle collision and distance simultaneously.
Definition: OBBRSS.h:50
fcl::detail::MeshShapeConservativeAdvancementTraversalNode::stack
std::vector< ConservativeAdvancementStackData< S > > stack
Definition: mesh_shape_conservative_advancement_traversal_node.h:90
mesh_shape_distance_traversal_node.h
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::MeshShapeConservativeAdvancementTraversalNodeOBBRSS
Definition: mesh_shape_conservative_advancement_traversal_node.h:171
fcl::detail::MeshShapeConservativeAdvancementTraversalNodeRSS
Definition: mesh_shape_conservative_advancement_traversal_node.h:143
fcl::detail::MeshShapeConservativeAdvancementTraversalNode::motion1
const MotionBase< S > * motion1
Motions for the two objects in query.
Definition: mesh_shape_conservative_advancement_traversal_node.h:87
fcl::detail::BVHShapeDistanceTraversalNode< RSS< Shape::S >, Shape >::S
typename RSS< Shape::S > ::S S
Definition: bvh_shape_distance_traversal_node.h:57
fcl::detail::MeshShapeConservativeAdvancementTraversalNode::min_distance
S min_distance
Definition: mesh_shape_conservative_advancement_traversal_node.h:70
fcl::detail::MeshShapeConservativeAdvancementTraversalNode::w
S w
CA controlling variable: early stop for the early iterations of CA.
Definition: mesh_shape_conservative_advancement_traversal_node.h:77
fcl::detail::MeshShapeConservativeAdvancementTraversalNode
Traversal node for conservative advancement computation between BVH and shape.
Definition: mesh_shape_conservative_advancement_traversal_node.h:52
fcl
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
mesh_shape_conservative_advancement_traversal_node-inl.h


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