Class: LinearServo
A class that linearly drives a SimVar value towards a given set point.
Constructors
constructor
• new LinearServo(rate
): LinearServo
Creates an instance of a LinearServo.
Parameters
Name | Type | Description |
---|---|---|
rate | number | The default rate to drive this servo, in units per second. |
Returns
Defined in
src/sdk/utils/controllers/LinearServo.ts:11
Properties
rate
• rate: number
The default rate to drive this servo, in units per second.
Defined in
src/sdk/utils/controllers/LinearServo.ts:11
Methods
drive
▸ drive(currentValue
, setValue
, time?
, rate?
): number
Drives this servo towards the set point.
Parameters
Name | Type | Description |
---|---|---|
currentValue | number | The current value. |
setValue | number | The value to drive towards. |
time | number | The current timestamp, in milliseconds. Defaults to the current operating system time, as a Javascript timestamp. |
rate | number | The rate to use to drive this servo, in units per second. Defaults to this servo's default rate. |
Returns
number
The output value.
Defined in
src/sdk/utils/controllers/LinearServo.ts:22
reset
▸ reset(): void
Resets the servo to initial state
Returns
void
Defined in
src/sdk/utils/controllers/LinearServo.ts:45