Gazebo Math
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-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/Quaternion.hh
"
24
25
namespace
gz::math
26
{
27
// Inline bracket to help doxygen filtering.
28
inline
namespace
GZ_MATH_VERSION_NAMESPACE {
29
//
38
template
<
typename
Precision>
39
class
Cylinder
40
{
44
public
:
Cylinder
() =
default
;
45
51
public
:
Cylinder
(
const
Precision
_length
,
const
Precision
_radius
,
52
const
Quaternion<Precision>
&
_rotOffset
=
53
Quaternion<Precision>::Identity
);
54
61
public
:
Cylinder
(
const
Precision
_length
,
const
Precision
_radius
,
62
const
Material
&
_mat
,
63
const
Quaternion<Precision>
&
_rotOffset
=
64
Quaternion<Precision>::Identity
);
65
68
public
:
Precision
Radius
()
const
;
69
72
public
:
void
SetRadius
(
const
Precision
_radius
);
73
76
public
:
Precision
Length
()
const
;
77
80
public
:
void
SetLength
(
const
Precision
_length
);
81
87
public
:
Quaternion<Precision>
RotationalOffset
()
const
;
88
93
public
:
void
SetRotationalOffset
(
94
const
Quaternion<Precision>
&
_rotOffset
);
95
98
public
:
const
Material
&
Mat
()
const
;
99
102
public
:
void
SetMat
(
const
Material
&
_mat
);
103
112
public
:
bool
MassMatrix
(
MassMatrix3d
&
_massMat
)
const
;
113
120
public
: std::optional< MassMatrix3<Precision> >
MassMatrix
()
const
;
121
124
public
:
bool
operator==
(
const
Cylinder
&
_cylinder
)
const
;
125
128
public
:
Precision
Volume
()
const
;
129
138
public
:
Precision
DensityFromMass
(
const
Precision
_mass
)
const
;
139
152
public
:
bool
SetDensityFromMass
(
const
Precision
_mass
);
153
155
private
:
Precision
radius = 0.0;
156
158
private
:
Precision
length = 0.0;
159
161
private
:
Material
material;
162
164
private
:
Quaternion<Precision>
rotOffset =
165
Quaternion<Precision>::Identity
;
166
};
167
170
typedef
Cylinder<int>
Cylinderi
;
171
174
typedef
Cylinder<double>
Cylinderd
;
175
178
typedef
Cylinder<float>
Cylinderf
;
179
}
// namespace GZ_MATH_VERSION_NAMESPACE
180
}
// namespace gz::math
181
#include "gz/math/detail/Cylinder.hh"
182
#endif
// GZ_MATH_CYLINDER_HH_