Servo#

class Servo#

Represents a servo. Obtained using ServoGroup.Servos, ServoGroup.ServoWithName or InfernalRobotics.ServoWithName.

string Name { get; set; }#

The name of the servo.

Game Scenes:

Flight

uint UID { get; }#

The unique identifier of the servo.

Game Scenes:

Flight

SpaceCenter.Part Part { get; }#

The part containing the servo.

Game Scenes:

Flight

ServoMode Mode { get; }#

Whether the part acts as a servo or a rotor.

Game Scenes:

Flight

bool Highlight { set; }#

Whether the servo should be highlighted in-game.

Game Scenes:

Flight

float Position { get; }#

The position of the servo.

Game Scenes:

Flight

float MinConfigPosition { get; }#

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

Game Scenes:

Flight

float MaxConfigPosition { get; }#

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

Game Scenes:

Flight

float MinPosition { get; set; }#

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

Game Scenes:

Flight

float MaxPosition { get; set; }#

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

Game Scenes:

Flight

float ConfigSpeed { get; }#

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

Game Scenes:

Flight

float Speed { get; set; }#

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

Game Scenes:

Flight

float CurrentSpeed { get; }#

The current speed at which the servo is moving.

Game Scenes:

Flight

float Acceleration { get; set; }#

The current speed multiplier set in the UI.

Game Scenes:

Flight

bool IsMoving { get; }#

Whether the servo is moving.

Game Scenes:

Flight

bool IsFreeMoving { get; }#

Whether the servo is freely moving.

Game Scenes:

Flight

bool IsLocked { get; set; }#

Whether the servo is locked.

Game Scenes:

Flight

bool IsAxisInverted { get; set; }#

Whether the servos axis is inverted.

Game Scenes:

Flight

float TargetPosition { get; }#

The target position the servo is moving towards.

Game Scenes:

Flight

float TargetSpeed { get; }#

The target speed the servo is moving at.

Game Scenes:

Flight

float CommandedPosition { get; }#

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

Game Scenes:

Flight

float DefaultPosition { get; }#

The default (built) position of the servo.

Game Scenes:

Flight

float ForceLimit { get; set; }#

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

Game Scenes:

Flight

float MaxForce { get; }#

The maximum force the servo can generate.

Game Scenes:

Flight

float MaxAcceleration { get; }#

The maximum acceleration the servo can achieve.

Game Scenes:

Flight

float MaxSpeed { get; }#

The maximum speed the servo can achieve.

Game Scenes:

Flight

float ElectricChargeRequired { get; }#

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

Game Scenes:

Flight

float SpringPower { get; set; }#

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

Game Scenes:

Flight

float DampingPower { get; set; }#

The strength of the servo’s damping.

Game Scenes:

Flight

float RotorAcceleration { get; set; }#

The acceleration of the servo when operating as a rotor.

Game Scenes:

Flight

bool IsLimited { get; set; }#

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

Game Scenes:

Flight

bool IsRotational { get; }#

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

Game Scenes:

Flight

bool IsServo { get; }#

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

Game Scenes:

Flight

bool CanHaveLimits { get; }#

Whether the servo can have its range of movement limited.

Game Scenes:

Flight

bool HasSpring { get; }#

Whether the servo has a spring.

Game Scenes:

Flight

bool IsRunning { get; }#

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

Game Scenes:

Flight

IList<float> PresetPositions { get; }#

The list of preset positions configured for the servo.

Game Scenes:

Flight

void MoveRight ()#

Moves the servo to the right.

Game Scenes:

Flight

void MoveLeft ()#

Moves the servo to the left.

Game Scenes:

Flight

void MoveCenter ()#

Moves the servo to the center.

Game Scenes:

Flight

void MoveTo (float position, float speed)#

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

Parameters:
  • position – The position to move the servo to.

  • speed – Speed multiplier for the movement.

Game Scenes:

Flight

void Stop ()#

Stops the servo.

Game Scenes:

Flight

void AddPreset (float position)#

Adds a preset position to the servo.

Parameters:
  • position – The position of the preset.

Game Scenes:

Flight

void RemovePresetAt (int index)#

Removes the preset position at the given index.

Parameters:
  • index – The index of the preset to remove.

Game Scenes:

Flight

void SortPresets ()#

Sorts the preset positions of the servo into ascending order.

Game Scenes:

Flight

enum ServoMode#

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

Servo#

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

Rotor#

The part acts as a rotor, spinning continuously.