Wavefield.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Rhys Mainwaring
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 
22 
23 #ifndef _ASV_WAVE_SIM_GAZEBO_PLUGINS_WAVEFIELD_HH_
24 #define _ASV_WAVE_SIM_GAZEBO_PLUGINS_WAVEFIELD_HH_
25 
26 #include <ignition/math/Vector2.hh>
27 #include <ignition/math/Vector3.hh>
28 
29 #include <memory>
30 #include <vector>
31 
33 // Forward Declarations
34 
35 namespace gazebo
36 {
37  namespace msgs
38  {
39  class Param_V;
40  }
41 }
42 
43 namespace sdf
44 {
45  class Element;
46 }
47 
48 namespace asv
49 {
51 // WaveParameters
54  class WaveParametersPrivate;
55 
59  {
61  public: ~WaveParameters();
62 
64  public: WaveParameters();
65 
69  public: void SetFromSDF(sdf::Element& _sdf);
70 
72  public: size_t Number() const;
73 
76  public: double Angle() const;
77 
80  public: double Scale() const;
81 
84  public: double Steepness() const;
85 
87  public: double AngularFrequency() const;
88 
90  public: double Amplitude() const;
91 
93  public: double Period() const;
94 
96  public: double Phase() const;
97 
99  public: double Wavelength() const;
100 
102  public: double Wavenumber() const;
103 
105  public: float Tau() const;
106 
108  public: float Gain() const;
109 
112  public: ignition::math::Vector2d Direction() const;
113 
117  public: void SetNumber(size_t _number);
118 
123  public: void SetAngle(double _angle);
124 
129  public: void SetScale(double _scale);
130 
135  public: void SetSteepness(double _steepness);
136 
140  public: void SetAmplitude(double _amplitude);
141 
145  public: void SetPeriod(double _period);
146 
150  public: void SetPhase(double _phase);
151 
155  public: void SetTau(double _tau);
156 
160  public: void SetGain(double _gain);
161 
165  public: void SetDirection(const ignition::math::Vector2d& _direction);
166 
168  public: const std::vector<double>& AngularFrequency_V() const;
169 
171  public: const std::vector<double>& Amplitude_V() const;
172 
174  public: const std::vector<double>& Phase_V() const;
175 
177  public: const std::vector<double>& Steepness_V() const;
178 
180  public: const std::vector<double>& Wavenumber_V() const;
181 
183  public: const std::vector<ignition::math::Vector2d>& Direction_V() const;
184 
186  public: void DebugPrint() const;
187 
190  private: std::shared_ptr<WaveParametersPrivate> data;
191  };
192 
194 // WavefieldSampler
195 
198  {
217  public: static double ComputeDepthDirectly(
218  const WaveParameters& _waveParams,
219  const ignition::math::Vector3d& _point,
220  double time, double time_init = 0);
221 
226  public: static double ComputeDepthSimply(
227  const WaveParameters& _waveParams,
228  const ignition::math::Vector3d& _point,
229  double time, double time_init = 0);
230  };
231 }
232 
233 #endif
A class to manage sampling depths from a wave field.
Definition: Wavefield.hh:197
std::shared_ptr< WaveParametersPrivate > data
Definition: Wavefield.hh:190
A class to manage the parameters for generating a wave.
Definition: Wavefield.hh:58
Definition: Geometry.hh:28
Definition: Utilities.hh:40


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