Gazebo Math

API Reference

8.0.0
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>
22#include "gz/math/Material.hh"
23#include "gz/math/Quaternion.hh"
24
25namespace gz::math
26{
27 // Inline bracket to help doxygen filtering.
28 inline namespace GZ_MATH_VERSION_NAMESPACE {
29 //
38 template<typename Precision>
40 {
44 public: Cylinder() = default;
45
54
62 const Material &_mat,
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
88
93 public: void SetRotationalOffset(
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
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 =
166 };
167
171
175
179 } // namespace GZ_MATH_VERSION_NAMESPACE
180} // namespace gz::math
181#include "gz/math/detail/Cylinder.hh"
182#endif // GZ_MATH_CYLINDER_HH_