WSF
WsfPathGuidance Class Reference

#include <WsfPathGuidance.hpp>

Inheritance diagram for WsfPathGuidance:

Public Types

enum  {
  cSPEED = 0x0001 , cAXIAL_ACCEL = 0x0002 , cCLIMB_RATE = 0x0004 , cALTITUDE = 0x0008 ,
  cHEADING = 0x0010 , cTURN_RATE = 0x0020 , cRADIAL_ACCEL = 0x0040 , cLAT_LON = 0x0080 ,
  cSEGMENT_TIME = 0x0100 , cSEGMENT_DIST = 0x0200 , cTURN_DETERMINED = 0x8000
}

Public Member Functions

 WsfPathGuidance ()
 Construct a path guidance object.
virtual ~WsfPathGuidance ()
virtual WsfPathGuidanceClone () const
 Clone a path guidance object.
void SetMover (WsfMover *aMoverPtr)
WsfMoverGetMover () const
 Get the mover to whom guidance is being provided.
virtual bool Initialize (double aSimTime)
virtual bool ProcessInput (UtInput &aInput)
virtual void Update (double aSimTime)
void TriggerExtrapolation ()
bool IsChanged () const
bool IsOnGround () const
bool IsOnRoad () const
bool IsExtrapolating () const
bool IsStopping () const
bool IsInitialized () const
bool IsPaused () const
double GetPauseTime () const
virtual double GetAltitude () const
virtual double GetSpeed () const
double GetRawHeading () const
double GetClimbRate () const
double GetLatitude () const
double GetLongitude () const
double GetSegmentEndTime () const
double GetSegmentEndDist () const
double GetAxialAccel () const
double GetRadialAccel () const
double GetTurnRate () const
WsfPath::AltRef GetAltRef () const
WsfPath::HdgRef GetHdgRef () const
WsfPath::TurnDirection GetTurnDir () const
WsfPath::Switch GetSwitch () const
void DecrementPauseTime (double aValue)
void SetPauseTime (double aValue)
void SetAltitude (double aAltitude, WsfPath::AltRef aAltRef)
void SetAltitude (double aAltitude, WsfPath::AltRef aMoverDefault, WsfPath::AltRef aAltRefWP_Override)
void SetLatLon (double aLatitude, double aLongitude)
void SetHeading (double aHeading, WsfPath::HdgRef aHdgRef)
void SetClimbRate (double aClimbRate)
void SetLLA (double aLatitude, double aLongitude, double aAltitude, WsfPath::AltRef aMoverDefault, WsfPath::AltRef aAltRefOverride=WsfPath::cALT_REF_MSL)
void SetSpeed (double aSpeed)
void SetAxialAccel (double aAxialAccel)
void SetRadialAccel (double aRadialAccel)
void SetTurnRate (double aTurnRate)
void SetSegmentEndTime (double aSegmentTime)
void SetSegmentEndDist (double aSegmentDist)
void SetHdgRef (WsfPath::HdgRef aHdgRef)
void SetTurnDir (WsfPath::TurnDirection aTurnDir)
void SetSwitch (WsfPath::Switch aMoverDefault, WsfPath::Switch aWP_SwitchOverride)
void ClearValid (int aClearMask)
bool IsSet (int aMask)
bool SpeedIsSet () const
bool AltIsSet () const
bool LatLonIsSet () const
bool HeadingIsSet () const
bool AxialAccelIsSet () const
bool ClimbRateIsSet () const
bool TurnRateIsSet () const
bool RadialAccelIsSet () const
bool SegmentTimeIsSet () const
bool SegmentDistIsSet () const
bool LLA_IsSet () const
bool HdgAndAltSet () const
bool HdgAltAndSpeedSet () const
bool TurnIsDetermined () const
double ChosenHeading () const
WsfPath::TurnDirection ChosenDirection () const
void PrintValidityMap (double aSimTime) const
void GetWPTargetInfo (double aVelNED[3], double &aPlatformHeading, double &aPlatformPitch, double &aPlatformRoll, double &aHeadingChangeMag, double &aHdgChgDirection, double &aGroundSpeed, double &aTotalSpeed, double &aGroundDistTo)
virtual double GetRadialAccelAtPoint (const WsfWaypoint &aPoint) const

Protected Member Functions

virtual bool BeginExtrapolation (double aSimTime)
virtual bool SetNewGuidance (double aSimTime)
virtual bool ReviseGuidance (double aSimTime)
virtual bool DetermineTheTurn (double aSimTime)
void ClearChosenDir ()
void SetAltRef (WsfPath::AltRef aMoverDefault, WsfPath::AltRef aAltRefOverride=WsfPath::cALT_REF_MSL)
const double * TgtWCS () const
void PrivateSetTurnDir (WsfPath::TurnDirection aTurnDir)
std::string PrintBool (int aMask) const
void SetValid (int aSetMask)

Protected Attributes

bool mDebug
bool mInitialized
bool mIsChanged
bool mIsOnGround
bool mIsOnRoad
bool mKeepLevel
double mPauseTime

Detailed Description

A guidance base class used by WsfMovers that follow WsfRoutes. This is a base class that specifies guidance values that may be used to direct a WsfMover in three dimensions, including from one WsfWaypoint to another. Validity flags are kept to allow the implementation to know what guidance is permissible or recommended, based on the information known. A "dirty" flag is kept to indicate when any value has changed, and the implementation will clear this flag after it has reacted to changed guidance. The class may be further derived to augment or fill in missing data. The mover may be constrained in its ability to simul- taneously follow all the guidance given, but should comply as closely as possible. Note: It is generally intended that target Speed, Heading, and Altitude values remain persistent (stay valid), even after crossing waypoints, unless overridden with new values in the WsfWaypoint.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

This enum specifies integer bit-mapped "valid" flags for clients to use in deciding what guidance values can be used.

Enumerator
cSPEED 

Speed value is valid.

cAXIAL_ACCEL 

Axial Acceleration value is valid.

cCLIMB_RATE 

Climb Rate value is valid.

cALTITUDE 

Altitude value is valid.

cHEADING 

Heading value is valid.

cTURN_RATE 

Turn Rate value is valid.

cRADIAL_ACCEL 

Radial Acceleration value is valid.

cLAT_LON 

Latitude and Longitude values are valid.

cSEGMENT_TIME 

Segment Time value is valid.

cSEGMENT_DIST 

Segment Distance value is valid.

cTURN_DETERMINED 

Absolute Heading value (to an LLA point) has been calculated.

Constructor & Destructor Documentation

◆ WsfPathGuidance()

WsfPathGuidance::WsfPathGuidance ( )

◆ ~WsfPathGuidance()

WsfPathGuidance::~WsfPathGuidance ( )
virtual

Member Function Documentation

◆ AltIsSet()

bool WsfPathGuidance::AltIsSet ( ) const
inline

◆ AxialAccelIsSet()

bool WsfPathGuidance::AxialAccelIsSet ( ) const
inline

References cAXIAL_ACCEL.

◆ BeginExtrapolation()

bool WsfPathGuidance::BeginExtrapolation ( double aSimTime)
protectedvirtual

◆ ChosenDirection()

WsfPath::TurnDirection WsfPathGuidance::ChosenDirection ( ) const
inline

◆ ChosenHeading()

double WsfPathGuidance::ChosenHeading ( ) const

◆ ClearChosenDir()

void WsfPathGuidance::ClearChosenDir ( )
inlineprotected

◆ ClearValid()

void WsfPathGuidance::ClearValid ( int aClearMask)

◆ ClimbRateIsSet()

bool WsfPathGuidance::ClimbRateIsSet ( ) const
inline

References cCLIMB_RATE.

◆ Clone()

WsfPathGuidance * WsfPathGuidance::Clone ( ) const
virtual

Clone a path guidance object.

Reimplemented in WsfWaypointPathGuidance.

References WsfPathGuidance().

◆ DecrementPauseTime()

void WsfPathGuidance::DecrementPauseTime ( double aValue)
inline

References mPauseTime.

◆ DetermineTheTurn()

◆ GetAltitude()

double WsfPathGuidance::GetAltitude ( ) const
virtual

◆ GetAltRef()

WsfPath::AltRef WsfPathGuidance::GetAltRef ( ) const
inline

◆ GetAxialAccel()

double WsfPathGuidance::GetAxialAccel ( ) const
inline

◆ GetClimbRate()

double WsfPathGuidance::GetClimbRate ( ) const
inline

◆ GetHdgRef()

WsfPath::HdgRef WsfPathGuidance::GetHdgRef ( ) const
inline

◆ GetLatitude()

double WsfPathGuidance::GetLatitude ( ) const
inline

◆ GetLongitude()

double WsfPathGuidance::GetLongitude ( ) const
inline

◆ GetMover()

WsfMover * WsfPathGuidance::GetMover ( ) const
inline

◆ GetPauseTime()

double WsfPathGuidance::GetPauseTime ( ) const
inline

References mPauseTime.

◆ GetRadialAccel()

double WsfPathGuidance::GetRadialAccel ( ) const
inline

◆ GetRadialAccelAtPoint()

double WsfPathGuidance::GetRadialAccelAtPoint ( const WsfWaypoint & aPoint) const
virtual

Get the radial acceleration to be used for turning FROM the specified waypoint. This method is typically overridden by a derived class to provide additional constraints on the resultant value.

Returns
The radial acceleration (m/s^2)

Reimplemented in WsfWaypointPathGuidance.

References WsfPath::cDOUBLE_NOT_SET, and WsfWaypoint::GetRadialAccel().

Referenced by GetWPTargetInfo().

◆ GetRawHeading()

double WsfPathGuidance::GetRawHeading ( ) const
inline

◆ GetSegmentEndDist()

double WsfPathGuidance::GetSegmentEndDist ( ) const
inline

◆ GetSegmentEndTime()

double WsfPathGuidance::GetSegmentEndTime ( ) const
inline

◆ GetSpeed()

double WsfPathGuidance::GetSpeed ( ) const
virtual

◆ GetSwitch()

WsfPath::Switch WsfPathGuidance::GetSwitch ( ) const
inline

◆ GetTurnDir()

WsfPath::TurnDirection WsfPathGuidance::GetTurnDir ( ) const
inline

◆ GetTurnRate()

double WsfPathGuidance::GetTurnRate ( ) const
inline

◆ GetWPTargetInfo()

void WsfPathGuidance::GetWPTargetInfo ( double aVelNED[3],
double & aPlatformHeading,
double & aPlatformPitch,
double & aPlatformRoll,
double & aHeadingChangeMag,
double & aHdgChgDirection,
double & aGroundSpeed,
double & aTotalSpeed,
double & aGroundDistTo )

◆ HdgAltAndSpeedSet()

bool WsfPathGuidance::HdgAltAndSpeedSet ( ) const
inline

◆ HdgAndAltSet()

bool WsfPathGuidance::HdgAndAltSet ( ) const
inline

References AltIsSet(), and HeadingIsSet().

◆ HeadingIsSet()

bool WsfPathGuidance::HeadingIsSet ( ) const
inline

◆ Initialize()

bool WsfPathGuidance::Initialize ( double aSimTime)
virtual

References mInitialized.

◆ IsChanged()

bool WsfPathGuidance::IsChanged ( ) const
inline

This boolean flag indicates to the client when any guidance has been changed, otherwise, the controls are the same as previous, and need not be re-interpreted.

References mIsChanged.

◆ IsExtrapolating()

bool WsfPathGuidance::IsExtrapolating ( ) const
inline

◆ IsInitialized()

bool WsfPathGuidance::IsInitialized ( ) const
inline

References mInitialized.

◆ IsOnGround()

bool WsfPathGuidance::IsOnGround ( ) const
inline

References mIsOnGround.

◆ IsOnRoad()

bool WsfPathGuidance::IsOnRoad ( ) const
inline

References mIsOnRoad.

◆ IsPaused()

bool WsfPathGuidance::IsPaused ( ) const
inline

References mPauseTime.

Referenced by Update().

◆ IsSet()

bool WsfPathGuidance::IsSet ( int aMask)

Referenced by SetTurnRate().

◆ IsStopping()

bool WsfPathGuidance::IsStopping ( ) const
inline

◆ LatLonIsSet()

bool WsfPathGuidance::LatLonIsSet ( ) const
inline

◆ LLA_IsSet()

bool WsfPathGuidance::LLA_IsSet ( ) const
inline

References AltIsSet(), and LatLonIsSet().

◆ PrintBool()

std::string WsfPathGuidance::PrintBool ( int aMask) const
protected

Referenced by PrintValidityMap().

◆ PrintValidityMap()

void WsfPathGuidance::PrintValidityMap ( double aSimTime) const

◆ PrivateSetTurnDir()

void WsfPathGuidance::PrivateSetTurnDir ( WsfPath::TurnDirection aTurnDir)
protected

◆ ProcessInput()

bool WsfPathGuidance::ProcessInput ( UtInput & aInput)
virtual

Reimplemented in WsfWaypointPathGuidance.

References mDebug.

Referenced by WsfWaypointPathGuidance::ProcessInput().

◆ RadialAccelIsSet()

bool WsfPathGuidance::RadialAccelIsSet ( ) const
inline

◆ ReviseGuidance()

bool WsfPathGuidance::ReviseGuidance ( double aSimTime)
protectedvirtual

Referenced by GetWPTargetInfo(), and Update().

◆ SegmentDistIsSet()

bool WsfPathGuidance::SegmentDistIsSet ( ) const
inline

References cSEGMENT_DIST.

◆ SegmentTimeIsSet()

bool WsfPathGuidance::SegmentTimeIsSet ( ) const
inline

References cSEGMENT_TIME.

◆ SetAltitude() [1/2]

void WsfPathGuidance::SetAltitude ( double aAltitude,
WsfPath::AltRef aAltRef )

Referenced by SetLLA().

◆ SetAltitude() [2/2]

void WsfPathGuidance::SetAltitude ( double aAltitude,
WsfPath::AltRef aMoverDefault,
WsfPath::AltRef aAltRefWP_Override )

References SetAltRef().

◆ SetAltRef()

void WsfPathGuidance::SetAltRef ( WsfPath::AltRef aMoverDefault,
WsfPath::AltRef aAltRefOverride = WsfPath::cALT_REF_MSL )
protected

References WsfPath::cALT_REF_MOVER_DEFAULT.

Referenced by SetAltitude().

◆ SetAxialAccel()

void WsfPathGuidance::SetAxialAccel ( double aAxialAccel)

References cAXIAL_ACCEL, mIsChanged, and SetValid().

◆ SetClimbRate()

void WsfPathGuidance::SetClimbRate ( double aClimbRate)

Set a desired climb rate.

Parameters
aClimbRate- Desired climb rate, m/s

References cCLIMB_RATE, mIsChanged, and SetValid().

◆ SetHdgRef()

void WsfPathGuidance::SetHdgRef ( WsfPath::HdgRef aHdgRef)

Set the basis for a heading value.

Parameters
aHdgRef- Either cHDG_REF_NORTH, or cHDG_REF_RELATIVE

References mIsChanged.

Referenced by SetHeading(), and SetTurnRate().

◆ SetHeading()

void WsfPathGuidance::SetHeading ( double aHeading,
WsfPath::HdgRef aHdgRef )

Set the heading and basis for that heading value.

Parameters
aHeading- Desired heading, in radians.
aHdgRef- Either cHDG_REF_NORTH, or cHDG_REF_RELATIVE

References cHEADING, cLAT_LON, ClearValid(), cSEGMENT_DIST, cSEGMENT_TIME, cTURN_DETERMINED, mIsChanged, SetHdgRef(), and SetValid().

Referenced by BeginExtrapolation().

◆ SetLatLon()

void WsfPathGuidance::SetLatLon ( double aLatitude,
double aLongitude )

◆ SetLLA()

void WsfPathGuidance::SetLLA ( double aLatitude,
double aLongitude,
double aAltitude,
WsfPath::AltRef aMoverDefault,
WsfPath::AltRef aAltRefOverride = WsfPath::cALT_REF_MSL )

Set a target destination location.

Parameters
aLatitude- Desired latitude, deg.
aLongitude- Desired longitude, deg.
aAltitude- Desired altitude, m.
aMoverDefault- Desired altitude reference, cALT_REF_MOVER_DEFAULT, cALT_REF_MSL, cALT_REF_AGLdeg.
aAltRefOverride- Desired altitude reference (as above).

References SetAltitude(), and SetLatLon().

◆ SetMover()

void WsfPathGuidance::SetMover ( WsfMover * aMoverPtr)
inline

Set the mover to whom guidance is being provided.

Note
The caller retains ownership of the mover.

◆ SetNewGuidance()

bool WsfPathGuidance::SetNewGuidance ( double aSimTime)
protectedvirtual

◆ SetPauseTime()

void WsfPathGuidance::SetPauseTime ( double aValue)
inline

References mPauseTime.

◆ SetRadialAccel()

void WsfPathGuidance::SetRadialAccel ( double aRadialAccel)

References cRADIAL_ACCEL, mIsChanged, and SetValid().

◆ SetSegmentEndDist()

void WsfPathGuidance::SetSegmentEndDist ( double aSegmentDist)

Set the distance basis for a path segment.

Parameters
aSegmentDist- Desired distance to travel before waypoint switch, m.

References cHEADING, cLAT_LON, ClearValid(), cSEGMENT_DIST, cSEGMENT_TIME, WsfPath::cSWITCH_ON_DISTANCE, mIsChanged, and SetValid().

Referenced by SetTurnRate().

◆ SetSegmentEndTime()

void WsfPathGuidance::SetSegmentEndTime ( double aSegmentTime)

Set the time basis for a path segment.

Parameters
aSegmentTime- Desired time to travel before waypoint switch, sec.

References cHEADING, cLAT_LON, ClearValid(), cSEGMENT_DIST, cSEGMENT_TIME, WsfPath::cSWITCH_ON_TIME, mIsChanged, and SetValid().

Referenced by SetTurnRate().

◆ SetSpeed()

void WsfPathGuidance::SetSpeed ( double aSpeed)

References cSPEED, mIsChanged, and SetValid().

◆ SetSwitch()

void WsfPathGuidance::SetSwitch ( WsfPath::Switch aMoverDefault,
WsfPath::Switch aWP_SwitchOverride )

◆ SetTurnDir()

void WsfPathGuidance::SetTurnDir ( WsfPath::TurnDirection aTurnDir)

References mIsChanged.

Referenced by SetTurnRate().

◆ SetTurnRate()

void WsfPathGuidance::SetTurnRate ( double aTurnRate)

◆ SetValid()

void WsfPathGuidance::SetValid ( int aSetMask)
protected

◆ SpeedIsSet()

bool WsfPathGuidance::SpeedIsSet ( ) const
inline

◆ TgtWCS()

const double * WsfPathGuidance::TgtWCS ( ) const
inlineprotected

◆ TriggerExtrapolation()

void WsfPathGuidance::TriggerExtrapolation ( )

References mIsChanged.

◆ TurnIsDetermined()

bool WsfPathGuidance::TurnIsDetermined ( ) const
inline

◆ TurnRateIsSet()

bool WsfPathGuidance::TurnRateIsSet ( ) const
inline

◆ Update()

void WsfPathGuidance::Update ( double aSimTime)
virtual

This virtual method may be overridden if needed to accomplish the processing needed for a specific WsfMover. Three distinct guidance modes are intrinsic to the class, triggering a new guidance type, begin extrapolating existing guidance, and revising guidance already in-progress.

References BeginExtrapolation(), DetermineTheTurn(), IsPaused(), mDebug, mInitialized, mIsChanged, PrintValidityMap(), ReviseGuidance(), and SetNewGuidance().

Member Data Documentation

◆ mDebug

bool WsfPathGuidance::mDebug
protected

◆ mInitialized

bool WsfPathGuidance::mInitialized
protected

◆ mIsChanged

◆ mIsOnGround

bool WsfPathGuidance::mIsOnGround
protected

Referenced by IsOnGround(), and WsfPathGuidance().

◆ mIsOnRoad

bool WsfPathGuidance::mIsOnRoad
protected

Referenced by IsOnRoad(), and WsfPathGuidance().

◆ mKeepLevel

bool WsfPathGuidance::mKeepLevel
protected

Referenced by WsfPathGuidance().

◆ mPauseTime

double WsfPathGuidance::mPauseTime
protected

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved