VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ssShipMotion Class Reference

This class defines the ship's motion in the selected sea states. More...

Public Member Functions

 ssShipMotion ()
 Default Constructor.
void setShipPerformance (ssShipPerformance *shipPerfomance)
 Set a pointer to the ShipPerformance object that this class should use to get performance data for the specific size of this ship and the current sea state.
ssShipPerformancegetShipPerformance ()
 Get a pointer to the ShipPerformance object that this class should use to get performance data for the specific size of this ship and the current sea state.
void setNatoSeaState (int natoSeaState)
 Sets the NATO Sea State.
int getNatoSeaState ()
 Gets the NATO sea state that is currently being used by this class.
void setWindSpeed (float wind_knots)
 Internally this class uses the NATO sea state for computation.
float getWindSpeed ()
 Returns the last wind speed that was provided.
void setShipSize (float beam_length_m, float length_between_perp_m, float roll_const_sec_per_sqrt_m, float metacentric_height_m)
 Set the data that defines the size of this ship.
void getShipSize (float &beam_length_m, float &length_between_perp_m, float &roll_const_sec_per_sqrt_m, float &metacentric_height_m)
 Get the data that defines the size of this ship.
void setWorldOrientation (float heading, float pitch, float roll)
 Set the orientation of the ship without any wave motion.
void getWorldOrientation (float &heading, float &pitch, float &roll)
 Get the orientation of the ship without any wave motion.
void getOffsetOrientation (double time_sec, float &heading, float &pitch, float &roll)
 Get the offset orientation of the ship.
void setWorldPosition (double x, double y, double z)
 Set the position of the ship without any wave motion.
void getWorldPosition (double &x, double &y, double &z)
 Get the position of the ship without any wave motion.
void getOffsetTranslation (double time_sec, float &x, float &y, float &z)
 Get the current offset translation of the ship.
VECTOR getUnitTangentialVelocity (double time_sec)
 Calculates the ship motion instantaneous unit tangential direction velocity (at radius = 1).
VECTOR getAngularVelocity (double time_sec, VECTOR shippoint)
 Calculates the ship motion instantaneous angular velocity direction vector.
rotmatrix getSensorMotionMatrix (double time_sec)
 Calculates the sensor motion rotation matrix.
void getAverageRotation (double time_start, double time_end, double &heading, double &pitch, double &roll, double &heading_rate, double &pitch_rate, double &roll_rate)
 getAverageRotation : Returns average orientation and rate of orientation change during time interval
float getEstimatedRotationPotential ()
 Estimated Rotation Potential (not an established industry quantity)

Private Member Functions

void updatePerformanceData ()
 Update the performance data used by this ship.
double SHMOscillations (double time_sec, double amplitude, double ang_freq_rad_per_sec, double phase_rad)
 Simple Harmonic Motion equation for ship motion.
double SHMOscillations_time_deriv (double time_sec, double amplitude, double ang_freq_rad_per_sec, double phase_rad)
 Simple Harmonic Motion equation for ship motion.
void getMotionAngles (double time_sec, double &pitch, double &roll)
 Calculates the Ship Motion Rotation Angles.
void getMotionRates (double time_sec, double &pitchrate, double &rollrate)
 Return pitch and roll time derivatives.

Private Attributes

float m_windSpeed
int m_seaState
float m_beamLength
float m_lengthBetweenPerpendicular
float m_rollConstant
float m_metacentricHeight
float m_rollAmplitude
float m_rollPeriod
float m_pitchAmplitude
float m_pitchPeriod
float m_initialHeading
float m_initialPitch
float m_initialRoll
double m_positionX
double m_positionY
double m_positionZ
ssShipPerformancem_shipPerformance

Detailed Description

This class defines the ship's motion in the selected sea states.

It uses the sea state behaviors (DOD-STD-1399/301). Motion is defined by calculation of rotation matrices.

Constructor & Destructor Documentation

ssShipMotion::ssShipMotion ( )

Default Constructor.

Member Function Documentation

void ssShipMotion::setShipPerformance ( ssShipPerformance shipPerfomance)

Set a pointer to the ShipPerformance object that this class should use to get performance data for the specific size of this ship and the current sea state.

Parameters
shipPerformance- pointer to a class that contains and can provides ship performance data.
ssShipPerformance* ssShipMotion::getShipPerformance ( )
inline

Get a pointer to the ShipPerformance object that this class should use to get performance data for the specific size of this ship and the current sea state.

void ssShipMotion::setNatoSeaState ( int  natoSeaState)

Sets the NATO Sea State.

The different sea states are defined in (DOD-STD-1399/301)

Parameters
natoSeaState- The NATO Sea State to use
int ssShipMotion::getNatoSeaState ( )
inline

Gets the NATO sea state that is currently being used by this class.

Returns
The NATO Sea State
void ssShipMotion::setWindSpeed ( float  wind_knots)

Internally this class uses the NATO sea state for computation.

This method is a convenience method that will convert the provided wind speed into a NATO sea state.

Parameters
wind_knots- The wind speed in knots
float ssShipMotion::getWindSpeed ( )
inline

Returns the last wind speed that was provided.

Note: The wind speed this method returns might not match the current NATO sea state if the sea state was set directly.

Returns
The wind speed in knots
void ssShipMotion::setShipSize ( float  beam_length_m,
float  length_between_perp_m,
float  roll_const_sec_per_sqrt_m,
float  metacentric_height_m 
)

Set the data that defines the size of this ship.

This should be called by the ssShipFactory based on the data read from a ship definition configuration file.

Parameters
beam_length_m- the maximum beam at or below the waterline in meters
length_between_perp_m- the length between perpendiculars of the ship in meters (along the long axis of the ship)
roll_const_sec_per_sqrt_m- is a roll constant based upon experimental results from similar ships - usual range 0.69 to 0.89 [sec/sqrt(meter)]
metacentric_height_m- the maximum metacentric height in meters
void ssShipMotion::getShipSize ( float &  beam_length_m,
float &  length_between_perp_m,
float &  roll_const_sec_per_sqrt_m,
float &  metacentric_height_m 
)
inline

Get the data that defines the size of this ship.

Parameters
beam_length_m- the maximum beam at or below the waterline in meters
length_between_perp_m- the length between perpendiculars of the ship in meters (along the long axis of the ship)
roll_const_sec_per_sqrt_m- is a roll constant based upon experimental results from similar ships - usual range 0.69 to 0.89 [sec/sqrt(meter)]
metacentric_height_m- the maximum metacentric height in meters
void ssShipMotion::setWorldOrientation ( float  heading,
float  pitch,
float  roll 
)
inline

Set the orientation of the ship without any wave motion.

This would be the resting orientation or calm sea orientation of this ship.

Parameters
heading- The heading in radians of the ship relative to north
pitch- The pitch in radians of the ship relative to the horizon
roll- The roll in radians of the ship relative to level
void ssShipMotion::getWorldOrientation ( float &  heading,
float &  pitch,
float &  roll 
)
inline

Get the orientation of the ship without any wave motion.

This would be the resting orientation or calm sea orientation of this ship.

Parameters
heading- The heading in radians of the ship relative to north
pitch- The pitch in radians of the ship relative to the horizon
roll- The roll in radians of the ship relative to level
void ssShipMotion::getOffsetOrientation ( double  time_sec,
float &  heading,
float &  pitch,
float &  roll 
)

Get the offset orientation of the ship.

This is the rotational motion computed due to the current sea state.

Parameters
time_sec- The current simulation time in seconds
heading- The heading offset in radians
pitch- The pitch offset in radians
roll- The roll offset in radians
void ssShipMotion::setWorldPosition ( double  x,
double  y,
double  z 
)
inline

Set the position of the ship without any wave motion.

This would be the resting position or calm sea position of this ship.

Parameters
x- The x component of the position of this ship.
y- The y component of the position of this ship.
z- The z component of the position of this ship.
void ssShipMotion::getWorldPosition ( double &  x,
double &  y,
double &  z 
)
inline

Get the position of the ship without any wave motion.

This would be the resting position or calm sea position of this ship.

Parameters
x- The x component of the position of this ship.
y- The y component of the position of this ship.
z- The z component of the position of this ship.
void ssShipMotion::getOffsetTranslation ( double  time_sec,
float &  x,
float &  y,
float &  z 
)

Get the current offset translation of the ship.

This is the heave, sway, and surge from the current sea state. This capability is not currently implemented, but could be in the future.

Parameters
time_sec- The current simulation time in seconds
x- The x component of the offset of this ship.
y- The y component of the offset of this ship.
z- The z component of the offset of this ship.
VECTOR ssShipMotion::getUnitTangentialVelocity ( double  time_sec)

Calculates the ship motion instantaneous unit tangential direction velocity (at radius = 1).

This method assumes ship coordinate origin are set at the metacentric height, Ship length lies along the x-axis, and z-axis is vertical.

Parameters
time_sec- elapsed time in seconds
Returns
- the instantaneous unit tangential velocity vector
VECTOR ssShipMotion::getAngularVelocity ( double  time_sec,
VECTOR  shippoint 
)

Calculates the ship motion instantaneous angular velocity direction vector.

This class assumes that the ship coordinate origin is set at the metacentric height, the ship length lies along the x-axis, and the z-axis is vertical

Parameters
time_sec- elapsed time in seconds
xpos- x position of point under rotation wrt origin at meta-center of ship
ypos- y position of point under rotation wrt origin at meta-center of ship
zpos- z position of point under rotation wrt origin at meta-center of ship
Returns
Ship motion instantaneous angular velocity direction vector in (x, y, z) ship coordinates. Note that it has been normalized, so is a unit vector
rotmatrix ssShipMotion::getSensorMotionMatrix ( double  time_sec)

Calculates the sensor motion rotation matrix.

Equivalent motion of a sensor wrt ship initial position. Assumes ship coordinate origin is set at the metacentric height, the ship length lies along the x-axis, and z-axis is vertical

Parameters
time_sec- elapsed time in seconds
Returns
Sensor motion rotation matrix in homogeneous coordinates
void ssShipMotion::getAverageRotation ( double  time_start,
double  time_end,
double &  heading,
double &  pitch,
double &  roll,
double &  heading_rate,
double &  pitch_rate,
double &  roll_rate 
)

getAverageRotation : Returns average orientation and rate of orientation change during time interval

float ssShipMotion::getEstimatedRotationPotential ( )

Estimated Rotation Potential (not an established industry quantity)

void ssShipMotion::updatePerformanceData ( )
private

Update the performance data used by this ship.

This data is based on the currently assigned ship size and sea state. The updated performance data will be used when computing motion data for this ship.

Parameters
state- NATO Sea State
beam_length_m- the maximum beam at or below the waterline in meters
length_between_perp_m- the length between perpendiculars of the ship in meters (along the long axis of the ship)
roll_const_sec_per_sqrt_m- is a roll constant based upon experimental results from similar ships - usual range 0.69 to 0.89 [sec/sqrt(meter)]
metacentric_height_m- the maximum metacentric height in meters
double ssShipMotion::SHMOscillations ( double  time_sec,
double  amplitude,
double  ang_freq_rad_per_sec,
double  phase_rad 
)
private

Simple Harmonic Motion equation for ship motion.

double ssShipMotion::SHMOscillations_time_deriv ( double  time_sec,
double  amplitude,
double  ang_freq_rad_per_sec,
double  phase_rad 
)
private

Simple Harmonic Motion equation for ship motion.

void ssShipMotion::getMotionAngles ( double  time_sec,
double &  pitch,
double &  roll 
)
private

Calculates the Ship Motion Rotation Angles.

This method assumes ship coordinate origin are set at the metacentric height, Ship length lies along the x-axis, z-axis is vertical.

Parameters
time_sec- elapsed time in seconds
pitch[rad] - the amount the ship is pitching at the provided time
roll[rad] - the amount the ship is rolling at the provided time
void ssShipMotion::getMotionRates ( double  time_sec,
double &  pitchrate,
double &  rollrate 
)
private

Return pitch and roll time derivatives.

This method assumes ship coordinate origin are set at the metacentric height, Ship length lies along the x-axis, z-axis is vertical.

Parameters
time_sec- elapsed time in seconds
pitchrate[rad/s] - the rate at which the ship is pitching at the provided time
rollrate[rad/s] - the rate at which the ship is rolling at the provided time

Member Data Documentation

float ssShipMotion::m_windSpeed
private
int ssShipMotion::m_seaState
private
float ssShipMotion::m_beamLength
private
float ssShipMotion::m_lengthBetweenPerpendicular
private
float ssShipMotion::m_rollConstant
private
float ssShipMotion::m_metacentricHeight
private
float ssShipMotion::m_rollAmplitude
private
float ssShipMotion::m_rollPeriod
private
float ssShipMotion::m_pitchAmplitude
private
float ssShipMotion::m_pitchPeriod
private
float ssShipMotion::m_initialHeading
private
float ssShipMotion::m_initialPitch
private
float ssShipMotion::m_initialRoll
private
double ssShipMotion::m_positionX
private
double ssShipMotion::m_positionY
private
double ssShipMotion::m_positionZ
private
ssShipPerformance* ssShipMotion::m_shipPerformance
private

The documentation for this class was generated from the following file:


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