Atmosphere.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 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 #ifndef GAZEBO_PHYSICS_ATMOSPHERE_HH_
18 #define GAZEBO_PHYSICS_ATMOSPHERE_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include "gazebo/msgs/msgs.hh"
24 
25 #include "gazebo/util/system.hh"
26 
27 namespace gazebo
28 {
29  namespace physics
30  {
31  class World;
32 
35 
37  class AtmospherePrivate;
38 
42  class GZ_PHYSICS_VISIBLE Atmosphere
43  {
46  public: explicit Atmosphere(physics::World &_world);
47 
49  public: virtual ~Atmosphere();
50 
53  public: virtual void Load(sdf::ElementPtr _sdf);
54 
56  public: virtual void Reset();
57 
60  public: virtual std::string Type() const = 0;
61 
64  public: sdf::ElementPtr SDF() const;
65 
68  protected: virtual void OnRequest(ConstRequestPtr &_msg);
69 
72  protected: virtual void OnAtmosphereMsg(ConstAtmospherePtr &_msg);
73 
76  public: virtual void SetTemperature(const double _t);
77 
80  public: virtual void SetPressure(const double _pressure);
81 
86  public: virtual double Temperature(const double _altitude = 0.0) const;
87 
91  public: virtual double Pressure(const double _altitude = 0.0) const;
92 
96  public: virtual double MassDensity(const double _altitude = 0.0) const;
97 
102  public: virtual void SetTemperatureGradient(const double _gradient) = 0;
103 
107  public: double TemperatureGradient() const;
108 
112  protected: void UpdateMassDensity();
113 
116  protected: physics::World &World() const;
117 
120  protected: void Publish(const msgs::Response &_msg) const;
121 
123  public: static const double MOLAR_MASS;
124 
126  public: static const double IDEAL_GAS_CONSTANT_R;
127 
130  private: std::unique_ptr<AtmospherePrivate> dataPtr;
131  };
133  }
134 }
135 #endif
static const double MOLAR_MASS
Molar mass of the air in kg/mol.
Definition: Atmosphere.hh:123
Forward declarations for the common classes.
Definition: Animation.hh:26
static const double IDEAL_GAS_CONSTANT_R
Universal ideal gas constant in J/(mol.K)
Definition: Atmosphere.hh:126
The world provides access to all other object within a simulated environment.
Definition: World.hh:74
This models a base atmosphere class to serve as a common interface to any derived atmosphere models...
Definition: Atmosphere.hh:42