Skip to main content

Class: AutopilotDriver

An autopilot driver to set pitch and bank values in the sim AP.

This driver follows the sim's convention for negative and positive values: AUTOPILOT BANK HOLD REF/PLANE BANK DEGREES: negative = right, positive = left AUTOPILOT PITCH HOLD REF/PLANE PITCH DEGREES: negative = up, positive = down INCIDENCE ALPHA: negative = down, positive = up AMBIENT WIND Y: negative = down, positive = up

Constructors

constructor

new AutopilotDriver(bus, apValues, apMasterOn, options?): AutopilotDriver

Creates an instance of this Autopilot Driver.

Parameters

NameTypeDescription
busEventBusAn instance of the Event Bus.
apValuesAPValuesAutopilot values from this driver's parent autopilot.
apMasterOnSubscribable<boolean>Whether the AP is engaged.
options?Readonly<AutopilotDriverOptions>Options for this driver.

Returns

AutopilotDriver

Defined in

src/sdk/autopilot/AutopilotDriver.ts:98

Methods

driveBank

driveBank(bank, rate?): void

Drives the commanded autopilot bank angle toward a desired value using a linear servo.

Parameters

NameTypeDescription
banknumberThe desired bank angle, in degrees. Positive values indicate left bank.
rate?numberThe rate at which to drive the commanded bank angle, in degrees per second. Defaults to the bank servo's default rate.

Returns

void

Defined in

src/sdk/autopilot/AutopilotDriver.ts:186


drivePitch

drivePitch(pitch, adjustForAoa?, adjustForVerticalWind?, rate?): void

Drives the commanded autopilot pitch angle toward a desired value using a linear servo while optionally correcting for angle of attack and vertical wind.

Parameters

NameTypeDefault valueDescription
pitchnumberundefinedThe desired pitch angle, in degrees. Positive values indicate downward pitch.
adjustForAoabooleanfalseWhether to adjust the commanded pitch angle for angle of attack. If true, the provided pitch angle is treated as a desired flight path angle and a new commanded pitch angle will be calculated to produce the desired FPA given the airplane's current angle of attack. This correction can be used in conjunction with the vertical wind correction. Defaults to false.
adjustForVerticalWindbooleanfalseWhether to adjust the commanded pitch angle for vertical wind velocity. If true, the provided pitch angle is treated as a desired flight path angle and a new commanded pitch angle will be calculated to produce the desired FPA given the current vertical wind component. This correction can be used in conjunction with the angle of attack correction. Defaults to false.
rate?numberundefinedThe rate at which to drive the commanded pitch angle, in degrees per second. Defaults to the pitch servo's default rate.

Returns

void

Defined in

src/sdk/autopilot/AutopilotDriver.ts:247


setBank

setBank(bank, resetServo?): void

Sets the commanded autopilot bank angle, in degrees.

Parameters

NameTypeDefault valueDescription
banknumberundefinedThe commanded bank angle, in degrees. Positive values indicate left bank.
resetServobooleantrueWhether to reset the bank servo. Defaults to true.

Returns

void

Defined in

src/sdk/autopilot/AutopilotDriver.ts:212


setPitch

setPitch(pitch, resetServo?): void

Sets the commanded autopilot pitch angle, in degrees.

Parameters

NameTypeDefault valueDescription
pitchnumberundefinedThe commanded pitch angle, in degrees. Positive values indicate downward pitch.
resetServobooleantrueWhether to reset the pitch servo. Defaults to true.

Returns

void

Defined in

src/sdk/autopilot/AutopilotDriver.ts:288


update

update(): void

Update loop to keep Ambient Wind Y constantly updated.

Returns

void

Defined in

src/sdk/autopilot/AutopilotDriver.ts:163