##

MaterialDensity.hh
Go to the documentation of this file.
/*
* Copyright (C) 2016 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _GAZEBO_COMMON_MATERIALDENSITY_HH_
#define _GAZEBO_COMMON_MATERIALDENSITY_HH_
#include <string>
#include <map>
#include <tuple>
#include <ignition/math/Helpers.hh>
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace common
{
enum class MaterialType
{
BEGIN = 0,
STYROFOAM = BEGIN,
PINE,
WOOD,
OAK,
ICE,
WATER,
PLASTIC,
CONCRETE,
ALUMINUM,
STEEL_ALLOY,
STEEL_STAINLESS,
IRON,
BRASS,
COPPER,
TUNGSTEN,
END
};
class GZ_COMMON_VISIBLE MaterialDensity
{
public: static const std::map<MaterialType, double> &Materials();
public: static double Density(const std::string &_material);
public: static double Density(const MaterialType _material);
public: static std::tuple<MaterialType, double> Nearest(
const double _value,
const double _epsilon = ignition::math::MAX_D);
public: static MaterialType NearestMaterial(const double _value,
const double _epsilon = ignition::math::MAX_D);
private: static std::map<MaterialType, double> materials;
};
}
}
#endif
gazebo::common::MaterialType
MaterialType
Types of materials. Source: https://en.wikipedia.org/wiki/Density.
Definition: MaterialDensity.hh:33
gazebo::common::MaterialType::WOOD
Wood, density = 700.0 kg/m^3.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::common::MaterialDensity::Density
static double Density(const std::string &_material)
Return the density of the given material name, or -1 if the material is not found.
gazebo::common::MaterialDensity
Encapsulates density types.
Definition: MaterialDensity.hh:92
common
common
Definition: FuelModelDatabase.hh:37
gazebo::common::MaterialType::PLASTIC
Plastic, density = 1175.0 kg/m^3.
gazebo::common::MaterialType::ICE
Ice, density = 916.0 kg/m^3.
gazebo::common::MaterialType::STEEL_ALLOY
Steel alloy, density = 7600.0 kg/m^3.
gazebo::common::MaterialDensity::Nearest
static std::tuple< MaterialType, double > Nearest(const double _value, const double _epsilon=ignition::math::MAX_D)
Return the material with the closest density value within _epsilon, or MATERIAL_TYPE_END if not found...
system.hh
gazebo::common::MaterialType::IRON
Iron, density = 7870.0 kg/m^3.
gazebo::common::MaterialType::END
gazebo::common::MaterialType::COPPER
Copper, density = 8940.0 kg/m^3.
gazebo::common::MaterialType::WATER
Water, density = 1000.0 kg/m^3.
gazebo::common::MaterialType::TUNGSTEN
Tungsten, density = 19300.0 kg/m^3.
gazebo::common::MaterialDensity::Materials
static const std::map< MaterialType, double > & Materials()
Accessor for retrieving density entries.
gazebo::common::MaterialType::STEEL_STAINLESS
Stainless steel, density = 7800.0 kg/m^3.
gazebo::common::MaterialType::BEGIN
gazebo::common::MaterialType::CONCRETE
Concrete, density = 2000.0 kg/m^3.
gazebo::common::MaterialType::ALUMINUM
Aluminum, density = 2700.0 kg/m^3.
gazebo::common::MaterialDensity::NearestMaterial
static MaterialType NearestMaterial(const double _value, const double _epsilon=ignition::math::MAX_D)
Return the material with the closest density value within _epsilon, or MATERIAL_TYPE_END if not found...
gazebo::common::MaterialType::OAK
Oak, density = 710.0 kg/m^3.
gazebo::common::MaterialType::STYROFOAM
Styrofoam, density = 75.0 kg/m^3.
gazebo::common::MaterialType::PINE
Pine, density = 373.0 kg/m^3.
gazebo::common::MaterialType::BRASS
Brass, density = 8600.0 kg/m^3.