Servo#

class InfernalRobotics.Servo#

Represents a servo. Obtained using InfernalRobotics.ServoGroup.servos, InfernalRobotics.ServoGroup.servo_with_name() or InfernalRobotics.servo_with_name().

name: string#

The name of the servo.

Attribute:

Can be read or written

Return type:

string

uid: number#

The unique identifier of the servo.

Attribute:

Read-only, cannot be set

Return type:

number

part: SpaceCenter.Part#

The part containing the servo.

Attribute:

Read-only, cannot be set

Return type:

SpaceCenter.Part

mode: InfernalRobotics.ServoMode#

Whether the part acts as a servo or a rotor.

Attribute:

Read-only, cannot be set

Return type:

InfernalRobotics.ServoMode

highlight: boolean#

Whether the servo should be highlighted in-game.

Attribute:

Write-only, cannot be read

Return type:

boolean

position: number#

The position of the servo.

Attribute:

Read-only, cannot be set

Return type:

number

min_config_position: number#

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

Attribute:

Read-only, cannot be set

Return type:

number

max_config_position: number#

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

Attribute:

Read-only, cannot be set

Return type:

number

min_position: number#

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

Attribute:

Can be read or written

Return type:

number

max_position: number#

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

Attribute:

Can be read or written

Return type:

number

config_speed: number#

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

Attribute:

Read-only, cannot be set

Return type:

number

speed: number#

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

Attribute:

Can be read or written

Return type:

number

current_speed: number#

The current speed at which the servo is moving.

Attribute:

Read-only, cannot be set

Return type:

number

acceleration: number#

The current speed multiplier set in the UI.

Attribute:

Can be read or written

Return type:

number

is_moving: boolean#

Whether the servo is moving.

Attribute:

Read-only, cannot be set

Return type:

boolean

is_free_moving: boolean#

Whether the servo is freely moving.

Attribute:

Read-only, cannot be set

Return type:

boolean

is_locked: boolean#

Whether the servo is locked.

Attribute:

Can be read or written

Return type:

boolean

is_axis_inverted: boolean#

Whether the servos axis is inverted.

Attribute:

Can be read or written

Return type:

boolean

target_position: number#

The target position the servo is moving towards.

Attribute:

Read-only, cannot be set

Return type:

number

target_speed: number#

The target speed the servo is moving at.

Attribute:

Read-only, cannot be set

Return type:

number

commanded_position: number#

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

Attribute:

Read-only, cannot be set

Return type:

number

default_position: number#

The default (built) position of the servo.

Attribute:

Read-only, cannot be set

Return type:

number

force_limit: number#

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

Attribute:

Can be read or written

Return type:

number

max_force: number#

The maximum force the servo can generate.

Attribute:

Read-only, cannot be set

Return type:

number

max_acceleration: number#

The maximum acceleration the servo can achieve.

Attribute:

Read-only, cannot be set

Return type:

number

max_speed: number#

The maximum speed the servo can achieve.

Attribute:

Read-only, cannot be set

Return type:

number

electric_charge_required: number#

The rate at which the servo consumes electric charge, in units per second, when moving.

Attribute:

Read-only, cannot be set

Return type:

number

spring_power: number#

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

Attribute:

Can be read or written

Return type:

number

damping_power: number#

The strength of the servo’s damping.

Attribute:

Can be read or written

Return type:

number

rotor_acceleration: number#

The acceleration of the servo when operating as a rotor.

Attribute:

Can be read or written

Return type:

number

is_limited: boolean#

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

Attribute:

Can be read or written

Return type:

boolean

is_rotational: boolean#

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

Attribute:

Read-only, cannot be set

Return type:

boolean

is_servo: boolean#

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

Attribute:

Read-only, cannot be set

Return type:

boolean

can_have_limits: boolean#

Whether the servo can have its range of movement limited.

Attribute:

Read-only, cannot be set

Return type:

boolean

has_spring: boolean#

Whether the servo has a spring.

Attribute:

Read-only, cannot be set

Return type:

boolean

is_running: boolean#

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

Attribute:

Read-only, cannot be set

Return type:

boolean

preset_positions: List#

The list of preset positions configured for the servo.

Attribute:

Read-only, cannot be set

Return type:

List

move_right()#

Moves the servo to the right.

move_left()#

Moves the servo to the left.

move_center()#

Moves the servo to the center.

move_to(position, speed)#

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

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

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

stop()#

Stops the servo.

add_preset(position)#

Adds a preset position to the servo.

Parameters:

position (number) – The position of the preset.

remove_preset_at(index)#

Removes the preset position at the given index.

Parameters:

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

sort_presets()#

Sorts the preset positions of the servo into ascending order.

class InfernalRobotics.ServoMode#

The mode a servo is operating in. See InfernalRobotics.Servo.mode.

servo#

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

rotor#

The part acts as a rotor, spinning continuously.