VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ssShipMotion.h
Go to the documentation of this file.
1 
2 
3 
4 
5 
6 
7 
8 
9 #ifndef SS_SHIP_MOTION
10 #define SS_SHIP_MOTION
11 
12 #include "ssdllexport.h"
13 
14 #include "JRMDefines.h"
15 #include "JRMlibrary.h"
16 
17 // Forward declarations
18 class ssShipPerformance;
19 
26 {
27 
28 public:
29 
33  ssShipMotion();
34 
35 
44  void setShipPerformance( ssShipPerformance* shipPerfomance );
45 
46 
52  ssShipPerformance* getShipPerformance()
53  {
54  return m_shipPerformance;
55  }
56 
57 
64  void setNatoSeaState( int natoSeaState );
65 
66 
72  int getNatoSeaState()
73  {
74  return m_seaState;
75  }
76 
84  void setWindSpeed( float wind_knots );
85 
86 
95  float getWindSpeed()
96  {
97  return m_windSpeed;
98  }
99 
100 
115  void setShipSize( float beam_length_m,
116  float length_between_perp_m,
117  float roll_const_sec_per_sqrt_m,
118  float metacentric_height_m );
119 
120 
133  void getShipSize( float& beam_length_m,
134  float& length_between_perp_m,
135  float& roll_const_sec_per_sqrt_m,
136  float& metacentric_height_m )
137  {
138  beam_length_m = m_beamLength;
139  length_between_perp_m = m_lengthBetweenPerpendicular;
140  roll_const_sec_per_sqrt_m = m_rollConstant;
141  metacentric_height_m = m_metacentricHeight;
142  }
143 
144 
153  void setWorldOrientation( float heading, float pitch, float roll )
154  {
155  m_initialHeading = heading;
156  m_initialPitch = pitch;
157  m_initialRoll = roll;
158  }
159 
160 
169  void getWorldOrientation( float& heading, float& pitch, float& roll )
170  {
171  heading = m_initialHeading;
172  pitch = m_initialPitch;
173  roll = m_initialRoll;
174  }
175 
176 
186  void getOffsetOrientation( double time_sec,
187  float& heading, float& pitch, float& roll );
188 
189 
198  void setWorldPosition( double x, double y, double z )
199  {
200  m_positionX = x;
201  m_positionY = y;
202  m_positionZ = z;
203  }
204 
205 
214  void getWorldPosition( double& x, double& y, double& z )
215  {
216  x = m_positionX;
217  y = m_positionY;
218  z = m_positionZ;
219  }
220 
221 
232  void getOffsetTranslation( double time_sec, float& x, float& y, float& z );
233 
234 
244  VECTOR getUnitTangentialVelocity( double time_sec );
245 
246 
264  VECTOR getAngularVelocity( double time_sec, VECTOR shippoint);
265 
266 
276  rotmatrix getSensorMotionMatrix( double time_sec );
277 
281  void getAverageRotation( double time_start, double time_end, double &heading, double &pitch, double &roll, double &heading_rate, double &pitch_rate, double &roll_rate );
282 
286  float getEstimatedRotationPotential();
287 
288 
289 private:
290 
306  void updatePerformanceData();
307 
308 
312  double SHMOscillations( double time_sec,
313  double amplitude,
314  double ang_freq_rad_per_sec,
315  double phase_rad );
316 
317 
321  double SHMOscillations_time_deriv( double time_sec,
322  double amplitude,
323  double ang_freq_rad_per_sec,
324  double phase_rad );
325 
326 
336  void getMotionAngles( double time_sec, double& pitch, double& roll );
337 
338 
348  void getMotionRates( double time_sec, double& pitchrate, double& rollrate );
349 
350 
351  float m_windSpeed;
353 
358 
359  float m_rollAmplitude; // [rad]
360  float m_rollPeriod; // [s]
361 
362  float m_pitchAmplitude; // [rad]
363  float m_pitchPeriod; // [s]
364 
368 
369  double m_positionX;
370  double m_positionY;
371  double m_positionZ;
372 
374 
375 }; // class ssShipMotion
376 
377 #endif // #ifndef SS_SHIP_MOTION


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)