WsfGuidanceComputer

WsfGuidanceComputer inherits WsfProcessor

Overview

WsfGuidanceComputer provides methods that can be used to dynamically alter the behavior of WSF_GUIDANCE_COMPUTER.

General Methods

void EjectStage()
void EjectStage(double aPreSeparationCoastTime, double aPreIgnitionCoastTime)

The first form informs the mover to stop the engines on the current stage and enter the post-burn coast phase of the stage. If not the final stage, a staging event will occur at the completion of the pre-separation coast. The next stage (if defined) will be activated and the engines will ignite at the completion of the pre-ignition coast. This is the same as calling EjectStage(-1, -1).

The second form allows the caller to override the pre_separation_coast_time of the current stage and the pre_ignition_coast_time of the following stage (if defined). If the value of an argument is less than zero then its corresponding value in the mover will not be changed.

void SelectPhase(string aPhaseName)

Immediately terminates the current phase and initiates the specified phase. The on_exit script block in the current phase is executed, then the on_entry script block is executed in the selected phase.

string Phase()

Returns the current phase.

void StopEngines()

This is the same as calling EjectStage().

Setting Values of Phase Commands

These method provide the ability to redefine the value of the command values for a phase. They exactly parallel the equivalent commands in WSF_GUIDANCE_COMPUTER.

Notes About Method Arguments and Return Values

Each of these methods has two forms:

  • The first form does not include a phase name and affects the value only for the current phase, e.g.:

    SetProportionalNavigationGain(4.0);
    

    This form is effective ONLY when called directly or indirectly from the on_entry or on_update script of the phase to be changed.

    Note

    Calling the single argument form from within the on_exit script block will have no affect as it alters the phase that is being left.

  • The second form has a phase name as the first argument and affects the value only for specified phase, e.g.:

    SetProportionalNavigationGain("TERMINAL", 5.0);
    

    These can be used in any script within the processor.

The return value indicates if the call was successful or false if it failed for some reason.

General Subcommands

bool SetGuidanceDelay(double aValue)
bool SetGuidanceDelay(string aPhaseName, double aValue)

Sets the value of guidance_delay (in seconds).

Aimpoint Selection Subcommands

bool SetGuidanceTarget(string aValue)
bool SetGuidanceTarget(string aPhaseName, string aValue)

Sets the value of guidance_target (“truth”, “perception”, “predicted_intercept”, “default”).

bool SetAllowRouteFollowing(bool aValue)
bool SetAllowRouteFollowing(string aPhaseName, bool aValue)

Sets the value of allow_route_following (true or false).

bool SetAimpointAltitudeOffset(double aValue)
bool SetAimpointAltitudeOffset(string aPhaseName, double aValue)

Sets the value of aimpoint_altitude_offset (meters).

bool SetAimpointAzimuthOffset(double aValue, string aDirection)
bool SetAimpointAzimuthOffset(string aPhaseName, double aValue, string aDirection)

Sets the value of aimpoint_azimuth_offset (degrees). aDirection must be “left”, “right” or “either”.

bool SetAimpointRangeOffset(double aValue)
bool SetAimpointRangeOffset(string aPhaseName, double aValue)

Sets the value of aimpoint_range_offset (meters).

bool SetAimpointEvaluationInterval(double aValue)
bool SetAimpointEvaluationInterval(string aPhaseName, double aValue)

Sets the value of aimpoint_evaluation_interval (seconds).

Trajectory Shaping Subcommands

bool SetGeeBias(double aValue)
bool SetGeeBias(string aPhaseName, double aValue)

Sets the value of g_bias (unitless).

bool SetLateralGeeBias(double aValue)
bool SetLateralGeeBias(string aPhaseName, double aValue)

Sets the value of lateral_g_bias (unitless).

bool ClearCommandedAltitude()
bool ClearCommandedAltitude(string aPhaseName)

Clears the commanded_altitude.

bool ClearCommandedSpeed()
bool ClearCommandedSpeed(string aPhaseName)

Clears the commanded_speed or commanded_mach.

bool ClearCommandedFlightPathAngle()
bool ClearCommandedFlightPathAngle(string aPhaseName)

Clears the commanded_flight_path_angle.

bool ClearCommandedThrottle()
bool ClearCommandedThrottle(string aPhaseName)

Clears the commanded_throttle (resumes the default throttle control in the mover).

bool SetCommandedAltitude(double aValue)
bool SetCommandedAltitude(string aPhaseName, double aValue)

Sets the value of commanded_altitude (meters above mean sea level).

bool SetCommandedAltitudeAGL(double aValue)
bool SetCommandedAltitudeAGL(string aPhaseName, double aValue)

Sets the value of commanded_altitude (meters above ground level).

bool SetCommandedAzimuthOffset(double aValue)
bool SetCommandedAzimuthOffset(string aPhaseName, double aValue)

Sets the value of commanded_azimuth_offset (degrees).

bool SetCommandedFlightPathAngle(double aValue)
bool SetCommandedFlightPathAngle(string aPhaseName, double aValue)

Sets the value of commanded_flight_path_angle (degrees). Use ClearCommandedFlightPathAngle() to disable the commanded flight path angle.

bool SetCommandedMach(double aValue)
bool SetCommandedMach(string aPhaseName, double aValue)

Sets the value of commanded_mach (unitless Mach number). Use ClearCommandedSpeed() to disable the commanded speed.

bool SetCommandedSpeed(double aValue)
bool SetCommandedSpeed(string aPhaseName, double aValue)

Sets the value of commanded_speed (meters/second). Use ClearCommandedSpeed() to disable the commanded speed.

bool SetCommandedThrottle(double aValue)
bool SetCommandedThrottle(string aPhaseName, double aValue)

Set the value of commanded_throttle in the range [0..1].

A value of 0 effectively stops the engines. The engines should be restarted by calling ClearCommandedThrottle().

Limiting Subcommands

bool SetMaximumCommandedGees(double aValue)
bool SetMaximumCommandedGees(string aPhaseName, double aValue)

Sets the value of maximum_commanded_g (G’s: i.e.: a value of 1.0 is 1 g).

bool SetMaximumAscentRate(double aValue)
bool SetMaximumAscentRate(string aPhaseName, double aValue)

Sets the value of maximum_ascent_rate (meters/second).

bool SetMaximumDescentRate(double aValue)
bool SetMaximumDescentRate(string aPhaseName, double aValue)

Sets the value of maximum_descent_rate (meters/second).

bool SetMaximumPitchAngle(double aValue)
bool SetMaximumPitchAngle(string aPhaseName, double aValue)

Sets the value of maximum_pitch_angle (degrees).

bool SetPitchChangeGain(double aValue)
bool SetPitchChangeGain(string aPhaseName, double aValue)

Sets the value of pitch_change_gain (unitless).

Examples

Script Example Within a WSF_GUIDANCE_COMPUTER:

phase BOOST2
  on_entry
     WsfTrack targetTrack = PLATFORM.CurrentTargetTrack();
     double targetRelativeHeading = PLATFORM.RelativeHeadingOf(targetTrack);
     double targetSlantRange = PLATFORM.SlantRangeTo(targetTrack);
     if ((targetRelativeHeading < 15) && (targetSlantRange <= 1000))
     {
        SelectPhase("TERMINAL");
     }
  end_on_entry
  max_commanded_g 7 g
  commanded_flight_path_angle 20 deg
  next_phase GLIDE when phase_time > 14 sec
end_phase