Gazebo Math
API Reference
7.6.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
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
// Foward declarations
29
class
CylinderPrivate;
30
31
// Inline bracket to help doxygen filtering.
32
inline
namespace
GZ_MATH_VERSION_NAMESPACE {
33
//
45
template
<
typename
Precision>
46
class
Cylinder
47
{
51
public
:
Cylinder
() =
default
;
52
58
public
:
Cylinder
(
const
Precision _length,
const
Precision _radius,
59
const
Quaternion<Precision>
&_rotOffset =
60
Quaternion<Precision>::Identity
);
61
68
public
:
Cylinder
(
const
Precision _length,
const
Precision _radius,
69
const
Material
&_mat,
70
const
Quaternion<Precision>
&_rotOffset =
71
Quaternion<Precision>::Identity
);
72
75
public
: Precision
Radius
()
const
;
76
79
public
:
void
SetRadius
(
const
Precision _radius);
80
83
public
: Precision
Length
()
const
;
84
87
public
:
void
SetLength
(
const
Precision _length);
88
94
public
:
Quaternion<Precision>
RotationalOffset
()
const
;
95
100
public
:
void
SetRotationalOffset
(
101
const
Quaternion<Precision>
&_rotOffset);
102
105
public
:
const
Material
&
Mat
()
const
;
106
109
public
:
void
SetMat
(
const
Material
&_mat);
110
119
public
:
bool
MassMatrix
(
MassMatrix3d
&_massMat)
const
;
120
127
public
: std::optional< MassMatrix3<Precision> >
MassMatrix
()
const
;
128
131
public
:
bool
operator==
(
const
Cylinder
&_cylinder)
const
;
132
135
public
: Precision
Volume
()
const
;
136
142
public
: Precision
VolumeBelow
(
const
Plane<Precision>
&_plane)
const
;
143
151
public
: std::optional<Vector3<Precision>>
152
CenterOfVolumeBelow
(
const
Plane<Precision>
&_plane)
const
;
153
158
public
:
Vector3<Precision>
Centroid
()
const
;
159
168
public
: Precision
DensityFromMass
(
const
Precision _mass)
const
;
169
182
public
:
bool
SetDensityFromMass
(
const
Precision _mass);
183
185
private
: Precision radius = 0.0;
186
188
private
: Precision length = 0.0;
189
191
private
:
Material
material;
192
194
private
:
Quaternion<Precision>
rotOffset =
195
Quaternion<Precision>::Identity
;
196
};
197
200
typedef
Cylinder<int>
Cylinderi
;
201
204
typedef
Cylinder<double>
Cylinderd
;
205
208
typedef
Cylinder<float>
Cylinderf
;
209
}
// namespace GZ_MATH_VERSION_NAMESPACE
210
}
// namespace gz::math
211
#include "gz/math/detail/Cylinder.hh"
212
#endif
// GZ_MATH_CYLINDER_HH_