WSF
WsfGuidanceComputer Class Reference

#include <WsfGuidanceComputer.hpp>

Inheritance diagram for WsfGuidanceComputer:
Collaboration diagram for WsfGuidanceComputer:

Classes

class  Variable
class  PhaseChange
 A class that defines the conditions for performing a change in guidance phase. More...
class  Phase
 A class that defines the guidance parameters for a phase of flight. More...
class  State
class  Commands

Public Member Functions

 WsfGuidanceComputer (WsfScenario &aScenarioPtr)
 ~WsfGuidanceComputer () override
WsfGuidanceComputeroperator= (const WsfGuidanceComputer &)=delete
Public Member Functions inherited from WsfScriptProcessor
 WsfScriptProcessor (const WsfScenario &aScenario)
 WsfScriptProcessor (const WsfScenario &aScenario, WsfStringId aPartClass, const std::string &aPartVarName)
 ~WsfScriptProcessor () override
WsfProcessorClone () const override
bool Initialize (double aSimTime) override
bool Initialize2 (double aSimTime) override
bool ProcessInput (UtInput &aInput) override
void Update (double aSimTime) override
bool ProcessMessage (double aSimTime, const WsfMessage &aMessage) override
void SendMessage (double aSimTime, const WsfMessage &aMessage) override
virtual void ExecuteOnMessageCreate (double aSimTime, WsfMessage &aMessage)
virtual bool ExecuteScript (double aSimTime, const std::string &aScriptName)
virtual bool ExecuteScript (double aSimTime, WsfStringId aScriptName, UtScriptData &aScriptRetVal, const UtScriptDataList &aScriptArgs=UtScriptDataList())
void ExecuteScriptAtTime (double aTime, WsfStringId aScriptName, const UtScriptDataList &aScriptArgs)
virtual void SuppressMessage (bool aSuppressMessage)
WsfScriptMessageHandlerGetMessageHandler ()
WsfScriptContextGetScriptContext ()
UtScriptContext * GetScriptAccessibleContext () const override
void SetPlatform (WsfPlatform *aPlatformPtr) override
const WsfBehaviorTreeBehaviorTree () const
WsfAdvancedBehaviorTreeAdvancedBehaviorTree () const
virtual const WsfScriptStateMachineGetStateMachine () const
wsf::ExternalLinksGetExternalLinks ()
std::string State ()
std::string StateAll ()
void SetState (std::string &stateName)
void SetStateAll (std::string &stateNameAll)
Public Member Functions inherited from WsfProcessor
 WsfProcessor (const WsfScenario &aScenario)
 ~WsfProcessor () override=default
ComponentListGetComponents ()
const ComponentListGetComponents () const
virtual void ProcessCallback (double aSimTime, const WsfCallback &aCallback)
WsfComponentCloneComponent () const override
const int * GetComponentRoles () const override
void * QueryInterface (int aRole) override
int GetComponentInitializationOrder () const override
const char * GetScriptClassName () const override
bool PreInitialize (double aSimTime) override
void PreInput () override
void TurnOff (double aSimTime) override
void TurnOn (double aSimTime) override
void SetNonOperational (double aSimTime) override
void SetOperational (double aSimTime) override
void PartBroken (double aSimTime) override
double GetUpdateInterval () const override
void SetUpdateInterval (double aUpdateInterval) override
Public Member Functions inherited from WsfPlatformPart
 WsfPlatformPart (const WsfScenario &aScenario, int aPartType)
WsfPlatformPartoperator= (const WsfPlatformPart &aRhs)=delete
 ~WsfPlatformPart () override
bool DebugEnabled () const
 Returns 'true' if debugging is enabled for this instance.
void SetDebugEnabled (bool aDebugEnabled)
unsigned int GetDebugMask ()
bool IsExternallyControlled () const
virtual void SetExternallyControlled (double aSimTime, bool aIsExternallyControlled)
int GetPartType () const
const char * GetScriptClassName () const override
WsfSimulationGetSimulation () const
const WsfScenarioGetScenario () const
WsfStringId GetComponentName () const override
void ComponentParentChanged (WsfPlatform *aPlatformPtr) override
WsfPlatformGetPlatform () const
virtual void PlatformAdded (double aSimTime, WsfPlatform *aPlatformPtr)
virtual void PlatformDeleted (WsfPlatform *aPlatformPtr)
double GetLastStatusChangeTime () const
void SetLastStatusChangeTime (double aSimTime)
 Allows a system to set the time at which the device was initialized.
bool CanBeMadeOperational () const
 Returns an indication that this system can be made operational.
bool CanBeMadeNonOperational () const
 Returns an indication that this system can be made non-operational.
bool CanBeTurnedOn () const
 Returns an indication that this system can be turned on.
bool CanBeTurnedOff () const
 Returns an indication that this system can be turned off.
bool IsTurnedOn () const
bool InitiallyTurnedOn () const
 Is the system to be turned 'on' when added to the simulation?
void SetInitiallyTurnedOn (bool aInitiallyTurnedOn)
 Sets if the system is turned on when added to the simulation.
virtual void Restore (double aSimTime)
bool IsOperational () const
bool SetOperational (double aSimTime, bool aMakeOperational)
double GetDamageFactor () const
bool SetDamageFactor (double aSimTime, double aDamageFactor)
bool IsCritical () const
void SetCritical (bool aValue)
virtual void OnPlatformBrokenEvent (double aSimTime)
 Owning platform has issued a broken event.
bool IsBroken () const
WsfInternalLinksGetInternalLinks ()
 Return the internal links for this part.
virtual bool HasInternalLinks () const
 Does this platform part have a communication link to other platform parts?
virtual bool ReceiveMessage (double aSimTime, const WsfMessage &aMessage)
virtual void SendMessageTo (double aSimTime, const WsfMessage &aMessage, WsfStringId aRecipientId)
void SendMessageToProcessor (double aSimTime, const WsfMessage &aMessage, WsfStringId aRecipientId)
virtual void SendQueuedMessages (double aSimTime)
const WsfCategoryListGetCategories () const
 Get the categories to which this part belongs.
void AddCategory (WsfStringId aCategoryId)
 Adds the provided category to the platform part's category list.
bool IsCategoryMember (WsfStringId aCategoryId) const
const WsfGroupListGetGroups () const
 Get the groups to which this platform part belongs.
void JoinGroup (WsfGroup *aGroupPtr)
 Join the given group.
void LeaveGroup (WsfGroup *aGroupPtr)
 Leave the given group.
bool IsGroupMember (WsfStringId aGroupId)
unsigned int GetUpdateEventEpoch () const
void IncrementUpdateEventEpoch ()
bool UpdateEventActive () const
 Is an 'Update' event active?
void SetUpdateEventActive (bool aUpdateEventActive)
 Indicate if the 'Update' event is active.
Public Member Functions inherited from WsfObject
 WsfObject ()
 This is the constructor for the WsfObject class.
 ~WsfObject () override
 This is the destructor for the WsfObject class.
const char * GetScriptClassName () const override
const std::string & GetType () const
WsfStringId GetTypeId () const
 Get the string ID of the 'type' of the object.
void SetType (WsfStringId aType)
const std::string & GetBaseType () const
WsfStringId GetBaseTypeId () const
const TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (const WsfObject &aRhs)
 Assignment operator.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)
Public Member Functions inherited from WsfComponentT< WsfPlatform >
 WsfComponentT ()
 WsfComponentT (const WsfComponentT &) noexcept
WsfComponentToperator= (const WsfComponentT &) noexcept
 ~WsfComponentT () override=default
ParentTypeGetComponentParent () const
void SetComponentParent (ParentType *aParentPtr)
Public Member Functions inherited from WsfComponent
virtual ~WsfComponent ()=default
template<typename T>
bool QueryInterfaceT (T *&aRolePtr)
bool ComponentHasRole (int aRole)
 Returns true if the component has the specified role.
Public Member Functions inherited from WsfUniqueId
 WsfUniqueId ()
 Construtor initializes the unique identifier to 0.
 WsfUniqueId (const WsfUniqueId &)
 Copy constructor initializes the unique identifier to 0.
WsfUniqueIdoperator= (const WsfUniqueId &)
unsigned int GetUniqueId () const
 Get the unique identifier assigned to this object.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
Public Member Functions inherited from WsfAuxDataEnabled
 WsfAuxDataEnabled ()=default
 WsfAuxDataEnabled (const WsfAuxDataEnabled &aSrc)=default
WsfAuxDataEnabledoperator= (const WsfAuxDataEnabled &aRhs)
 WsfAuxDataEnabled (WsfAuxDataEnabled &&)=default
WsfAuxDataEnabledoperator= (WsfAuxDataEnabled &&)=default
virtual ~WsfAuxDataEnabled () noexcept
void SetAuxData (const WsfAttributeContainer &aAuxData)
void DeleteAuxData ()
 Delete the aux data container from the object.
void MergeAuxData (const WsfAuxDataEnabled &aSrc)
 Merge the object's aux data with aux data from an existing object.
void UpdateAuxData (const WsfAuxDataEnabled &aSrc)
 Update the object's aux data with aux data from an existing object.
bool HasAuxData () const
 Returns true if this object has aux data.
bool ProcessInput (UtInput &aInput)
template<typename T>
void Serialize (T &aBuff)
 (De)serialization for XIO
WsfAttributeContainerGetAuxData ()
const WsfAttributeContainerGetAuxData () const noexcept
const WsfAttributeContainerGetAuxDataConst () const noexcept
Public Member Functions inherited from WsfMoverGuidance
 WsfMoverGuidance ()
virtual ~WsfMoverGuidance ()

Static Public Attributes

static const double cUNDEFINED_DOUBLE = 1.0E+30
 A value that indicates a double precision value has not been defined.
static const double cFROM_LAUNCH_COMPUTER = 1.0E+31
 Indicates 'flight_path_angle from_launch_computer'.
static const double cFLIGHT_PATH_ANGLE_TOLERANCE = 0.0001 * UtMath::cRAD_PER_DEG
 The tolerance for performing a flight path angle phase change.
static const double cLARGE_POSITIVE_DOUBLE = 1.0E+30
Static Public Attributes inherited from WsfAuxDataEnabled
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataAccessed
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataDestroyed

Friends

class WsfGuidanceProgram
class WsfScriptGuidanceComputer

Simulation callbacks

enum  GuidanceTarget { cGT_DEFAULT , cGT_TRUTH , cGT_PERCEPTION , cGT_PREDICTED_INTERCEPT }
enum  OffsetDirection { cOD_LEFT , cOD_RIGHT , cOD_EITHER }
virtual void SensorTrackInitiated (double aSimTime, WsfSensor *aSensorPtr, const WsfTrack *aTrackPtr)

Guidance programs.

using ProgramList = std::list<WsfGuidanceProgram*>
WsfGuidanceProgrammLegacyProgramPtr
ProgramList mDefinedPrograms
 The list of defined programs.
ProgramList mActivePrograms
size_t mProgramCompleteIndex
double mTimeConstant
 The guidance time constant for intercept navigation by the legacy program.
bool mGuideToTruth
 'true' if should guide to target truth.
bool mShowStatus
 'true' if 'show_status' specified
bool mShowDiagnostics
 'true' if 'show_diagnostics' specified
bool mShowCommands
 'true' if 'show_commands' specified
bool mShowEvaluations
 'true' if 'show_evaluations' specified.
bool mShowGraphics
 'true' if 'show_graphics' is specified
WsfGuidedMoverBasemMoverPtr
UtAtmosphere mAtmosphere
UtCallbackHolder mCallbacks
wsf::TerrainmTerrainPtr
double mLaunchTime
double mLaunchLocWCS [3]
double mLastUpdateTime
double mPhaseStartTime
double mGuidanceStartTime
double mCommandedFlightPathAngle
State mState
 The state of the weapon and target.

Called from guidance programs

std::vector< PhasemPhaseList
 The list of phases.
Phase mPhaseTemplate
 The template used to construct a phase.
bool mExplicitPhaseUsed
 'true' if a 'phase' command was used
bool mImplicitPhaseUsed
 'true' if a phase was defined without using 'phase'
WsfStringId mInitialPhaseName
 The name (ID) of the starting phase.
unsigned int mPhaseIndex
 The index of the current phase.
bool ShowStatus () const
bool ShowDiagnostics () const
bool ShowGraphics () const
PhaseGetCurrentPhase ()
double GetCommandedFlightPathAngle () const
double GetLastFlightPathAngle () const
double GetLaunchComputerFlightPathAngle () const
double GetTimeConstant (const Phase &aPhase) const
 Return the guidance time constant for the legacy guidance program.
double GetTimeSinceLaunch (double aSimTime)
double GetTimeSincePhaseStart (double aSimTime)
double GetLastUpdateTime () const
void DrawPoint (double aRedValue, double aGreenValue, double aBlueValue, int aPointSize)
void PrintStatusHeader (double aSimTime, double aCurTime, ut::log::MessageStream &aStream)
 WsfGuidanceComputer (const WsfGuidanceComputer &aSrc)
bool BeginExternalCommand (WsfStringId aPhaseName, unsigned int &aPhaseIndex)
 Begin processing for an external command (i.e.: from a script or other external source).
void BeginExternalCommandEcho (unsigned int aPhaseIndex, const char *aCommandPtr, ut::log::MessageStream &aStream)
virtual void CheckForPhaseChange (double aSimTime, double aEndTime)
 Check for a change in the guidance phase.
virtual void CheckForWaypointChange (double aSimTime, double aEndTime)
 Determine if a waypoint switch is required.
double ComputeAzimuth (const double aRelLoc[3]) const
double ComputeElevation (const double aRelLoc[3]) const
void ComputeInterceptData (double aCurTime, double &aTimeToGo, double &aRangeToGo)
 A helper for CheckForPhaseChange to compute the time and range to intercept.
unsigned int FindPhase (WsfStringId aPhaseName) const
WsfGuidanceProgramFindProgram (WsfStringId aProgramName) const
double GetSimTime () const
virtual void SelectPhase (double aSimTime, double aChangeTime, WsfStringId aPhaseName)
virtual void SelectWaypoint (double aSimTime, double aChangeTime, unsigned int aNewIndex)
 Select the indicated waypoint as the current target waypoint.
void StartProgram (double aSimTime, double aChangeTime, WsfStringId aProgramName)
void StopProgram (double aSimTime, double aChangeTime, WsfStringId aProgramName)
virtual bool UpdateAimpoint (double aCurTime, const Phase &aPhase)
void UpdateRouteFollowing (const Phase &aPhase)
virtual void UpdateTargetPerception (double aCurTime)
 Update the perception of the target.
void UpdateTerrainFollowing (const Phase &aPhase)
virtual void UpdateWeaponPerception (double aCurTime)
 Update the perception of the weapon.
bool ValidateNextPhaseName (const Phase &aPhase, WsfStringId aNextPhaseName)

persistent data between iterations about the weapon and the target.

double mLastFlightPathAngle
double mLastTgtUpdateTime
double mLastTgtLocWCS [3]
double mLastTgtVelWCS [3]
bool mTgtStateDefined

Predicted intercept data from the launch computer.

double mInterceptLocWCS [3]
double mLaunchComputerFlightPathAngle

Route following data.

unsigned int mRouteIndex
bool mFollowingRoute
bool mWasClosing

Aimpoint offset data.

If lateral aimpoint offset is provided it is not calculated every pass.

double mAimpointExpireTime
double mAimpointLocWCS [3]
unsigned int mAimpointDrawId
WsfDrawmDrawPtr
 For drawing graphics.
bool mOnExitScriptActive
 The following is used to prevent recursion if a SelectPhase occurs in the user 'on_exit' block.

Framework methods

WsfProcessorClone () const override
bool Initialize (double aSimTime) override
bool Initialize2 (double aSimTime) override
bool ProcessInput (UtInput &aInput) override
void TurnOff (double aSimTime) override
void TurnOn (double aSimTime) override
const char * GetScriptClassName () const override

Interface from WsfMoverGuidance

void UpdateGuidance (double aSimTime, double aCurTime, double aEndTime) override

Calls from external sources, such as scripts.

bool SelectPhase (WsfStringId aPhaseName)
bool ClearCommandedAltitude (WsfStringId aPhaseName)
bool ClearCommandedFlightPathAngle (WsfStringId aPhaseName)
bool ClearCommandedSpeed (WsfStringId aPhaseName)
bool ClearCommandedThrottle (WsfStringId aPhaseName)
bool SetAllowRouteFollowing (WsfStringId aPhaseName, bool aValue)
bool SetAimpointAltitudeOffset (WsfStringId aPhaseName, double aValue)
bool SetAimpointAzimuthOffset (WsfStringId aPhaseName, double aValue, const std::string &aDirection)
bool SetAimpointRangeOffset (WsfStringId aPhaseName, double aValue)
bool SetAimpointEvaluationInterval (WsfStringId aPhaseName, double aValue)
bool SetCommandedAltitude (WsfStringId aPhaseName, double aValue, bool aAltIsAGL)
bool SetCommandedAzimuthOffset (WsfStringId aPhaseName, double aValue)
bool SetCommandedFlightPathAngle (WsfStringId aPhaseName, double aValue)
bool SetCommandedMach (WsfStringId aPhaseName, double aValue)
bool SetCommandedSpeed (WsfStringId aPhaseName, double aValue)
bool SetCommandedThrottle (WsfStringId aPhaseName, double aValue)
bool SetGuidanceDelay (WsfStringId aPhaseName, double aValue)
bool SetGuidanceTarget (WsfStringId aPhaseName, const std::string &aValue)
bool SetProportionalNavigationGain (WsfStringId aPhaseName, double aValue)
bool SetProportionalNavigationLimitAngle (WsfStringId aPhaseName, double aValue)
bool SetProportionalNavigationMethod (WsfStringId aPhaseName, const std::string &aValue)
bool SetVelocityPursuitGain (WsfStringId aPhaseName, double aValue)
bool SetGeeBias (WsfStringId aPhaseName, double aValue)
virtual bool SetLateralGeeBias (WsfStringId aPhaseName, double aValue)
bool SetMaximumCommandedGees (WsfStringId aPhaseName, double aValue)
bool SetMaximumPitchAngle (WsfStringId aPhaseName, double aValue)
bool SetMaximumAscentRate (WsfStringId aPhaseName, double aValue)
bool SetMaximumDescentRate (WsfStringId aPhaseName, double aValue)
bool SetPitchChangeGain (WsfStringId aPhaseName, double aValue)
virtual bool EjectStage (double aPreSeparationCoastTime, double aPreIgnitionCoastTime)
virtual bool StopEngines ()
bool StartProgram (WsfStringId aProgramName)
bool StopProgram (WsfStringId aProgramName)

Callbacks from the mover when the route is updated or a staging transition occurs.

virtual void RouteChanged (double aSimTime)
virtual void StageIgnition (double aSimTime, double aEventTime)
virtual void StageBurnout (double aSimTime, double aEventTime)
virtual void StageSeparation (double aSimTime, double aEventTime)

Additional Inherited Members

using ComponentList = WsfComponentListT<WsfProcessorComponent>
Public Types inherited from WsfPlatformPart
enum  { cLEVEL_ONE_DEBUG = 0x00000001 , cLEVEL_TWO_DEBUG = 0x00000002 }
using InternalMessageQueue = std::queue<WsfMessage*>
using RecipientMessageQueue = std::queue<std::pair<WsfPlatformPart*, WsfMessage*>>
Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.
Public Types inherited from WsfComponentT< WsfPlatform >
typedef WsfPlatform ParentType
 This is needed to support the WsfComponentList template.
Protected Member Functions inherited from WsfScriptProcessor
 WsfScriptProcessor (const WsfScriptProcessor &aSrc)
 WsfProcessor (const WsfProcessor &aSrc)
 Copy constructor (for Clone()).
WsfProcessoroperator= (const WsfProcessor &aRhs)=delete
 WsfPlatformPart (const WsfPlatformPart &aSrc)
 Copy constructor (for Clone()).
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).
Protected Member Functions inherited from WsfUniqueId
void AssignUniqueId (WsfSimulation *aSimulationPtr)
Protected Attributes inherited from WsfScriptProcessor
WsfScriptContextmContextPtr
 Pointer to the script context.
WsfScriptMessageHandlermMessageHandlerPtr
 Pointer to the 'on_message' handler.
UtScript * mOnMessageCreateScriptPtr
 Pointer to the 'on_message_create' script.
UtScriptClass * mMessageClassPtr
wsf::ExternalLinks mExternalLinks
 The external recipients.
WsfBehaviorTreemBehaviorTreePtr
ut::CloneablePtr< WsfAdvancedBehaviorTreemAdvancedBehaviorTreePtr
std::unique_ptr< WsfScriptStateMachinemStateMachinePtr
int mStateIndex
bool mSuppressMessage

Detailed Description

A class representing a guidance computer for steering/influencing a Mover. The computer will follow proportional homing guidance to null Line-Of-Sight rates to intercept a Track. The track pointer will be "pushed" into this processor from some external source, extrapolated in time if required. The primary output of the class are constrained steering commands in pitch and yaw, which are pushed into the Mover to influence motion dynamics.

Member Typedef Documentation

◆ ProgramList

Member Enumeration Documentation

◆ GuidanceTarget

Enumerator
cGT_DEFAULT 
cGT_TRUTH 
cGT_PERCEPTION 
cGT_PREDICTED_INTERCEPT 

◆ OffsetDirection

Enumerator
cOD_LEFT 

Offset so target is on the left side of the weapon.

cOD_RIGHT 

Offset so target is on the right side of the weapon.

cOD_EITHER 

Offset so target on the side that causes least heading change of the weapon.

Constructor & Destructor Documentation

◆ WsfGuidanceComputer() [1/2]

◆ ~WsfGuidanceComputer()

WsfGuidanceComputer::~WsfGuidanceComputer ( )
override

◆ WsfGuidanceComputer() [2/2]

Member Function Documentation

◆ BeginExternalCommand()

◆ BeginExternalCommandEcho()

void WsfGuidanceComputer::BeginExternalCommandEcho ( unsigned int aPhaseIndex,
const char * aCommandPtr,
ut::log::MessageStream & aStream )
protected

◆ CheckForPhaseChange()

void WsfGuidanceComputer::CheckForPhaseChange ( double aSimTime,
double aEndTime )
protectedvirtual

Check for a change in the guidance phase.

Reimplemented in WsfP6DOF_GuidanceComputer.

References WsfGuidanceComputer::PhaseChange::cALTITUDE, WsfGuidanceComputer::PhaseChange::cCLOSING_SPEED, WsfGuidanceComputer::PhaseChange::cDYNAMIC_PRESSURE, WsfGuidanceComputer::PhaseChange::cEQUAL, WsfGuidanceComputer::PhaseChange::cFLIGHT_PATH_ANGLE, cFLIGHT_PATH_ANGLE_TOLERANCE, WsfGuidanceComputer::PhaseChange::cFLIGHT_TIME, WsfGuidanceComputer::PhaseChange::cGREATER, WsfGuidanceComputer::PhaseChange::cGREATER_OR_EQUAL, cLARGE_POSITIVE_DOUBLE, WsfGuidanceComputer::PhaseChange::cLESS, WsfGuidanceComputer::PhaseChange::cLESS_OR_EQUAL, WsfGuidanceComputer::PhaseChange::cLOS_TARGET_ANGLE, WsfGuidanceComputer::PhaseChange::cLOS_TARGET_AZIMUTH, WsfGuidanceComputer::PhaseChange::cLOS_TARGET_ELEVATION, WsfGuidanceComputer::PhaseChange::cNOT_EQUAL, ComputeAzimuth(), ComputeElevation(), ComputeInterceptData(), WsfGuidanceComputer::PhaseChange::cON_COMMANDED_FLIGHT_PATH_ANGLE, WsfGuidanceComputer::PhaseChange::ConditionSatisfied(), WsfGuidanceComputer::PhaseChange::cPHASE_TIME, WsfGuidanceComputer::PhaseChange::cRANGE_TO_INTERCEPT, WsfGuidanceComputer::PhaseChange::cSPEED, WsfGuidanceComputer::PhaseChange::cTARGET_ALTITUDE, WsfGuidanceComputer::PhaseChange::cTARGET_AZIMUTH, WsfGuidanceComputer::PhaseChange::cTARGET_ELEVATION, WsfGuidanceComputer::PhaseChange::cTARGET_FLIGHT_PATH_ANGLE, WsfGuidanceComputer::PhaseChange::cTARGET_GROUND_RANGE, WsfGuidanceComputer::PhaseChange::cTARGET_SLANT_RANGE, WsfGuidanceComputer::PhaseChange::cTARGET_SPEED, WsfGuidanceComputer::PhaseChange::cTIME_TO_INTERCEPT, cUNDEFINED_DOUBLE, WsfGuidanceComputer::PhaseChange::cVERTICAL_SPEED, WsfObject::GetName(), WsfPlatformPart::GetPlatform(), mAtmosphere, mCommandedFlightPathAngle, WsfGuidanceComputer::PhaseChange::mCondition, WsfScriptProcessor::mContextPtr, mLastFlightPathAngle, mLaunchTime, WsfGuidanceComputer::PhaseChange::mName, WsfGuidanceComputer::PhaseChange::mNextPhaseName, WsfGuidanceComputer::Phase::mPhaseChangeList, mPhaseIndex, mPhaseList, mPhaseStartTime, mProgramCompleteIndex, WsfGuidanceComputer::Phase::mProgramCompletePhaseName, mShowEvaluations, mState, mTgtStateDefined, WsfGuidanceComputer::PhaseChange::mValue, SelectPhase(), and WsfGuidanceComputer::Variable::Update().

Referenced by wsf::six_dof::GuidanceComputer::UpdateGuidance(), and UpdateGuidance().

◆ CheckForWaypointChange()

void WsfGuidanceComputer::CheckForWaypointChange ( double aSimTime,
double aEndTime )
protectedvirtual

Determine if a waypoint switch is required.

Reimplemented in wsf::six_dof::GuidanceComputer.

References WsfWaypoint::GetLat(), WsfWaypoint::GetLon(), WsfRoute::GetWaypointAt(), mMoverPtr, mRouteIndex, mState, mWasClosing, and SelectWaypoint().

Referenced by UpdateGuidance().

◆ ClearCommandedAltitude()

bool WsfGuidanceComputer::ClearCommandedAltitude ( WsfStringId aPhaseName)

Called from script to clear 'commanded_altitude'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), cUNDEFINED_DOUBLE, mPhaseIndex, mPhaseList, mShowCommands, ok, and UpdateTerrainFollowing().

Referenced by operator=().

◆ ClearCommandedFlightPathAngle()

bool WsfGuidanceComputer::ClearCommandedFlightPathAngle ( WsfStringId aPhaseName)

Called from script to clear 'commanded_flight_path_angle'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), cUNDEFINED_DOUBLE, mCommandedFlightPathAngle, mPhaseIndex, mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ ClearCommandedSpeed()

bool WsfGuidanceComputer::ClearCommandedSpeed ( WsfStringId aPhaseName)

Called from script to clear 'commanded_speed'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), cUNDEFINED_DOUBLE, mMoverPtr, mPhaseIndex, mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ ClearCommandedThrottle()

bool WsfGuidanceComputer::ClearCommandedThrottle ( WsfStringId aPhaseName)

Called from script to clear 'commanded_throttle'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mMoverPtr, mPhaseIndex, mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ Clone()

WsfProcessor * WsfGuidanceComputer::Clone ( ) const
overridevirtual

Create a clone of this object.

Returns
A pointer to the new copy.

Implements WsfProcessor.

Reimplemented in WsfP6DOF_GuidanceComputer.

References WsfGuidanceComputer(), and WsfProcessor::WsfProcessor().

◆ ComputeAzimuth()

double WsfGuidanceComputer::ComputeAzimuth ( const double aRelLoc[3]) const
protected

A helper for CheckForPhaseChange to compute the azimuth from a relative location vector. The incoming vector is assumed to be non-zero in length.

Referenced by CheckForPhaseChange(), and WsfP6DOF_GuidanceComputer::CheckForPhaseChange().

◆ ComputeElevation()

double WsfGuidanceComputer::ComputeElevation ( const double aRelLoc[3]) const
protected

A helper for CheckForPhaseChange to compute the elevation from a relative location vector. The incoming vector is assumed to be non-zero in length.

Referenced by CheckForPhaseChange(), and WsfP6DOF_GuidanceComputer::CheckForPhaseChange().

◆ ComputeInterceptData()

void WsfGuidanceComputer::ComputeInterceptData ( double aCurTime,
double & aTimeToGo,
double & aRangeToGo )
protected

◆ DrawPoint()

◆ EjectStage()

bool WsfGuidanceComputer::EjectStage ( double aPreSeparationCoastTime,
double aPreIgnitionCoastTime )
virtual

Called from script interface to command the mover to eject the current stage.

Parameters
aPreSeparationCoastTimeAllows the caller to override the pre_separation_coast_time for the current stage. If this value is less than zero then the value in the stage definition will be used.
aPreIgnitionCoastTimeAllows the caller to override the pre_ignition_coast_time for the current stage. If this value is less than zero then the value in the stage definition will be used.
Returns
true if successful, false if not.

References GetSimTime(), mMoverPtr, mShowCommands, ok, PrintStatusHeader(), and simTime.

Referenced by operator=().

◆ FindPhase()

unsigned int WsfGuidanceComputer::FindPhase ( WsfStringId aPhaseName) const
protected

Return the index of the phase with the specified name.

Parameters
aPhaseNameThe name (ID) of the phase to be located.
Returns
The index of the specified phase. If it could not be found then it will be the size of the phase list.

References mPhaseList.

Referenced by BeginExternalCommand(), wsf::six_dof::GuidanceComputer::Initialize(), Initialize(), WsfP6DOF_GuidanceComputer::Initialize(), ProcessInput(), WsfP6DOF_GuidanceComputer::ProcessInput(), wsf::six_dof::GuidanceComputer::SelectPhase(), SelectPhase(), WsfP6DOF_GuidanceComputer::SelectPhase(), and ValidateNextPhaseName().

◆ FindProgram()

WsfGuidanceProgram * WsfGuidanceComputer::FindProgram ( WsfStringId aProgramName) const
protected

Return the pointer to the program in the defined program list with the specified name.

Parameters
aProgramNameThe name (ID) of the program to be located.
Returns
The pointer to the requested program or zero if it could not be found.

References mDefinedPrograms, and WsfGuidanceProgram.

Referenced by wsf::six_dof::GuidanceComputer::Initialize(), Initialize(), WsfP6DOF_GuidanceComputer::Initialize(), wsf::six_dof::GuidanceComputer::SelectPhase(), SelectPhase(), WsfP6DOF_GuidanceComputer::SelectPhase(), and StartProgram().

◆ GetCommandedFlightPathAngle()

double WsfGuidanceComputer::GetCommandedFlightPathAngle ( ) const
inline

◆ GetCurrentPhase()

◆ GetLastFlightPathAngle()

double WsfGuidanceComputer::GetLastFlightPathAngle ( ) const
inline

References mLastFlightPathAngle.

◆ GetLastUpdateTime()

double WsfGuidanceComputer::GetLastUpdateTime ( ) const
inline

References mLastUpdateTime.

◆ GetLaunchComputerFlightPathAngle()

double WsfGuidanceComputer::GetLaunchComputerFlightPathAngle ( ) const
inline

◆ GetScriptClassName()

const char * WsfGuidanceComputer::GetScriptClassName ( ) const
override

◆ GetSimTime()

◆ GetTimeConstant()

double WsfGuidanceComputer::GetTimeConstant ( const Phase & aPhase) const

Return the guidance time constant for the legacy guidance program.

References mTimeConstant, and WsfGuidanceComputer::Phase::mTimeConstant.

◆ GetTimeSinceLaunch()

double WsfGuidanceComputer::GetTimeSinceLaunch ( double aSimTime)
inline

References mLaunchTime.

◆ GetTimeSincePhaseStart()

double WsfGuidanceComputer::GetTimeSincePhaseStart ( double aSimTime)
inline

References mPhaseStartTime.

◆ Initialize()

bool WsfGuidanceComputer::Initialize ( double aSimTime)
overridevirtual

Perform phase 1 initialization. This is called by WsfPlatform::Initialize() during phase 1 initialization of the platform. The component should complete validation of input data that could not be done by ProcessInput, as well as any other functions to prepare for simulation use (subject to the next paragraph).

The order in which components are initialized is defined by GetComponentInitializationOrder. In general a component implementation of this method should not be dependent on the state of another component, i.e.: it should not assume that the other components Initialize() method has been called. If such a dependency exists one should use Initialize2() if possible, or specify a value GetComponentInitializationOrder to force things to initialize in a particular order.

Parameters
aSimTimeThe current simulation time.
Returns
true if successful or false if unsuccessful (bad input data, etc.)
Note
This method should NOT add any other components to the platform. This MUST be done in PreInitialize().

Reimplemented from WsfComponent.

Reimplemented in WsfP6DOF_GuidanceComputer.

References WsfGuidanceProgramTypes::CreateInstance(), WsfPlatformPart::DebugEnabled(), FindPhase(), FindProgram(), WsfGuidanceProgramTypes::Get(), WsfPlatform::GetMover(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfPlatformPart::GetScenario(), WsfPlatformPart::GetSimulation(), WsfGuidanceComputer::Phase::Initialize(), WsfGuidanceProgram::Initialize(), WsfScriptProcessor::Initialize(), mAimpointDrawId, WsfGuidanceComputer::Phase::mBoostCompletePhaseName, mCallbacks, WsfScriptProcessor::mContextPtr, mDefinedPrograms, mDrawPtr, WsfGuidanceComputer::Phase::mEndOfRoutePhaseName, mInitialPhaseName, mLastUpdateTime, mLaunchLocWCS, mLaunchTime, mLegacyProgramPtr, mMoverPtr, WsfGuidanceComputer::Phase::mPhaseChangeList, mPhaseIndex, mPhaseList, WsfGuidanceComputer::Phase::mPhaseName, WsfGuidanceComputer::Phase::mProgramCompletePhaseName, WsfGuidanceComputer::Phase::mPrograms, WsfGuidanceComputer::Phase::mSensorTrackInitiatedPhaseName, mShowCommands, mShowEvaluations, mShowGraphics, mShowStatus, WsfGuidanceComputer::Phase::mStageBurnoutPhaseName, WsfGuidanceComputer::Phase::mStageIgnitionPhaseName, WsfGuidanceComputer::Phase::mStageSeparationPhaseName, mState, mTerrainPtr, ok, pi, RouteChanged(), SensorTrackInitiated(), WsfObserver::SensorTrackInitiated(), WsfPlatformPart::SetInitiallyTurnedOn(), StageBurnout(), StageIgnition(), StageSeparation(), ValidateNextPhaseName(), and WsfGuidanceProgram.

◆ Initialize2()

bool WsfGuidanceComputer::Initialize2 ( double aSimTime)
overridevirtual

Perform phase 2 initialization. This is called by WsfPlatform::Initialize() during phase 2 of platform initialization. This method is typically used when a component may have some dependency on another component having completed its phase 1 initialization. The component should be ready for use in the simulation upon completion of this method.

The order in which components are initialized is defined by GetComponentInitializationOrder.

Parameters
aSimTimeThe current simulation time.
Returns
true if successful or false if unsuccessful.
Note
This method MUST NOT add any other components to the platform. This MUST be done in PreInitialize().

Reimplemented from WsfComponent.

References WsfLaunchHandoffData::Find(), WsfTrackManager::GetCurrentTarget(), WsfLaunchComputer::GetInterceptPoint(), WsfLaunchHandoffData::GetInterceptPoint(), WsfGeoPoint::GetLocationWCS(), WsfLaunchComputer::GetLoftAngle(), WsfLaunchHandoffData::GetLoftAngle(), WsfPlatformPart::GetPlatform(), WsfPlatform::GetTrackManager(), WsfScriptProcessor::Initialize2(), WsfLaunchHandoffData::InterceptPointIsValid(), WsfLaunchHandoffData::LoftAngleIsValid(), mInterceptLocWCS, mLaunchComputerFlightPathAngle, ok, and trackPtr.

◆ operator=()

◆ PrintStatusHeader()

◆ ProcessInput()

bool WsfGuidanceComputer::ProcessInput ( UtInput & aInput)
overridevirtual

Process input from a generic source.

Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.

Parameters
aInputa reference to a UtInput object.
Returns
'true' if the command was one recognized by the class or 'false' if not.
Exceptions
UtInput::ExceptionBase(or an object derived from it) if the command was recognized but contains some sort of error.
Note
If a derived class does not recognize the command (i.e.: the return value is false) then it should call the base class ProcessInput method. This chain should continue until either the command is recognized or the top-level base class is encountered.

Reimplemented from WsfObject.

Reimplemented in WsfP6DOF_GuidanceComputer.

References FindPhase(), WsfGuidanceProgramTypes::Get(), WsfPlatformPart::GetScenario(), mAtmosphere, WsfScriptProcessor::mContextPtr, mDefinedPrograms, mExplicitPhaseUsed, mGuideToTruth, mImplicitPhaseUsed, mPhaseList, WsfGuidanceComputer::Phase::mPhaseName, mPhaseTemplate, mShowCommands, mShowDiagnostics, mShowEvaluations, mShowGraphics, mShowStatus, mTimeConstant, WsfGuidanceComputer::Phase::ProcessInput(), ProcessInput(), and WsfScriptProcessor::ProcessInput().

Referenced by ProcessInput().

◆ RouteChanged()

void WsfGuidanceComputer::RouteChanged ( double aSimTime)
virtual

A callback from the mover that indicates that the route has changed.

Parameters
aSimTimeThe current simulation time.

Reimplemented in wsf::six_dof::GuidanceComputer, and WsfP6DOF_GuidanceComputer.

References WsfRoute::Empty(), mFollowingRoute, mMoverPtr, mShowStatus, mWasClosing, PrintStatusHeader(), and SelectWaypoint().

Referenced by Initialize(), and operator=().

◆ SelectPhase() [1/2]

◆ SelectPhase() [2/2]

bool WsfGuidanceComputer::SelectPhase ( WsfStringId aPhaseName)

◆ SelectWaypoint()

void WsfGuidanceComputer::SelectWaypoint ( double aSimTime,
double aChangeTime,
unsigned int aNewIndex )
protectedvirtual

◆ SensorTrackInitiated()

void WsfGuidanceComputer::SensorTrackInitiated ( double aSimTime,
WsfSensor * aSensorPtr,
const WsfTrack * aTrackPtr )
virtual

Callback to indicate that a sensor track has begun.

Parameters
aSimTimeSimulation time.
aSensorPtrthe sensor producing the track.
aTrackPtrthe Track produced by the sensor.

Reimplemented in WsfP6DOF_GuidanceComputer.

References WsfPlatformPart::GetPlatform(), mPhaseIndex, mPhaseList, and SelectPhase().

Referenced by wsf::six_dof::GuidanceComputer::Initialize(), Initialize(), and operator=().

◆ SetAimpointAltitudeOffset()

bool WsfGuidanceComputer::SetAimpointAltitudeOffset ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'aimpoint_altitude_offset'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'aimpoint_altitude_offset' (meters)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mAimpointExpireTime, mPhaseIndex, mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetAimpointAzimuthOffset()

bool WsfGuidanceComputer::SetAimpointAzimuthOffset ( WsfStringId aPhaseName,
double aValue,
const std::string & aDirection )

Called from script to set the value of 'aimpoint_azimuth_offset'

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'aimpoint_azimuth_offset' (radians).
aDirectionThe direction of the offset ("left", "right", "either")
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), cOD_EITHER, cOD_LEFT, cOD_RIGHT, mAimpointExpireTime, mPhaseIndex, mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetAimpointEvaluationInterval()

bool WsfGuidanceComputer::SetAimpointEvaluationInterval ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'aimpoint_evaluation_interval'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'aimpoint_evaluation_interval' (meters)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetAimpointRangeOffset()

bool WsfGuidanceComputer::SetAimpointRangeOffset ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'aimpoint_range_offset'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'aimpoint_range_offset' (meters)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mAimpointExpireTime, mPhaseIndex, mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetAllowRouteFollowing()

bool WsfGuidanceComputer::SetAllowRouteFollowing ( WsfStringId aPhaseName,
bool aValue )

Called from script to set the value of 'allow_route_following'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'allow_route_following'
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseIndex, mPhaseList, mShowCommands, ok, and UpdateRouteFollowing().

Referenced by operator=().

◆ SetCommandedAltitude()

bool WsfGuidanceComputer::SetCommandedAltitude ( WsfStringId aPhaseName,
double aValue,
bool aAltIsAGL )

Called from script to set the value of 'commanded_altitude'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'commanded_altitude' (meters)
aAltIsAGLtrue if the commanded_altitude in AGL.
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseIndex, mPhaseList, mShowCommands, ok, and UpdateTerrainFollowing().

Referenced by operator=().

◆ SetCommandedAzimuthOffset()

bool WsfGuidanceComputer::SetCommandedAzimuthOffset ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'commanded_azimuth_offset'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'commanded_azimuth_offset' (radians)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetCommandedFlightPathAngle()

bool WsfGuidanceComputer::SetCommandedFlightPathAngle ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'commanded_flight_path_angle'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'commanded_flight_path_angle' (radians)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mCommandedFlightPathAngle, mPhaseIndex, mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetCommandedMach()

bool WsfGuidanceComputer::SetCommandedMach ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'commanded_mach'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'commanded_mach' (unitless)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetCommandedSpeed()

bool WsfGuidanceComputer::SetCommandedSpeed ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'commanded_speed'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'commanded_speed' (meters/second)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetCommandedThrottle()

bool WsfGuidanceComputer::SetCommandedThrottle ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'commanded_throttle'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'commanded_throttle' in the range [0..1]
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetGeeBias()

bool WsfGuidanceComputer::SetGeeBias ( WsfStringId aPhaseName,
double aValue )

Called from script to set g_bias.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new g_bias (unitless)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetGuidanceDelay()

bool WsfGuidanceComputer::SetGuidanceDelay ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'guidance_delay'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'guidance_delay' (seconds)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mGuidanceStartTime, mPhaseIndex, mPhaseList, mPhaseStartTime, mShowCommands, and ok.

Referenced by operator=().

◆ SetGuidanceTarget()

bool WsfGuidanceComputer::SetGuidanceTarget ( WsfStringId aPhaseName,
const std::string & aValue )

Called from script to set the value of 'guidance_target'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'guidance_target' (seconds)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), cGT_DEFAULT, cGT_PERCEPTION, cGT_PREDICTED_INTERCEPT, cGT_TRUTH, mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetLateralGeeBias()

bool WsfGuidanceComputer::SetLateralGeeBias ( WsfStringId aPhaseName,
double aValue )
virtual

Called from script interface to command the mover to begin/change a lateral bias trajectory.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe lateral bias requested (+right, -left).
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetMaximumAscentRate()

bool WsfGuidanceComputer::SetMaximumAscentRate ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'maximum_ascent_rate'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'maximum_ascent_rate' (meters/second)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetMaximumCommandedGees()

bool WsfGuidanceComputer::SetMaximumCommandedGees ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'maximum_commanded_g'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'maximum_commanded_g' (meters/seconds^2)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetMaximumDescentRate()

bool WsfGuidanceComputer::SetMaximumDescentRate ( WsfStringId aPhaseName,
double aValue )

Called from script to set the 'maximum_descent_rate'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'maximum_descent_rate' (meters/second)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetMaximumPitchAngle()

bool WsfGuidanceComputer::SetMaximumPitchAngle ( WsfStringId aPhaseName,
double aValue )

Called from script to set the 'maximum_pitch_angle'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'maximum_pitch_angle' (radians)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetPitchChangeGain()

bool WsfGuidanceComputer::SetPitchChangeGain ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'pitch_change_gain'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value for 'pitch_change_gain' (unitless)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetProportionalNavigationGain()

bool WsfGuidanceComputer::SetProportionalNavigationGain ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'proportional_navigation_gain'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value for 'proportional_navigation_gain' (unitless)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetProportionalNavigationLimitAngle()

bool WsfGuidanceComputer::SetProportionalNavigationLimitAngle ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value of 'proportional_navigation_limit_angle'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value for 'proportional_navigation_limit_angle' (radians)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetProportionalNavigationMethod()

bool WsfGuidanceComputer::SetProportionalNavigationMethod ( WsfStringId aPhaseName,
const std::string & aValue )

Called from script to set the value of 'proportional_navigation_method'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value for 'proportional_navigation_method' (unitless)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), WsfGuidanceComputer::Phase::cPN_AUGMENTED, WsfGuidanceComputer::Phase::cPN_PURE, mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ SetVelocityPursuitGain()

bool WsfGuidanceComputer::SetVelocityPursuitGain ( WsfStringId aPhaseName,
double aValue )

Called from script to set the value for 'velocity_pursuit_gain'.

Parameters
aPhaseNameThe phase name to be updated, or empty for the current phase.
aValueThe new value of 'velocity_pursuit_gain' (unitless)
Returns
true if successful, false if not.

References BeginExternalCommand(), BeginExternalCommandEcho(), mPhaseList, mShowCommands, and ok.

Referenced by operator=().

◆ ShowDiagnostics()

bool WsfGuidanceComputer::ShowDiagnostics ( ) const
inline

References mShowDiagnostics.

◆ ShowGraphics()

bool WsfGuidanceComputer::ShowGraphics ( ) const
inline

References mShowGraphics.

◆ ShowStatus()

bool WsfGuidanceComputer::ShowStatus ( ) const
inline

References mShowStatus.

◆ StageBurnout()

void WsfGuidanceComputer::StageBurnout ( double aSimTime,
double aEventTime )
virtual

A callback from the mover that indicates the current stage has just burned-out.

Parameters
aSimTimeThe current simulation time.
aEventTimeThe actual time the stage burned-out. This may be less than the current simulation time.

Reimplemented in wsf::six_dof::GuidanceComputer, and WsfP6DOF_GuidanceComputer.

References DrawPoint(), mMoverPtr, mPhaseIndex, mPhaseList, mShowGraphics, mShowStatus, PrintStatusHeader(), SelectPhase(), and UpdateWeaponPerception().

Referenced by Initialize(), and operator=().

◆ StageIgnition()

void WsfGuidanceComputer::StageIgnition ( double aSimTime,
double aEventTime )
virtual

A callback from the mover that indicates the current stage is igniting.

Parameters
aSimTimeThe current simulation time.
aEventTimeThe actual time the stage ignited. This may be less than the current simulation time.

Reimplemented in wsf::six_dof::GuidanceComputer, and WsfP6DOF_GuidanceComputer.

References DrawPoint(), mMoverPtr, mPhaseIndex, mPhaseList, mShowGraphics, mShowStatus, PrintStatusHeader(), SelectPhase(), and UpdateWeaponPerception().

Referenced by Initialize(), and operator=().

◆ StageSeparation()

void WsfGuidanceComputer::StageSeparation ( double aSimTime,
double aEventTime )
virtual

A callback from the mover that indicates the current stage is separating.

Parameters
aSimTimeThe current simulation time.
aEventTimeThe actual time the stage separated. This may be less than the current simulation time.

Reimplemented in wsf::six_dof::GuidanceComputer, and WsfP6DOF_GuidanceComputer.

References DrawPoint(), mMoverPtr, mPhaseIndex, mPhaseList, mShowGraphics, mShowStatus, PrintStatusHeader(), SelectPhase(), and UpdateWeaponPerception().

Referenced by Initialize(), and operator=().

◆ StartProgram() [1/2]

void WsfGuidanceComputer::StartProgram ( double aSimTime,
double aChangeTime,
WsfStringId aProgramName )
protected

◆ StartProgram() [2/2]

bool WsfGuidanceComputer::StartProgram ( WsfStringId aProgramName)

Called from script interface to start the specified guidance program.

Parameters
aProgramNameThe name (ID) of the program to be started.
Returns
true if successful, false if not.

References GetSimTime(), WsfPlatformPart::IsTurnedOn(), mShowCommands, ok, PrintStatusHeader(), simTime, and StartProgram().

Referenced by operator=(), and StartProgram().

◆ StopEngines()

bool WsfGuidanceComputer::StopEngines ( )
virtual

Called from script interface to command the mover to stop the engines.

Returns
true if successful, false if not.

Reimplemented in wsf::six_dof::GuidanceComputer, and WsfP6DOF_GuidanceComputer.

References GetSimTime(), mMoverPtr, mShowCommands, ok, PrintStatusHeader(), and simTime.

Referenced by operator=().

◆ StopProgram() [1/2]

void WsfGuidanceComputer::StopProgram ( double aSimTime,
double aChangeTime,
WsfStringId aProgramName )
protected

References mActivePrograms.

◆ StopProgram() [2/2]

bool WsfGuidanceComputer::StopProgram ( WsfStringId aProgramName)

Called from script interface to stop the specified guidance program.

Parameters
aProgramNameThe name (ID) of the program to be stopped.
Returns
true if successful, false if not.

References GetSimTime(), WsfPlatformPart::IsTurnedOn(), mShowCommands, ok, PrintStatusHeader(), simTime, and StopProgram().

Referenced by operator=(), and StopProgram().

◆ TurnOff()

void WsfGuidanceComputer::TurnOff ( double aSimTime)
overridevirtual

Turn off the platform part (system).

Parameters
aSimTimeThe current simulation time.

Reimplemented from WsfPlatformPart.

Reimplemented in WsfP6DOF_GuidanceComputer.

References WsfPlatformPart::GetPlatform(), mMoverPtr, WsfProcessor::TurnOff(), and WsfMoverGuidance::WsfMoverGuidance().

◆ TurnOn()

void WsfGuidanceComputer::TurnOn ( double aSimTime)
overridevirtual

Turn on the platform part (system).

Parameters
aSimTimeThe current simulation time.

Reimplemented from WsfPlatformPart.

Reimplemented in WsfP6DOF_GuidanceComputer.

References mInitialPhaseName, mLastUpdateTime, mMoverPtr, mPhaseIndex, mPhaseList, SelectPhase(), WsfProcessor::TurnOn(), UpdateTargetPerception(), and UpdateWeaponPerception().

◆ UpdateAimpoint()

◆ UpdateGuidance()

void WsfGuidanceComputer::UpdateGuidance ( double aSimTime,
double aCurTime,
double aEndTime )
overridevirtual

◆ UpdateRouteFollowing()

void WsfGuidanceComputer::UpdateRouteFollowing ( const Phase & aPhase)
protected

Determine if we are starting, continuing or stopping route following.

Parameters
aPhaseThe current phase.

References WsfRoute::Empty(), WsfGuidanceComputer::Phase::mAllowRouteFollowing, mFollowingRoute, mMoverPtr, and mRouteIndex.

Referenced by SelectPhase(), and SetAllowRouteFollowing().

◆ UpdateTargetPerception()

◆ UpdateTerrainFollowing()

void WsfGuidanceComputer::UpdateTerrainFollowing ( const Phase & aPhase)
protected

Update the terrain following status.

Parameters
aPhaseThe current phase.

References cUNDEFINED_DOUBLE, WsfGuidanceComputer::Phase::mCommandedAlt, WsfGuidanceComputer::Phase::mCommandedAltIsAGL, and mMoverPtr.

Referenced by ClearCommandedAltitude(), SelectPhase(), and SetCommandedAltitude().

◆ UpdateWeaponPerception()

void WsfGuidanceComputer::UpdateWeaponPerception ( double aCurTime)
protectedvirtual

◆ ValidateNextPhaseName()

bool WsfGuidanceComputer::ValidateNextPhaseName ( const Phase & aPhase,
WsfStringId aNextPhaseName )
protected

◆ WsfGuidanceProgram

◆ WsfScriptGuidanceComputer

friend class WsfScriptGuidanceComputer
friend

Member Data Documentation

◆ cFLIGHT_PATH_ANGLE_TOLERANCE

const double WsfGuidanceComputer::cFLIGHT_PATH_ANGLE_TOLERANCE = 0.0001 * UtMath::cRAD_PER_DEG
static

◆ cFROM_LAUNCH_COMPUTER

const double WsfGuidanceComputer::cFROM_LAUNCH_COMPUTER = 1.0E+31
static

◆ cLARGE_POSITIVE_DOUBLE

◆ cUNDEFINED_DOUBLE

◆ mActivePrograms

◆ mAimpointDrawId

◆ mAimpointExpireTime

◆ mAimpointLocWCS

◆ mAtmosphere

◆ mCallbacks

◆ mCommandedFlightPathAngle

◆ mDefinedPrograms

◆ mDrawPtr

◆ mExplicitPhaseUsed

bool WsfGuidanceComputer::mExplicitPhaseUsed
protected

◆ mFollowingRoute

◆ mGuidanceStartTime

◆ mGuideToTruth

◆ mImplicitPhaseUsed

bool WsfGuidanceComputer::mImplicitPhaseUsed
protected

'true' if a phase was defined without using 'phase'

Referenced by ProcessInput(), WsfP6DOF_GuidanceComputer::ProcessInput(), WsfGuidanceComputer(), and WsfGuidanceComputer().

◆ mInitialPhaseName

◆ mInterceptLocWCS

◆ mLastFlightPathAngle

◆ mLastTgtLocWCS

◆ mLastTgtUpdateTime

◆ mLastTgtVelWCS

◆ mLastUpdateTime

◆ mLaunchComputerFlightPathAngle

◆ mLaunchLocWCS

◆ mLaunchTime

◆ mLegacyProgramPtr

◆ mMoverPtr

◆ mOnExitScriptActive

bool WsfGuidanceComputer::mOnExitScriptActive
protected

The following is used to prevent recursion if a SelectPhase occurs in the user 'on_exit' block.

Referenced by wsf::six_dof::GuidanceComputer::SelectPhase(), SelectPhase(), WsfP6DOF_GuidanceComputer::SelectPhase(), WsfGuidanceComputer(), and WsfGuidanceComputer().

◆ mPhaseIndex

unsigned int WsfGuidanceComputer::mPhaseIndex
protected

The index of the current phase.

Referenced by BeginExternalCommand(), CheckForPhaseChange(), WsfP6DOF_GuidanceComputer::CheckForPhaseChange(), ClearCommandedAltitude(), ClearCommandedFlightPathAngle(), ClearCommandedSpeed(), ClearCommandedThrottle(), GetCurrentPhase(), wsf::six_dof::GuidanceComputer::Initialize(), Initialize(), WsfP6DOF_GuidanceComputer::Initialize(), wsf::six_dof::GuidanceComputer::SelectPhase(), SelectPhase(), SelectPhase(), WsfP6DOF_GuidanceComputer::SelectPhase(), wsf::six_dof::GuidanceComputer::SelectWaypoint(), SelectWaypoint(), SensorTrackInitiated(), WsfP6DOF_GuidanceComputer::SensorTrackInitiated(), SetAimpointAltitudeOffset(), SetAimpointAzimuthOffset(), SetAimpointRangeOffset(), SetAllowRouteFollowing(), SetCommandedAltitude(), SetCommandedFlightPathAngle(), SetGuidanceDelay(), wsf::six_dof::GuidanceComputer::StageBurnout(), StageBurnout(), WsfP6DOF_GuidanceComputer::StageBurnout(), wsf::six_dof::GuidanceComputer::StageIgnition(), StageIgnition(), WsfP6DOF_GuidanceComputer::StageIgnition(), wsf::six_dof::GuidanceComputer::StageSeparation(), StageSeparation(), WsfP6DOF_GuidanceComputer::StageSeparation(), wsf::six_dof::GuidanceComputer::TurnOn(), TurnOn(), WsfP6DOF_GuidanceComputer::TurnOn(), wsf::six_dof::GuidanceComputer::UpdateGuidance(), UpdateGuidance(), WsfP6DOF_GuidanceComputer::UpdateGuidance(), wsf::six_dof::GuidanceComputer::UpdateTargetPerception(), UpdateTargetPerception(), WsfP6DOF_GuidanceComputer::UpdateTargetPerception(), WsfGuidanceComputer(), and WsfGuidanceComputer().

◆ mPhaseList

std::vector<Phase> WsfGuidanceComputer::mPhaseList
protected

The list of phases.

Referenced by BeginExternalCommand(), BeginExternalCommandEcho(), CheckForPhaseChange(), WsfP6DOF_GuidanceComputer::CheckForPhaseChange(), ClearCommandedAltitude(), ClearCommandedFlightPathAngle(), ClearCommandedSpeed(), ClearCommandedThrottle(), FindPhase(), GetCurrentPhase(), wsf::six_dof::GuidanceComputer::Initialize(), Initialize(), WsfP6DOF_GuidanceComputer::Initialize(), ProcessInput(), WsfP6DOF_GuidanceComputer::ProcessInput(), wsf::six_dof::GuidanceComputer::SelectPhase(), SelectPhase(), WsfP6DOF_GuidanceComputer::SelectPhase(), wsf::six_dof::GuidanceComputer::SelectWaypoint(), SelectWaypoint(), SensorTrackInitiated(), WsfP6DOF_GuidanceComputer::SensorTrackInitiated(), SetAimpointAltitudeOffset(), SetAimpointAzimuthOffset(), SetAimpointEvaluationInterval(), SetAimpointRangeOffset(), SetAllowRouteFollowing(), SetCommandedAltitude(), SetCommandedAzimuthOffset(), SetCommandedFlightPathAngle(), SetCommandedMach(), SetCommandedSpeed(), SetCommandedThrottle(), SetGeeBias(), SetGuidanceDelay(), SetGuidanceTarget(), SetLateralGeeBias(), SetMaximumAscentRate(), SetMaximumCommandedGees(), SetMaximumDescentRate(), SetMaximumPitchAngle(), SetPitchChangeGain(), SetProportionalNavigationGain(), SetProportionalNavigationLimitAngle(), SetProportionalNavigationMethod(), SetVelocityPursuitGain(), wsf::six_dof::GuidanceComputer::StageBurnout(), StageBurnout(), WsfP6DOF_GuidanceComputer::StageBurnout(), wsf::six_dof::GuidanceComputer::StageIgnition(), StageIgnition(), WsfP6DOF_GuidanceComputer::StageIgnition(), wsf::six_dof::GuidanceComputer::StageSeparation(), StageSeparation(), WsfP6DOF_GuidanceComputer::StageSeparation(), wsf::six_dof::GuidanceComputer::TurnOn(), TurnOn(), WsfP6DOF_GuidanceComputer::TurnOn(), wsf::six_dof::GuidanceComputer::UpdateGuidance(), UpdateGuidance(), WsfP6DOF_GuidanceComputer::UpdateGuidance(), wsf::six_dof::GuidanceComputer::UpdateTargetPerception(), UpdateTargetPerception(), WsfP6DOF_GuidanceComputer::UpdateTargetPerception(), ValidateNextPhaseName(), WsfGuidanceComputer(), and WsfGuidanceComputer().

◆ mPhaseStartTime

◆ mPhaseTemplate

Phase WsfGuidanceComputer::mPhaseTemplate
protected

The template used to construct a phase.

Referenced by ProcessInput(), WsfP6DOF_GuidanceComputer::ProcessInput(), WsfGuidanceComputer(), and WsfGuidanceComputer().

◆ mProgramCompleteIndex

size_t WsfGuidanceComputer::mProgramCompleteIndex
protected

This index is used to indicate which 'next_phase' command in the current phase was referenced when a guidance program signals completion. It is initialized to the size of the list by SelectPhase. This indicates that an active program with a corresponded next_phase has not yet completed.

Referenced by CheckForPhaseChange(), wsf::six_dof::GuidanceComputer::SelectPhase(), SelectPhase(), wsf::six_dof::GuidanceComputer::UpdateGuidance(), UpdateGuidance(), WsfGuidanceComputer(), and WsfGuidanceComputer().

◆ mRouteIndex

◆ mShowCommands

◆ mShowDiagnostics

bool WsfGuidanceComputer::mShowDiagnostics
protected

'true' if 'show_diagnostics' specified

Referenced by ProcessInput(), ShowDiagnostics(), WsfGuidanceComputer(), and WsfGuidanceComputer().

◆ mShowEvaluations

◆ mShowGraphics

◆ mShowStatus

◆ mState

◆ mTerrainPtr

◆ mTgtStateDefined

◆ mTimeConstant

double WsfGuidanceComputer::mTimeConstant
protected

The guidance time constant for intercept navigation by the legacy program.

Referenced by GetTimeConstant(), ProcessInput(), WsfP6DOF_GuidanceComputer::ProcessInput(), WsfGuidanceComputer(), and WsfGuidanceComputer().

◆ mWasClosing


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