##

Atmosphere.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_PHYSICS_ATMOSPHERE_HH_
#define GAZEBO_PHYSICS_ATMOSPHERE_HH_
#include <memory>
#include <string>
#include "gazebo/msgs/msgs.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
class World;
class AtmospherePrivate;
class GZ_PHYSICS_VISIBLE Atmosphere
{
public: explicit Atmosphere(physics::World &_world);
public: virtual ~Atmosphere();
public: virtual void Load(sdf::ElementPtr _sdf);
public: virtual void Reset();
public: virtual std::string Type() const = 0;
public: sdf::ElementPtr SDF() const;
protected: virtual void OnRequest(ConstRequestPtr &_msg);
protected: virtual void OnAtmosphereMsg(ConstAtmospherePtr &_msg);
public: virtual void SetTemperature(const double _t);
public: virtual void SetPressure(const double _pressure);
public: virtual double Temperature(const double _altitude = 0.0) const;
public: virtual double Pressure(const double _altitude = 0.0) const;
public: virtual double MassDensity(const double _altitude = 0.0) const;
public: virtual void SetTemperatureGradient(const double _gradient) = 0;
public: double TemperatureGradient() const;
protected: void UpdateMassDensity();
protected: physics::World &World() const;
protected: void Publish(const msgs::Response &_msg) const;
public: static const double MOLAR_MASS;
public: static const double IDEAL_GAS_CONSTANT_R;
private: std::unique_ptr<AtmospherePrivate> dataPtr;
};
}
}
#endif
gazebo::physics::Atmosphere::~Atmosphere
virtual ~Atmosphere()
Destructor.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::physics::Atmosphere::OnAtmosphereMsg
virtual void OnAtmosphereMsg(ConstAtmospherePtr &_msg)
Virtual callback for gztopic "~/atmosphere".
gazebo::physics::Atmosphere::IDEAL_GAS_CONSTANT_R
static const double IDEAL_GAS_CONSTANT_R
Universal ideal gas constant in J/(mol.K)
Definition: Atmosphere.hh:126
gazebo::physics::Atmosphere::SetTemperature
virtual void SetTemperature(const double _t)
Set the sea level temperature.
system.hh
msgs.hh
gazebo::physics::Atmosphere::Reset
virtual void Reset()
Reset the atmosphere model.
gazebo::physics::Atmosphere::UpdateMassDensity
void UpdateMassDensity()
Update the mass density of the air at sea level using the ideal gas law.
gazebo::physics::Atmosphere::MOLAR_MASS
static const double MOLAR_MASS
Molar mass of the air in kg/mol.
Definition: Atmosphere.hh:123
gazebo::physics::Atmosphere::World
physics::World & World() const
Return the world.
gazebo::physics::Atmosphere::Atmosphere
Atmosphere(physics::World &_world)
Default constructor.
gazebo::physics::Atmosphere::Type
virtual std::string Type() const =0
Return the atmosphere model type (such as "adiabatic").
gazebo::physics::Atmosphere
This models a base atmosphere class to serve as a common interface to any derived atmosphere models.
Definition: Atmosphere.hh:42
gazebo::physics::World
The world provides access to all other object within a simulated environment.
Definition: World.hh:74
gazebo::physics::Atmosphere::Temperature
virtual double Temperature(const double _altitude=0.0) const
Get the actual modeled temperature in kelvins at a given altitude.
gazebo::physics::Atmosphere::Load
virtual void Load(sdf::ElementPtr _sdf)
Load the atmosphere model.
gazebo::physics::Atmosphere::SDF
sdf::ElementPtr SDF() const
Get a pointer to the SDF element for this atmosphere model.
gazebo::physics::Atmosphere::MassDensity
virtual double MassDensity(const double _altitude=0.0) const
Get the density in kg/m^3 at a given altitude.
gazebo::physics::Atmosphere::Publish
void Publish(const msgs::Response &_msg) const
Publish response to a request.
gazebo::physics::Atmosphere::TemperatureGradient
double TemperatureGradient() const
Get the sea level temperature gradient with respect to increasing altitude.
gazebo::physics::Atmosphere::SetPressure
virtual void SetPressure(const double _pressure)
Set the sea level pressure.
gazebo::physics::Atmosphere::OnRequest
virtual void OnRequest(ConstRequestPtr &_msg)
Virtual callback for gztopic "~/request".
gazebo::physics::Atmosphere::SetTemperatureGradient
virtual void SetTemperatureGradient(const double _gradient)=0
Set the temperature gradient dT/dZ with respect to increasing altitude around sea level.
gazebo::physics::Atmosphere::Pressure
virtual double Pressure(const double _altitude=0.0) const
Get the pressure at a specified altitude in pascals.