wavegauge_plugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Brian Bingham
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 
18 #ifndef WAVE_GAZEBO_PLUGINS_WAVEGUAGE_PLUGIN_HH_
19 #define WAVE_GAZEBO_PLUGINS_WAVEGUAGE_PLUGIN_HH_
20 
21 #include <map>
22 #include <string>
23 #include <gazebo/common/common.hh>
24 #include <gazebo/common/Event.hh>
25 #include <gazebo/common/Plugin.hh>
26 #include <gazebo/physics/physics.hh>
27 #include <ignition/math/Vector3.hh>
28 #include <sdf/sdf.hh>
29 
30 namespace gazebo
31 {
48  class WaveguagePlugin : public ModelPlugin
49  {
51  public: WaveguagePlugin();
52 
53  // Documentation inherited.
54  public: virtual void Load(physics::ModelPtr _model,
55  sdf::ElementPtr _sdf);
56 
57  // Documentation inherited.
58  public: virtual void Init();
59 
61  protected: virtual void OnUpdate();
62 
64  protected: event::ConnectionPtr updateConnection;
65 
67  protected: physics::ModelPtr model;
68 
70  protected: std::string waveModelName;
71 
73  protected: double fluidLevel;
74  };
75 }
76 
77 #endif
A plugin that sets the model height (z) to be the same as the wave height calculated for the physics...
virtual void OnUpdate()
Callback for World Update events.
physics::ModelPtr model
Pointer to the model.
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
event::ConnectionPtr updateConnection
Connection to World Update events.
double fluidLevel
The height of the fluid/air interface [m]. Defaults to 0.
WaveguagePlugin()
Constructor.
std::string waveModelName
The name of the wave model.


wave_gazebo_plugins
Author(s): Rhys Mainwaring
autogenerated on Thu May 7 2020 03:54:44