Class: AutopilotDriver
Defined in: src/sdk/autopilot/AutopilotDriver.ts:56
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
Defined in: src/sdk/autopilot/AutopilotDriver.ts:99
Creates an instance of this Autopilot Driver.
Parameters
Parameter | 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
AutopilotDriver
Methods
driveBank()
driveBank(
bank
,rate?
):void
Defined in: src/sdk/autopilot/AutopilotDriver.ts:187
Drives the commanded autopilot bank angle toward a desired value using a linear servo.
Parameters
Parameter | 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
drivePitch()
drivePitch(
pitch
,adjustForAoa
,adjustForVerticalWind
,rate?
,maxNoseDownPitch?
,maxNoseUpPitch?
):void
Defined in: src/sdk/autopilot/AutopilotDriver.ts:250
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
Parameter | 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. |
maxNoseDownPitch? | number | ... | The maximum nose down pitch angle, defaults to the global AP pitch limit. |
maxNoseUpPitch? | number | ... | The maximum nose up pitch angle, defaults to the global AP pitch limit. |
Returns
void
getAdjustedPitch()
getAdjustedPitch(
pitch
,adjustForAoa
,adjustForVerticalWind
):number
Defined in: src/sdk/autopilot/AutopilotDriver.ts:311
Adjusts a pitch angle optionally for AOA and vertical wind.
Parameters
Parameter | 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 . |
Returns
number
The adjusted pitch.
setBank()
setBank(
bank
,resetServo
):void
Defined in: src/sdk/autopilot/AutopilotDriver.ts:213
Sets the commanded autopilot bank angle, in degrees.
Parameters
Parameter | 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
setPitch()
setPitch(
pitch
,resetServo
,maxNoseDownPitch
,maxNoseUpPitch
):void
Defined in: src/sdk/autopilot/AutopilotDriver.ts:285
Sets the commanded autopilot pitch angle, in degrees.
Parameters
Parameter | 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 . |
maxNoseDownPitch | number | ... | The maximum nose down pitch angle, defaults to the global AP pitch limit. |
maxNoseUpPitch | number | ... | The maximum nose up pitch angle, defaults to the global AP pitch limit. |
Returns
void
update()
update():
void
Defined in: src/sdk/autopilot/AutopilotDriver.ts:164
Update loop to keep Ambient Wind Y constantly updated.
Returns
void