Gazebo Physics
API Reference
7.4.0
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
src
gz-physics
include
gz
physics
GetContacts.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2019 Open Source Robotics Foundation
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
*/
17
18
#ifndef GZ_PHYSICS_GETCONTACTS_HH_
19
#define GZ_PHYSICS_GETCONTACTS_HH_
20
21
#include <vector>
22
#include <
gz/physics/FeatureList.hh
>
23
#include <
gz/physics/ForwardStep.hh
>
24
#include <
gz/physics/Geometry.hh
>
25
#include <
gz/physics/SpecifyData.hh
>
26
27
namespace
gz
28
{
29
namespace
physics
30
{
33
class
GZ_PHYSICS_VISIBLE
GetContactsFromLastStepFeature
34
:
public
virtual
FeatureWithRequirements
<ForwardStep>
35
{
36
public
:
template
<
typename
PolicyT>
37
struct
ExtraContactDataT
38
{
39
using
Scalar
=
typename
PolicyT::Scalar;
40
using
VectorType
=
typename
FromPolicy<PolicyT>::template
Use<Vector>;
41
44
VectorType
force
;
47
VectorType
normal
;
49
Scalar
depth
;
50
};
51
52
public
:
template
<
typename
PolicyT,
typename
FeaturesT>
53
class
World
:
public
virtual
Feature::World
<PolicyT, FeaturesT>
54
{
55
public
:
using
Scalar
=
typename
PolicyT::Scalar;
56
public
:
using
ShapePtrType
= ShapePtr<PolicyT, FeaturesT>;
57
public
:
using
VectorType
=
58
typename
FromPolicy<PolicyT>::template
Use<Vector>;
59
public
:
using
ExtraContactData
=
ExtraContactDataT<PolicyT>
;
60
61
public
:
struct
ContactPoint
62
{
64
ShapePtrType
collision1
;
66
ShapePtrType
collision2
;
68
VectorType
point
;
69
};
70
71
public
:
using
Contact
=
SpecifyData
<
72
RequireData<ContactPoint>,
73
ExpectData<ExtraContactData> >;
74
76
public
:
std::vector<Contact>
GetContactsFromLastStep
()
const
;
77
};
78
79
public
:
template
<
typename
PolicyT>
80
class
Implementation
:
public
virtual
Feature::Implementation
<PolicyT>
81
{
82
public
:
using
Scalar
=
typename
PolicyT::Scalar;
83
public
:
using
VectorType
=
84
typename
FromPolicy<PolicyT>::template
Use<Vector>;
85
public
:
using
ExtraContactData
=
ExtraContactDataT<PolicyT>
;
86
87
public
:
struct
ContactInternal
88
{
90
Identity
collision1
;
92
Identity
collision2
;
94
VectorType
point
;
96
CompositeData
extraData
;
97
};
98
99
public
:
virtual
std::vector<ContactInternal>
GetContactsFromLastStep
(
100
const
Identity &_worldID)
const
= 0;
101
};
102
};
103
}
104
}
105
106
#include "gz/physics/detail/GetContacts.hh"
107
108
#endif
/* end of include guard: GZ_PHYSICS_GETCONTACTS_HH_ */