collision_request.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_COLLISIONREQUEST_H
39 #define FCL_COLLISIONREQUEST_H
40 
41 #include "fcl/common/types.h"
43 
44 namespace fcl
45 {
46 
47 template <typename S>
49 
51 template <typename S>
52 struct FCL_EXPORT CollisionRequest
53 {
56  typedef typename Eigen::NumTraits<S>::Real Real;
57 
60 
64 
65  // TODO(SeanCurtis-TRI): Provide clear definitions for what "cost sources"
66  // are.
67 
70 
73 
76 
79 
80  // TODO(SeanCurtis-TRI): Consider swapping these *two* parameters with a
81  // single std::optional<Vector3<S>>.
84 
87 
88  // TODO(SeanCurtis-TRI): Document the implications of this tolerance; right
89  // now it is not clear *at all* what turning this knob will do to the results.
94  Real gjk_tolerance{1e-6};
95 
97  CollisionRequest(size_t num_max_contacts_ = 1,
98  bool enable_contact_ = false,
99  size_t num_max_cost_sources_ = 1,
100  bool enable_cost_ = false,
101  bool use_approximate_cost_ = true,
102  GJKSolverType gjk_solver_type_ = GST_LIBCCD,
103  Real gjk_tolerance_ = 1e-6);
104 
105  bool isSatisfied(const CollisionResult<S>& result) const;
106 };
107 
110 
111 } // namespace fcl
112 
114 
115 #endif
fcl::CollisionRequest::Real
Eigen::NumTraits< S >::Real Real
Definition: collision_request.h:56
fcl::CollisionRequest::gjk_solver_type
GJKSolverType gjk_solver_type
Enumeration indicating the GJK solver implementation to use.
Definition: collision_request.h:78
collision_request-inl.h
fcl::GJKSolverType
GJKSolverType
Type of narrow phase GJK solver.
Definition: gjk_solver_type.h:45
fcl::CollisionRequest::num_max_contacts
size_t num_max_contacts
The maximum number of contacts that can be returned.
Definition: collision_request.h:59
types.h
gjk_solver_type.h
fcl::CollisionRequest::num_max_cost_sources
size_t num_max_cost_sources
The maximum number of cost sources that can be returned.
Definition: collision_request.h:69
fcl::CollisionResult
collision result
Definition: collision_request.h:48
fcl::Vector3
Eigen::Matrix< S, 3, 1 > Vector3
Definition: types.h:70
fcl::CollisionRequest::enable_cost
bool enable_cost
If true, the cost sources will be computed.
Definition: collision_request.h:72
fcl::GST_LIBCCD
@ GST_LIBCCD
Definition: gjk_solver_type.h:45
fcl::CollisionRequest
Parameters for performing collision request.
Definition: collision_request.h:52
fcl::CollisionRequest::use_approximate_cost
bool use_approximate_cost
If true, the cost computation is approximated (if computed).
Definition: collision_request.h:75
fcl::CollisionRequest::enable_cached_gjk_guess
bool enable_cached_gjk_guess
If true, uses the provided initial guess for the GJK algorithm.
Definition: collision_request.h:83
fcl::CollisionRequest::cached_gjk_guess
Vector3< S > cached_gjk_guess
The initial guess to use in the GJK algorithm.
Definition: collision_request.h:86
fcl::CollisionRequest::enable_contact
bool enable_contact
If true, contact information (e.g., normal, penetration depth, and contact position) will be returned...
Definition: collision_request.h:63
fcl
Main namespace.
Definition: broadphase_bruteforce-inl.h:45


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