coal 3.0.1
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
Loading...
Searching...
No Matches
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
45namespace coal {
46
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&);
64 const CollisionObject* o2,
65 const CollisionResult& collision_result,
66 const ContactPatchRequest& request,
67 ContactPatchResult& result);
68
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
108 ContactPatchFunctionMatrix::ContactPatchFunc func;
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
The geometry for the object for collision or distance computation.
Definition collision_object.h:96
the object for collision or distance computation, contains the geometry and the transform information
Definition collision_object.h:216
This class reduces the cost of identifying the geometry pair. This is usefull for repeated shape-shap...
Definition contact_patch.h:77
const CollisionGeometry * o1
Definition contact_patch.h:103
void operator()(const Transform3s &tf1, const Transform3s &tf2, const CollisionResult &collision_result, const ContactPatchRequest &request, ContactPatchResult &result) const
ComputeContactPatch(const CollisionGeometry *o1, const CollisionGeometry *o2)
Default constructor from two Collision Geometries.
bool operator==(const ComputeContactPatch &other) const
Definition contact_patch.h:87
ContactPatchSolver csolver
Definition contact_patch.h:106
virtual ~ComputeContactPatch()=default
const CollisionGeometry * o2
Definition contact_patch.h:104
bool swap_geoms
Definition contact_patch.h:109
bool operator!=(const ComputeContactPatch &other) const
Definition contact_patch.h:92
ContactPatchFunctionMatrix::ContactPatchFunc func
Definition contact_patch.h:108
virtual void run(const Transform3s &tf1, const Transform3s &tf2, const CollisionResult &collision_result, const ContactPatchRequest &request, ContactPatchResult &result) const
Simple transform class used locally by InterpMotion.
Definition transform.h:55
#define COAL_DLLAPI
Definition config.hh:88
Main namespace.
Definition broadphase_bruteforce.h:44
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.
collision result
Definition collision_data.h:390
Request for a contact patch computation.
Definition collision_data.h:723
Result for a contact patch computation.
Definition collision_data.h:821
Solver to compute contact patches, i.e. the intersection between two contact surfaces projected onto ...
Definition contact_patch_solver.h:59