Gazebo Math
API Reference
9.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-math
include
gz
math
Cylinder.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
#ifndef GZ_MATH_CYLINDER_HH_
18
#define GZ_MATH_CYLINDER_HH_
19
20
#include <optional>
21
#include "
gz/math/MassMatrix3.hh
"
22
#include "
gz/math/Material.hh
"
23
#include "
gz/math/Plane.hh
"
24
#include "
gz/math/Quaternion.hh
"
25
26
namespace
gz::math
27
{
28
// Inline bracket to help doxygen filtering.
29
inline
namespace
GZ_MATH_VERSION_NAMESPACE {
30
//
39
template
<
typename
Precision>
40
class
Cylinder
41
{
45
public
:
Cylinder
() =
default
;
46
52
public
:
Cylinder
(
const
Precision
_length
,
const
Precision
_radius
,
53
const
Quaternion<Precision>
&
_rotOffset
=
54
Quaternion<Precision>::Identity
);
55
62
public
:
Cylinder
(
const
Precision
_length
,
const
Precision
_radius
,
63
const
Material
&
_mat
,
64
const
Quaternion<Precision>
&
_rotOffset
=
65
Quaternion<Precision>::Identity
);
66
69
public
:
Precision
Radius
()
const
;
70
73
public
:
void
SetRadius
(
const
Precision
_radius
);
74
77
public
:
Precision
Length
()
const
;
78
81
public
:
void
SetLength
(
const
Precision
_length
);
82
88
public
:
Quaternion<Precision>
RotationalOffset
()
const
;
89
94
public
:
void
SetRotationalOffset
(
95
const
Quaternion<Precision>
&
_rotOffset
);
96
99
public
:
const
Material
&
Mat
()
const
;
100
103
public
:
void
SetMat
(
const
Material
&
_mat
);
104
113
public
:
bool
MassMatrix
(
MassMatrix3d
&
_massMat
)
const
;
114
121
public
: std::optional< MassMatrix3<Precision> >
MassMatrix
()
const
;
122
125
public
:
bool
operator==
(
const
Cylinder
&
_cylinder
)
const
;
126
129
public
:
Precision
Volume
()
const
;
130
136
public
:
Precision
VolumeBelow
(
const
Plane<Precision>
&
_plane
)
const
;
137
145
public
: std::optional<Vector3<Precision>>
146
CenterOfVolumeBelow
(
const
Plane<Precision>
&
_plane
)
const
;
147
156
public
:
Precision
DensityFromMass
(
const
Precision
_mass
)
const
;
157
170
public
:
bool
SetDensityFromMass
(
const
Precision
_mass
);
171
173
private
:
Precision
radius = 0.0;
174
176
private
:
Precision
length = 0.0;
177
179
private
:
Material
material;
180
182
private
:
Quaternion<Precision>
rotOffset =
183
Quaternion<Precision>::Identity
;
184
};
185
188
typedef
Cylinder<int>
Cylinderi
;
189
192
typedef
Cylinder<double>
Cylinderd
;
193
196
typedef
Cylinder<float>
Cylinderf
;
197
}
// namespace GZ_MATH_VERSION_NAMESPACE
198
}
// namespace gz::math
199
#include "gz/math/detail/Cylinder.hh"
200
#endif
// GZ_MATH_CYLINDER_HH_