Gazebo Math

API Reference

8.3.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/Plane.hh"
24#include "gz/math/Quaternion.hh"
25
26namespace gz::math
27{
28 // Inline bracket to help doxygen filtering.
29 inline namespace GZ_MATH_VERSION_NAMESPACE {
30 //
42 template<typename Precision>
44 {
48 public: Cylinder() = default;
49
58
66 const Material &_mat,
69
72 public: Precision Radius() const;
73
76 public: void SetRadius(const Precision _radius);
77
80 public: Precision Length() const;
81
84 public: void SetLength(const Precision _length);
85
92
97 public: void SetRotationalOffset(
99
102 public: const Material &Mat() const;
103
106 public: void SetMat(const Material &_mat);
107
116 public: bool MassMatrix(MassMatrix3d &_massMat) const;
117
124 public: std::optional< MassMatrix3<Precision> > MassMatrix() const;
125
128 public: bool operator==(const Cylinder &_cylinder) const;
129
132 public: Precision Volume() const;
133
140
148 public: std::optional<Vector3<Precision>>
150
156
166
179 public: bool SetDensityFromMass(const Precision _mass);
180
182 private: Precision radius = 0.0;
183
185 private: Precision length = 0.0;
186
188 private: Material material;
189
191 private: Quaternion<Precision> rotOffset =
193 };
194
198
202
206 } // namespace GZ_MATH_VERSION_NAMESPACE
207} // namespace gz::math
208#include "gz/math/detail/Cylinder.hh"
209#endif // GZ_MATH_CYLINDER_HH_