collision_request-inl.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_INL_H
39 #define FCL_COLLISIONREQUEST_INL_H
40 
42 
44 
45 namespace fcl
46 {
47 
48 //==============================================================================
49 extern template
50 struct CollisionRequest<double>;
51 
52 //==============================================================================
53 template <typename S>
55  size_t num_max_contacts_,
56  bool enable_contact_,
57  size_t num_max_cost_sources_,
58  bool enable_cost_,
59  bool use_approximate_cost_,
60  GJKSolverType gjk_solver_type_,
61  Real gjk_tolerance_)
62  : num_max_contacts(num_max_contacts_),
63  enable_contact(enable_contact_),
64  num_max_cost_sources(num_max_cost_sources_),
65  enable_cost(enable_cost_),
66  use_approximate_cost(use_approximate_cost_),
67  gjk_solver_type(gjk_solver_type_),
68  enable_cached_gjk_guess(false),
69  cached_gjk_guess(Vector3<S>::UnitX()),
70  gjk_tolerance(gjk_tolerance_)
71 {
72  // Do nothing
73 }
74 
75 //==============================================================================
76 template <typename S>
78 {
79  return (!enable_cost)
80  && result.isCollision()
81  && (num_max_contacts <= result.numContacts());
82 }
83 
84 } // namespace fcl
85 
86 #endif
fcl::GJKSolverType
GJKSolverType
Type of narrow phase GJK solver.
Definition: gjk_solver_type.h:45
fcl::CollisionResult::isCollision
bool isCollision() const
return binary collision result
Definition: collision_result-inl.h:76
fcl::CollisionResult
collision result
Definition: collision_request.h:48
fcl::Vector3
Eigen::Matrix< S, 3, 1 > Vector3
Definition: types.h:70
fcl::CollisionRequest
Parameters for performing collision request.
Definition: collision_request.h:52
fcl::CollisionResult::numContacts
size_t numContacts() const
number of contacts found
Definition: collision_result-inl.h:83
fcl::CollisionRequest::CollisionRequest
CollisionRequest(size_t num_max_contacts_=1, bool enable_contact_=false, size_t num_max_cost_sources_=1, bool enable_cost_=false, bool use_approximate_cost_=true, GJKSolverType gjk_solver_type_=GST_LIBCCD, Real gjk_tolerance_=1e-6)
Default constructor.
Definition: collision_request-inl.h:54
collision_result.h
enable_contact
bool enable_contact
Definition: test_fcl_collision.cpp:75
collision_request.h
num_max_contacts
int num_max_contacts
Definition: test_fcl_collision.cpp:74
fcl
Main namespace.
Definition: broadphase_bruteforce-inl.h:45


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