Wind.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_WIND_HH_
18 #define GAZEBO_PHYSICS_WIND_HH_
19 
20 #include <string>
21 #include <functional>
22 #include <memory>
23 #include <boost/any.hpp>
24 
25 #include "gazebo/msgs/msgs.hh"
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
31  namespace physics
32  {
33  // Forward declare private data class.
34  class WindPrivate;
35 
38 
41  class GZ_PHYSICS_VISIBLE Wind
42  {
46  public: explicit Wind(World &_world, sdf::ElementPtr _sdf);
47 
49  public: virtual ~Wind();
50 
53  public: virtual void Load(sdf::ElementPtr _sdf);
54 
63  public: bool SetParam(const std::string &_key,
64  const boost::any &_value);
65 
70  public: boost::any Param(const std::string &_key) const;
71 
77  public: bool Param(const std::string &_key, boost::any &_value) const;
78 
81  private: void OnWindMsg(ConstWindPtr &_msg);
82 
85  private: void OnRequest(ConstRequestPtr &_msg);
86 
91  public: ignition::math::Vector3d WorldLinearVel(const Entity *_entity)
92  const;
93 
97  public: ignition::math::Vector3d RelativeLinearVel(const Entity *_entity)
98  const;
99 
102  public: const ignition::math::Vector3d& LinearVel(void) const;
103 
106  public: void SetLinearVel(const ignition::math::Vector3d& _vel);
107 
114  public: void SetLinearVelFunc(std::function< ignition::math::Vector3d (
115  const Wind *_wind, const Entity *_entity) > _linearVelFunc);
116 
122  private: ignition::math::Vector3d LinearVelDefault(const Wind *_wind,
123  const Entity *_entity);
124 
127  private: std::unique_ptr<WindPrivate> dataPtr;
128  };
130  }
131 }
132 #endif
default namespace for gazebo
The world provides access to all other object within a simulated environment.
Definition: World.hh:80
Base class for wind.
Definition: Wind.hh:41
Base class for all physics objects in Gazebo.
Definition: Entity.hh:52