CustomInertiaCalcProperties.hh
Go to the documentation of this file.
1/*
2 * Copyright 2023 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
18#ifndef SDF_CUSTOM_INERTIA_CALC_PROPERTIES_HH_
19#define SDF_CUSTOM_INERTIA_CALC_PROPERTIES_HH_
20
21#include <optional>
22
23#include <gz/utils/ImplPtr.hh>
24#include <gz/math/Inertial.hh>
25
26#include "sdf/Element.hh"
27#include "sdf/Mesh.hh"
28#include "sdf/config.hh"
29#include "sdf/Types.hh"
30#include "sdf/Error.hh"
31
32namespace sdf
33{
34inline namespace SDF_VERSION_NAMESPACE
35{
36
37// Forward Declarations
38class Mesh;
39
41{
44
49 public: CustomInertiaCalcProperties(const double _density,
50 const sdf::Mesh _mesh,
51 const sdf::ElementPtr _calculatorParams);
52
55 public: double Density() const;
56
59 public: void SetDensity(double _density);
60
63 public: const std::optional<sdf::Mesh> &Mesh() const;
64
67 public: void SetMesh(sdf::Mesh &_mesh);
68
72 public: const sdf::ElementPtr AutoInertiaParams() const;
73
76 public: void SetAutoInertiaParams(sdf::ElementPtr _autoInertiaParamsElem);
77
79 GZ_UTILS_IMPL_PTR(dataPtr)
80};
81
83 std::function<std::optional<gz::math::Inertiald>(sdf::Errors &,
85}
86}
87
88#endif
Definition: CustomInertiaCalcProperties.hh:41
const sdf::ElementPtr AutoInertiaParams() const
Get the reference to the <auto_inertia_params> sdf element.
double Density() const
Get the density of the mesh.
const std::optional< sdf::Mesh > & Mesh() const
Get the reference to the mesh oject being used.
void SetDensity(double _density)
Function to set the density of the interface object.
void SetAutoInertiaParams(sdf::ElementPtr _autoInertiaParamsElem)
Function to set the calculator params sdf element object.
CustomInertiaCalcProperties(const double _density, const sdf::Mesh _mesh, const sdf::ElementPtr _calculatorParams)
Constructor with mesh properties.
void SetMesh(sdf::Mesh &_mesh)
Function to set the mesh object.
Mesh represents a mesh shape, and is usually accessed through a Geometry.
Definition: Mesh.hh:43
std::function< std::optional< gz::math::Inertiald >(sdf::Errors &, const sdf::CustomInertiaCalcProperties &)> CustomInertiaCalculator
Definition: CustomInertiaCalcProperties.hh:84
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:95
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:55
namespace for Simulation Description Format parser
Definition: Actor.hh:35
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:25