Gazebo Physics
API Reference
8.0.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
Shape.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2018 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_SHAPE_HH_
19
#define GZ_PHYSICS_SHAPE_HH_
20
21
#include <
gz/physics/FeatureList.hh
>
22
#include <
gz/physics/FrameSemantics.hh
>
23
#include <
gz/physics/RelativeQuantity.hh
>
24
#include <
gz/physics/Geometry.hh
>
25
26
namespace
gz
27
{
28
namespace
physics
29
{
33
class
GZ_PHYSICS_VISIBLE
GetShapeKinematicProperties
34
:
public
virtual
Feature
35
{
36
public
:
template
<
typename
PolicyT,
typename
FeaturesT>
37
class
Shape
:
public
virtual
Feature::Shape
<PolicyT, FeaturesT>
38
{
39
public
:
using
PoseType
=
40
typename
FromPolicy<PolicyT>::template
Use<Pose>;
41
47
public
:
PoseType
GetRelativeTransform
()
const
;
48
};
49
50
public
:
template
<
typename
PolicyT>
51
class
Implementation
:
public
virtual
Feature::Implementation
<PolicyT>
52
{
53
public
:
using
PoseType
=
54
typename
FromPolicy<PolicyT>::template
Use<Pose>;
55
56
public
:
virtual
PoseType
GetShapeRelativeTransform
(
57
const
Identity &_shapeID)
const
= 0;
58
};
59
};
60
62
class
GZ_PHYSICS_VISIBLE
SetShapeKinematicProperties
63
:
public
virtual
Feature
64
{
65
public
:
template
<
typename
PolicyT,
typename
FeaturesT>
66
class
Shape
:
public
virtual
Feature::Shape
<PolicyT, FeaturesT>
67
{
68
public
:
using
PoseType
=
69
typename
FromPolicy<PolicyT>::template
Use<Pose>;
70
77
public
:
void
SetRelativeTransform
(
const
PoseType
&_pose);
78
};
79
80
public
:
template
<
typename
PolicyT>
81
class
Implementation
:
public
virtual
Feature::Implementation
<PolicyT>
82
{
83
public
:
using
PoseType
=
84
typename
FromPolicy<PolicyT>::template
Use<Pose>;
85
86
public
:
virtual
void
SetShapeRelativeTransform
(
87
const
Identity &_shapeID,
const
PoseType
&_pose) = 0;
88
};
89
};
90
94
class
GZ_PHYSICS_VISIBLE
GetShapeCollisionProperties
95
:
public
virtual
Feature
96
{
97
public
:
template
<
typename
PolicyT,
typename
FeaturesT>
98
class
Shape
:
public
virtual
Feature::Shape
<PolicyT, FeaturesT>
99
{
100
public
:
using
Scalar
=
typename
PolicyT::Scalar;
101
108
public
:
Scalar
GetFrictionCoefficient
(
109
const
BaseShapePtr<PolicyT> &_other)
const
;
110
118
public
:
Scalar
GetRestitutionCoefficient
(
119
const
BaseShapePtr<PolicyT> &_other)
const
;
120
};
121
122
public
:
template
<
typename
PolicyT>
123
class
Implementation
:
public
virtual
Feature::Implementation
<PolicyT>
124
{
125
public
:
using
Scalar
=
typename
PolicyT::Scalar;
126
127
public
:
virtual
Scalar
GetFrictionCoefficient
(
128
const
Identity &_shape0,
const
Identity &_shape1)
const
= 0;
129
130
public
:
virtual
Scalar
GetRestitutionCoefficient
(
131
const
Identity &_shape0,
const
Identity &_shape1)
const
= 0;
132
};
133
};
134
138
class
GZ_PHYSICS_VISIBLE
GetShapeBoundingBox
139
:
public
virtual
FeatureWithRequirements
<ShapeFrameSemantics>
140
{
141
public
:
template
<
typename
PolicyT,
typename
FeaturesT>
142
class
Shape
143
:
public
virtual
ShapeFrameSemantics::Shape
<PolicyT, FeaturesT>
144
{
145
public
:
using
AlignedBoxType
=
146
typename
FromPolicy<PolicyT>::template
Use<AlignedBox>;
147
157
public
:
AlignedBoxType
GetAxisAlignedBoundingBox
(
158
const
FrameID
&_referenceFrame = FrameID::World())
const
;
159
};
160
161
public
:
template
<
typename
PolicyT>
162
class
Implementation
:
public
virtual
Feature::Implementation
<PolicyT>
163
{
164
public
:
using
AlignedBoxType
=
165
typename
FromPolicy<PolicyT>::template
Use<AlignedBox>;
166
170
public
:
virtual
AlignedBoxType
GetShapeAxisAlignedBoundingBox
(
171
const
Identity &_shape)
const
= 0;
172
};
173
};
174
178
class
GZ_PHYSICS_VISIBLE
SetShapeCollisionProperties
179
:
public
virtual
Feature
180
{
181
public
:
template
<
typename
PolicyT,
typename
FeaturesT>
182
class
Shape
:
public
virtual
Feature::Shape
<PolicyT, FeaturesT>
183
{
184
public
:
using
Scalar
=
typename
PolicyT::Scalar;
185
193
public
:
void
SetFrictionCoefficient
(
194
const
BaseShapePtr<PolicyT> &_other,
Scalar
_value);
195
203
public
:
void
SetRestitutionCoefficient
(
204
const
BaseShapePtr<PolicyT> &_other,
Scalar
_value);
205
};
206
207
public
:
template
<
typename
PolicyT>
208
class
Implementation
:
public
virtual
Feature::Implementation
<PolicyT>
209
{
210
public
:
using
Scalar
=
typename
PolicyT::Scalar;
211
212
public
:
virtual
void
SetShapeFrictionCoefficient
(
213
const
Identity &_shape0,
214
const
Identity &_shape1,
215
Scalar
_value) = 0;
216
217
public
:
virtual
void
SetShapeRestitutionCoefficient
(
218
const
Identity &_shape0,
219
const
Identity &_shape1,
220
Scalar
_value) = 0;
221
};
222
};
223
225
class
GZ_PHYSICS_VISIBLE
CollisionFilterMaskFeature
226
:
public
virtual
Feature
227
{
228
public
:
template
<
typename
PolicyT,
typename
FeaturesT>
229
class
Shape
:
public
virtual
Feature::Shape
<PolicyT, FeaturesT>
230
{
235
public
:
void
SetCollisionFilterMask
(
const
uint16_t _mask);
236
239
public
: uint16_t
GetCollisionFilterMask
()
const
;
240
242
public
:
void
RemoveCollisionFilterMask
();
243
};
244
245
public
:
template
<
typename
PolicyT>
246
class
Implementation
:
public
virtual
Feature::Implementation
<PolicyT>
247
{
248
public
:
virtual
void
SetCollisionFilterMask
(
249
const
Identity &_shapeID,
const
uint16_t _mask) = 0;
250
251
public
:
virtual
uint16_t
GetCollisionFilterMask
(
252
const
Identity &_shapeID)
const
= 0;
253
254
public
:
virtual
void
RemoveCollisionFilterMask
(
255
const
Identity &_shapeID) = 0;
256
};
257
};
258
262
class
GZ_PHYSICS_VISIBLE
GetShapeFrictionPyramidSlipCompliance
263
:
public
virtual
Feature
264
{
265
public
:
template
<
typename
PolicyT,
typename
FeaturesT>
266
class
Shape
:
public
virtual
Feature::Shape
<PolicyT, FeaturesT>
267
{
268
public
:
using
Scalar
=
typename
PolicyT::Scalar;
269
274
public
:
Scalar
GetPrimarySlipCompliance
()
const
;
275
280
public
:
Scalar
GetSecondarySlipCompliance
()
const
;
281
};
282
283
public
:
template
<
typename
PolicyT>
284
class
Implementation
:
public
virtual
Feature::Implementation
<PolicyT>
285
{
286
public
:
using
Scalar
=
typename
PolicyT::Scalar;
287
288
public
:
virtual
Scalar
GetShapeFrictionPyramidPrimarySlipCompliance
(
289
const
Identity &_shapeID)
const
= 0;
290
291
public
:
virtual
Scalar
GetShapeFrictionPyramidSecondarySlipCompliance
(
292
const
Identity &_shapeID)
const
= 0;
293
};
294
};
295
299
class
GZ_PHYSICS_VISIBLE
SetShapeFrictionPyramidSlipCompliance
300
:
public
virtual
Feature
301
{
302
public
:
template
<
typename
PolicyT,
typename
FeaturesT>
303
class
Shape
:
public
virtual
Feature::Shape
<PolicyT, FeaturesT>
304
{
305
public
:
using
Scalar
=
typename
PolicyT::Scalar;
306
313
public
:
bool
SetPrimarySlipCompliance
(
Scalar
_value);
314
321
public
:
bool
SetSecondarySlipCompliance
(
Scalar
_value);
322
};
323
324
public
:
template
<
typename
PolicyT>
325
class
Implementation
:
public
virtual
Feature::Implementation
<PolicyT>
326
{
327
public
:
using
Scalar
=
typename
PolicyT::Scalar;
328
329
public
:
virtual
bool
SetShapeFrictionPyramidPrimarySlipCompliance
(
330
const
Identity &_shapeID,
Scalar
_value) = 0;
331
332
public
:
virtual
bool
SetShapeFrictionPyramidSecondarySlipCompliance
(
333
const
Identity &_shapeID,
Scalar
_value) = 0;
334
};
335
};
336
}
337
}
338
339
#include <gz/physics/detail/Shape.hh>
340
341
#endif