Skip to main content

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

NameTypeDescription
ratenumberThe default rate to drive this servo, in units per second.

Returns

LinearServo

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

NameTypeDescription
currentValuenumberThe current value.
setValuenumberThe value to drive towards.
timenumberThe current timestamp, in milliseconds. Defaults to the current operating system time, as a Javascript timestamp.
ratenumberThe 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