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
Name | Type | Description |
---|---|---|
bus | EventBus | An instance of the Event Bus. |
apValues | APValues | Autopilot values from this driver's parent autopilot. |
apMasterOn | Subscribable <boolean > | Whether the AP is engaged. |
options? | Readonly <AutopilotDriverOptions > | Options for this driver. |
Returns
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
Name | Type | Description |
---|---|---|
bank | number | The desired bank angle, in degrees. Positive values indicate left bank. |
rate? | number | The 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
Name | Type | Default value | Description |
---|---|---|---|
pitch | number | undefined | The desired pitch angle, in degrees. Positive values indicate downward pitch. |
adjustForAoa | boolean | false | Whether 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 . |
adjustForVerticalWind | boolean | false | Whether 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? | number | undefined | The 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
Name | Type | Default value | Description |
---|---|---|---|
bank | number | undefined | The commanded bank angle, in degrees. Positive values indicate left bank. |
resetServo | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
pitch | number | undefined | The commanded pitch angle, in degrees. Positive values indicate downward pitch. |
resetServo | boolean | true | Whether 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