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
collision.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-2015, Open Source Robotics Foundation
6 * Copyright (c) 2021, INRIA
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * * Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * * Redistributions in binary form must reproduce the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer in the documentation and/or other materials provided
18 * with the distribution.
19 * * Neither the name of Open Source Robotics Foundation nor the names of its
20 * contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
39#ifndef COAL_COLLISION_H
40#define COAL_COLLISION_H
41
42#include "coal/data_types.h"
44#include "coal/collision_data.h"
46#include "coal/timings.h"
47
48namespace coal {
49
57COAL_DLLAPI std::size_t collide(const CollisionObject* o1,
58 const CollisionObject* o2,
59 const CollisionRequest& request,
60 CollisionResult& result);
61
65 const Transform3s& tf1,
66 const CollisionGeometry* o2,
67 const Transform3s& tf2,
68 const CollisionRequest& request,
69 CollisionResult& result);
70
79 public:
82
83 std::size_t operator()(const Transform3s& tf1, const Transform3s& tf2,
84 const CollisionRequest& request,
85 CollisionResult& result) const;
86
87 bool operator==(const ComputeCollision& other) const {
88 return o1 == other.o1 && o2 == other.o2 && solver == other.solver;
89 }
90
91 bool operator!=(const ComputeCollision& other) const {
92 return !(*this == other);
93 }
94
95 virtual ~ComputeCollision() {};
96
97 protected:
98 // These pointers are made mutable to let the derived classes to update
99 // their values when updating the collision geometry (e.g. creating a new
100 // one). This feature should be used carefully to avoid any mis usage (e.g,
101 // changing the type of the collision geometry should be avoided).
102 mutable const CollisionGeometry* o1;
103 mutable const CollisionGeometry* o2;
104
106
107 CollisionFunctionMatrix::CollisionFunc func;
109
110 virtual std::size_t run(const Transform3s& tf1, const Transform3s& tf2,
111 const CollisionRequest& request,
112 CollisionResult& result) const;
113
114 public:
115 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
116};
117
118} // namespace coal
119
120#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 mostly useful for repeated shap...
Definition collision.h:78
virtual ~ComputeCollision()
Definition collision.h:95
const CollisionGeometry * o1
Definition collision.h:102
bool operator==(const ComputeCollision &other) const
Definition collision.h:87
const CollisionGeometry * o2
Definition collision.h:103
GJKSolver solver
Definition collision.h:105
ComputeCollision(const CollisionGeometry *o1, const CollisionGeometry *o2)
Default constructor from two Collision Geometries.
virtual std::size_t run(const Transform3s &tf1, const Transform3s &tf2, const CollisionRequest &request, CollisionResult &result) const
bool operator!=(const ComputeCollision &other) const
Definition collision.h:91
CollisionFunctionMatrix::CollisionFunc func
Definition collision.h:107
std::size_t operator()(const Transform3s &tf1, const Transform3s &tf2, const CollisionRequest &request, CollisionResult &result) const
bool swap_geoms
Definition collision.h:108
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
std::size_t collide(const CollisionObject *o1, const CollisionObject *o2, const CollisionRequest &request, CollisionResult &result)
Main collision interface: given two collision objects, and the requirements for contacts,...
request to the collision algorithm
Definition collision_data.h:311
collision result
Definition collision_data.h:390
collision and distance solver based on the GJK and EPA algorithms. Originally, GJK and EPA were imple...
Definition narrowphase.h:57