![]() |
VR-Vantage 3.1 API Documentation
|
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. | |
| ssShipPerformance * | getShipPerformance () |
| 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 |
| ssShipPerformance * | m_shipPerformance |
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.
| ssShipMotion::ssShipMotion | ( | ) |
Default Constructor.
| 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.
| shipPerformance | - pointer to a class that contains and can provides ship performance data. |
|
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.
Sets the NATO Sea State.
The different sea states are defined in (DOD-STD-1399/301)
| natoSeaState | - The NATO Sea State to use |
|
inline |
Gets the NATO sea state that is currently being used by this class.
| 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.
| wind_knots | - The wind speed in knots |
|
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.
| 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.
| 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 |
|
inline |
Get the data that defines the size of this ship.
| 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 |
|
inline |
Set the orientation of the ship without any wave motion.
This would be the resting orientation or calm sea orientation of this ship.
| 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 |
|
inline |
Get the orientation of the ship without any wave motion.
This would be the resting orientation or calm sea orientation of this ship.
| 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.
| 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 |
|
inline |
Set the position of the ship without any wave motion.
This would be the resting position or calm sea position of this ship.
| 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. |
|
inline |
Get the position of the ship without any wave motion.
This would be the resting position or calm sea position of this ship.
| 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.
| 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.
| time_sec | - elapsed time in seconds |
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
| 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 |
| 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
| time_sec | - elapsed time in seconds |
| 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)
|
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.
| 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 |
|
private |
Simple Harmonic Motion equation for ship motion.
|
private |
Simple Harmonic Motion equation for ship motion.
|
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.
| 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 |
|
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.
| 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 |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |