Servo#

class InfernalRobotics.Servo()#

Represents a servo. Obtained using InfernalRobotics.ServoGroup.getServos(), InfernalRobotics.ServoGroup.servoWithName() or InfernalRobotics.servoWithName().

Servo.getName()#
Servo.setName(value)#

The name of the servo.

Property:

Can be read or written

Return type:

string

Game Scenes:

Flight

Servo.getUID()#

The unique identifier of the servo.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getPart()#

The part containing the servo.

Property:

Read-only, cannot be set

Return type:

SpaceCenter.Part

Game Scenes:

Flight

Servo.getMode()#

Whether the part acts as a servo or a rotor.

Property:

Read-only, cannot be set

Return type:

InfernalRobotics.ServoMode

Game Scenes:

Flight

Servo.setHighlight(value)#

Whether the servo should be highlighted in-game.

Property:

Write-only, cannot be read

Return type:

boolean

Game Scenes:

Flight

Servo.getPosition()#

The position of the servo.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getMinConfigPosition()#

The minimum position of the servo, specified by the part configuration.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getMaxConfigPosition()#

The maximum position of the servo, specified by the part configuration.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getMinPosition()#
Servo.setMinPosition(value)#

The minimum position of the servo, specified by the in-game tweak menu.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Servo.getMaxPosition()#
Servo.setMaxPosition(value)#

The maximum position of the servo, specified by the in-game tweak menu.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Servo.getConfigSpeed()#

The speed multiplier of the servo, specified by the part configuration.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getSpeed()#
Servo.setSpeed(value)#

The speed multiplier of the servo, specified by the in-game tweak menu.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Servo.getCurrentSpeed()#

The current speed at which the servo is moving.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getAcceleration()#
Servo.setAcceleration(value)#

The current speed multiplier set in the UI.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Servo.getIsMoving()#

Whether the servo is moving.

Property:

Read-only, cannot be set

Return type:

boolean

Game Scenes:

Flight

Servo.getIsFreeMoving()#

Whether the servo is freely moving.

Property:

Read-only, cannot be set

Return type:

boolean

Game Scenes:

Flight

Servo.getIsLocked()#
Servo.setIsLocked(value)#

Whether the servo is locked.

Property:

Can be read or written

Return type:

boolean

Game Scenes:

Flight

Servo.getIsAxisInverted()#
Servo.setIsAxisInverted(value)#

Whether the servos axis is inverted.

Property:

Can be read or written

Return type:

boolean

Game Scenes:

Flight

Servo.getTargetPosition()#

The target position the servo is moving towards.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getTargetSpeed()#

The target speed the servo is moving at.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getCommandedPosition()#

The position the servo is currently being commanded to move to.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getDefaultPosition()#

The default (built) position of the servo.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getForceLimit()#
Servo.setForceLimit(value)#

The force limit of the servo, as a percentage of the maximum force.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Servo.getMaxForce()#

The maximum force the servo can generate.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getMaxAcceleration()#

The maximum acceleration the servo can achieve.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getMaxSpeed()#

The maximum speed the servo can achieve.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getElectricChargeRequired()#

The rate at which the servo consumes electric charge, in \(\mathrm{units/s}\), when moving.

Property:

Read-only, cannot be set

Return type:

number

Game Scenes:

Flight

Servo.getSpringPower()#
Servo.setSpringPower(value)#

The strength of the servo’s spring, when it has one.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Servo.getDampingPower()#
Servo.setDampingPower(value)#

The strength of the servo’s damping.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Servo.getRotorAcceleration()#
Servo.setRotorAcceleration(value)#

The acceleration of the servo when operating as a rotor.

Property:

Can be read or written

Return type:

number

Game Scenes:

Flight

Servo.getIsLimited()#
Servo.setIsLimited(value)#

Whether the servo’s range of movement is limited to the configured minimum and maximum positions.

Property:

Can be read or written

Return type:

boolean

Game Scenes:

Flight

Servo.getIsRotational()#

Whether the servo moves rotationally (as opposed to linearly).

Property:

Read-only, cannot be set

Return type:

boolean

Game Scenes:

Flight

Servo.getIsServo()#

Whether the part is operating as a servo (rather than a rotor).

Property:

Read-only, cannot be set

Return type:

boolean

Game Scenes:

Flight

Servo.getCanHaveLimits()#

Whether the servo can have its range of movement limited.

Property:

Read-only, cannot be set

Return type:

boolean

Game Scenes:

Flight

Servo.getHasSpring()#

Whether the servo has a spring.

Property:

Read-only, cannot be set

Return type:

boolean

Game Scenes:

Flight

Servo.getIsRunning()#

Whether the servo is running, when operating as a rotor.

Property:

Read-only, cannot be set

Return type:

boolean

Game Scenes:

Flight

Servo.getPresetPositions()#

The list of preset positions configured for the servo.

Property:

Read-only, cannot be set

Return type:

Array of number

Game Scenes:

Flight

Servo.moveRight()#

Moves the servo to the right.

Game Scenes:

Flight

Servo.moveLeft()#

Moves the servo to the left.

Game Scenes:

Flight

Servo.moveCenter()#

Moves the servo to the center.

Game Scenes:

Flight

Servo.moveTo(position, speed)#

Moves the servo to position and sets the speed multiplier to speed.

Arguments:
  • position (number) – The position to move the servo to.

  • speed (number) – Speed multiplier for the movement.

Game Scenes:

Flight

Servo.stop()#

Stops the servo.

Game Scenes:

Flight

Servo.addPreset(position)#

Adds a preset position to the servo.

Arguments:
  • position (number) – The position of the preset.

Game Scenes:

Flight

Servo.removePresetAt(index)#

Removes the preset position at the given index.

Arguments:
  • index (number) – The index of the preset to remove.

Game Scenes:

Flight

Servo.sortPresets()#

Sorts the preset positions of the servo into ascending order.

Game Scenes:

Flight

class InfernalRobotics.ServoMode()#

The mode a servo is operating in. See InfernalRobotics.Servo.getMode().

ServoMode.servo#

The part acts as a servo, driving towards a target position.

ServoMode.rotor#

The part acts as a rotor, spinning continuously.