coal/contact_patch.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2024, INRIA
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of INRIA nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */
34 
37 #ifndef COAL_CONTACT_PATCH_H
38 #define COAL_CONTACT_PATCH_H
39 
40 #include "coal/data_types.h"
41 #include "coal/collision_data.h"
44 
45 namespace coal {
46 
52 COAL_DLLAPI void computeContactPatch(const CollisionGeometry* o1,
53  const Transform3s& tf1,
54  const CollisionGeometry* o2,
55  const Transform3s& tf2,
56  const CollisionResult& collision_result,
57  const ContactPatchRequest& request,
58  ContactPatchResult& result);
59 
61 // const CollisionGeometry*, const Transform3s&, const CollisionResult&, const
62 // ContactPatchRequest&, ContactPatchResult&);
63 COAL_DLLAPI void computeContactPatch(const CollisionObject* o1,
64  const CollisionObject* o2,
65  const CollisionResult& collision_result,
66  const ContactPatchRequest& request,
67  ContactPatchResult& result);
68 
77 class COAL_DLLAPI ComputeContactPatch {
78  public:
81 
82  void operator()(const Transform3s& tf1, const Transform3s& tf2,
83  const CollisionResult& collision_result,
84  const ContactPatchRequest& request,
85  ContactPatchResult& result) const;
86 
87  bool operator==(const ComputeContactPatch& other) const {
88  return this->o1 == other.o1 && this->o2 == other.o2 &&
89  this->csolver == other.csolver;
90  }
91 
92  bool operator!=(const ComputeContactPatch& other) const {
93  return !(*this == other);
94  }
95 
96  virtual ~ComputeContactPatch() = default;
97 
98  protected:
99  // These pointers are made mutable to let the derived classes to update
100  // their values when updating the collision geometry (e.g. creating a new
101  // one). This feature should be used carefully to avoid any mis usage (e.g,
102  // changing the type of the collision geometry should be avoided).
103  mutable const CollisionGeometry* o1;
104  mutable const CollisionGeometry* o2;
105 
107 
110 
111  virtual void run(const Transform3s& tf1, const Transform3s& tf2,
112  const CollisionResult& collision_result,
113  const ContactPatchRequest& request,
114  ContactPatchResult& result) const;
115 
116  public:
117  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
118 };
119 
120 } // namespace coal
121 
122 #endif
contact_patch_func_matrix.h
coal::ComputeContactPatch::operator!=
bool operator!=(const ComputeContactPatch &other) const
Definition: coal/contact_patch.h:92
gjk.tf1
tuple tf1
Definition: test/scripts/gjk.py:27
collision_data.h
coal
Main namespace.
Definition: coal/broadphase/broadphase_bruteforce.h:44
coal::CollisionGeometry
The geometry for the object for collision or distance computation.
Definition: coal/collision_object.h:94
coal::Transform3s
Simple transform class used locally by InterpMotion.
Definition: coal/math/transform.h:55
coal::CollisionResult
collision result
Definition: coal/collision_data.h:390
coal::ComputeContactPatch::o2
const CollisionGeometry * o2
Definition: coal/contact_patch.h:104
coal::ComputeContactPatch::func
ContactPatchFunctionMatrix::ContactPatchFunc func
Definition: coal/contact_patch.h:108
coal::computeContactPatch
COAL_DLLAPI void computeContactPatch(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const CollisionResult &collision_result, const ContactPatchRequest &request, ContactPatchResult &result)
Main contact patch computation interface.
Definition: src/contact_patch.cpp:47
gjk.tf2
tuple tf2
Definition: test/scripts/gjk.py:36
coal::ComputeContactPatch::swap_geoms
bool swap_geoms
Definition: coal/contact_patch.h:109
coal::ContactPatchFunctionMatrix::ContactPatchFunc
void(* ContactPatchFunc)(const CollisionGeometry *o1, const Transform3s &tf1, const CollisionGeometry *o2, const Transform3s &tf2, const CollisionResult &collision_result, const ContactPatchSolver *csolver, const ContactPatchRequest &request, ContactPatchResult &result)
the uniform call interface for computing contact patches: we need know
Definition: coal/contact_patch_func_matrix.h:67
coal::ContactPatchResult
Result for a contact patch computation.
Definition: coal/collision_data.h:822
omniidl_be_python_with_docstring.run
def run(tree, args)
Definition: omniidl_be_python_with_docstring.py:140
coal::ContactPatchRequest
Request for a contact patch computation.
Definition: coal/collision_data.h:724
coal::ComputeContactPatch::csolver
ContactPatchSolver csolver
Definition: coal/contact_patch.h:106
coal::ComputeContactPatch::o1
const CollisionGeometry * o1
Definition: coal/contact_patch.h:103
coal::ComputeContactPatch
This class reduces the cost of identifying the geometry pair. This is usefull for repeated shape-shap...
Definition: coal/contact_patch.h:77
coal::ComputeContactPatch::operator==
bool operator==(const ComputeContactPatch &other) const
Definition: coal/contact_patch.h:87
coal::ContactPatchSolver
Solver to compute contact patches, i.e. the intersection between two contact surfaces projected onto ...
Definition: coal/contact_patch/contact_patch_solver.h:59
contact_patch_solver.h
data_types.h


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:57