hpp-fcl  3.0.0
HPP fork of FCL -- The Flexible Collision Library
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 HPP_FCL_CONTACT_PATCH_H
38 #define HPP_FCL_CONTACT_PATCH_H
39 
40 #include "hpp/fcl/data_types.h"
41 #include "hpp/fcl/collision_data.h"
44 
45 namespace hpp {
46 namespace fcl {
47 
54  const Transform3f& tf1,
55  const CollisionGeometry* o2,
56  const Transform3f& tf2,
57  const CollisionResult& collision_result,
58  const ContactPatchRequest& request,
59  ContactPatchResult& result);
60 
62 // const CollisionGeometry*, const Transform3f&, const CollisionResult&, const
63 // ContactPatchRequest&, ContactPatchResult&);
65  const CollisionObject* o2,
66  const CollisionResult& collision_result,
67  const ContactPatchRequest& request,
68  ContactPatchResult& result);
69 
79  public:
82 
83  void operator()(const Transform3f& tf1, const Transform3f& tf2,
84  const CollisionResult& collision_result,
85  const ContactPatchRequest& request,
86  ContactPatchResult& result) const;
87 
88  bool operator==(const ComputeContactPatch& other) const {
89  return this->o1 == other.o1 && this->o2 == other.o2 &&
90  this->csolver == other.csolver;
91  }
92 
93  bool operator!=(const ComputeContactPatch& other) const {
94  return !(*this == other);
95  }
96 
97  virtual ~ComputeContactPatch() = default;
98 
99  protected:
100  // These pointers are made mutable to let the derived classes to update
101  // their values when updating the collision geometry (e.g. creating a new
102  // one). This feature should be used carefully to avoid any mis usage (e.g,
103  // changing the type of the collision geometry should be avoided).
104  mutable const CollisionGeometry* o1;
105  mutable const CollisionGeometry* o2;
106 
108 
111 
112  virtual void run(const Transform3f& tf1, const Transform3f& tf2,
113  const CollisionResult& collision_result,
114  const ContactPatchRequest& request,
115  ContactPatchResult& result) const;
116 
117  public:
118  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
119 };
120 
121 } // namespace fcl
122 } // namespace hpp
123 
124 #endif
The geometry for the object for collision or distance computation.
Definition: collision_object.h:95
the object for collision or distance computation, contains the geometry and the transform information
Definition: collision_object.h:215
This class reduces the cost of identifying the geometry pair. This is usefull for repeated shape-shap...
Definition: contact_patch.h:78
void operator()(const Transform3f &tf1, const Transform3f &tf2, const CollisionResult &collision_result, const ContactPatchRequest &request, ContactPatchResult &result) const
virtual ~ComputeContactPatch()=default
const CollisionGeometry * o1
Definition: contact_patch.h:104
bool operator!=(const ComputeContactPatch &other) const
Definition: contact_patch.h:93
const CollisionGeometry * o2
Definition: contact_patch.h:105
ContactPatchSolver csolver
Definition: contact_patch.h:107
ComputeContactPatch(const CollisionGeometry *o1, const CollisionGeometry *o2)
Default constructor from two Collision Geometries.
virtual void run(const Transform3f &tf1, const Transform3f &tf2, const CollisionResult &collision_result, const ContactPatchRequest &request, ContactPatchResult &result) const
bool operator==(const ComputeContactPatch &other) const
Definition: contact_patch.h:88
bool swap_geoms
Definition: contact_patch.h:110
ContactPatchFunctionMatrix::ContactPatchFunc func
Definition: contact_patch.h:109
Simple transform class used locally by InterpMotion.
Definition: transform.h:56
#define HPP_FCL_DLLAPI
Definition: config.hh:88
void computeContactPatch(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const CollisionResult &collision_result, const ContactPatchRequest &request, ContactPatchResult &result)
Main contact patch computation interface.
Main namespace.
Definition: broadphase_bruteforce.h:44
collision result
Definition: collision_data.h:391
void(* ContactPatchFunc)(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &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: contact_patch_func_matrix.h:68
Request for a contact patch computation.
Definition: collision_data.h:726
Result for a contact patch computation.
Definition: collision_data.h:824
Solver to compute contact patches, i.e. the intersection between two contact surfaces projected onto ...
Definition: contact_patch_solver.h:60