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