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