Gazebo Math
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
include
gz
math
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/Quaternion.hh
"
24
25
namespace
gz
26
{
27
namespace
math
28
{
29
// Foward declarations
30
class
CylinderPrivate;
31
32
// Inline bracket to help doxygen filtering.
33
inline
namespace
GZ_MATH_VERSION_NAMESPACE {
34
//
43
template
<
typename
Precision>
44
class
Cylinder
45
{
49
public
:
Cylinder
() =
default
;
50
56
public
:
Cylinder
(
const
Precision _length,
const
Precision _radius,
57
const
Quaternion<Precision>
&_rotOffset =
58
Quaternion<Precision>::Identity
);
59
66
public
:
Cylinder
(
const
Precision _length,
const
Precision _radius,
67
const
Material
&_mat,
68
const
Quaternion<Precision>
&_rotOffset =
69
Quaternion<Precision>::Identity
);
70
73
public
: Precision
Radius
()
const
;
74
77
public
:
void
SetRadius
(
const
Precision _radius);
78
81
public
: Precision
Length
()
const
;
82
85
public
:
void
SetLength
(
const
Precision _length);
86
92
public
:
Quaternion<Precision>
RotationalOffset
()
const
;
93
98
public
:
void
SetRotationalOffset
(
99
const
Quaternion<Precision>
&_rotOffset);
100
103
public
:
const
Material
&
Mat
()
const
;
104
107
public
:
void
SetMat
(
const
Material
&_mat);
108
117
public
:
bool
MassMatrix
(
MassMatrix3d
&_massMat)
const
;
118
125
public
: std::optional< MassMatrix3<Precision> >
MassMatrix
()
const
;
126
129
public
:
bool
operator==
(
const
Cylinder
&_cylinder)
const
;
130
133
public
: Precision
Volume
()
const
;
134
143
public
: Precision
DensityFromMass
(
const
Precision _mass)
const
;
144
157
public
:
bool
SetDensityFromMass
(
const
Precision _mass);
158
160
private
: Precision radius = 0.0;
161
163
private
: Precision length = 0.0;
164
166
private
:
Material
material;
167
169
private
:
Quaternion<Precision>
rotOffset =
170
Quaternion<Precision>::Identity
;
171
};
172
175
typedef
Cylinder<int>
Cylinderi
;
176
179
typedef
Cylinder<double>
Cylinderd
;
180
183
typedef
Cylinder<float>
Cylinderf
;
184
}
185
}
186
}
187
#include "gz/math/detail/Cylinder.hh"
188
189
#endif