Servo#
- public class Servo#
Represents a servo. Obtained using
ServoGroup.getServos(),ServoGroup.servoWithName(String)orservoWithName(SpaceCenter.Vessel, String).- int getUID()#
The unique identifier of the servo.
- Game Scenes:
Flight
- SpaceCenter.Part getPart()#
The part containing the servo.
- Game Scenes:
Flight
- void setHighlight(boolean value)#
Whether the servo should be highlighted in-game.
- Game Scenes:
Flight
- float getPosition()#
The position of the servo.
- Game Scenes:
Flight
- float getMinConfigPosition()#
The minimum position of the servo, specified by the part configuration.
- Game Scenes:
Flight
- float getMaxConfigPosition()#
The maximum position of the servo, specified by the part configuration.
- Game Scenes:
Flight
- float getMinPosition()#
- void setMinPosition(float value)#
The minimum position of the servo, specified by the in-game tweak menu.
- Game Scenes:
Flight
- float getMaxPosition()#
- void setMaxPosition(float value)#
The maximum position of the servo, specified by the in-game tweak menu.
- Game Scenes:
Flight
- float getConfigSpeed()#
The speed multiplier of the servo, specified by the part configuration.
- Game Scenes:
Flight
- float getSpeed()#
- void setSpeed(float value)#
The speed multiplier of the servo, specified by the in-game tweak menu.
- Game Scenes:
Flight
- float getCurrentSpeed()#
The current speed at which the servo is moving.
- Game Scenes:
Flight
- float getAcceleration()#
- void setAcceleration(float value)#
The current speed multiplier set in the UI.
- Game Scenes:
Flight
- boolean getIsMoving()#
Whether the servo is moving.
- Game Scenes:
Flight
- boolean getIsFreeMoving()#
Whether the servo is freely moving.
- Game Scenes:
Flight
- boolean getIsLocked()#
- void setIsLocked(boolean value)#
Whether the servo is locked.
- Game Scenes:
Flight
- boolean getIsAxisInverted()#
- void setIsAxisInverted(boolean value)#
Whether the servos axis is inverted.
- Game Scenes:
Flight
- float getTargetPosition()#
The target position the servo is moving towards.
- Game Scenes:
Flight
- float getTargetSpeed()#
The target speed the servo is moving at.
- Game Scenes:
Flight
- float getCommandedPosition()#
The position the servo is currently being commanded to move to.
- Game Scenes:
Flight
- float getDefaultPosition()#
The default (built) position of the servo.
- Game Scenes:
Flight
- float getForceLimit()#
- void setForceLimit(float value)#
The force limit of the servo, as a percentage of the maximum force.
- Game Scenes:
Flight
- float getMaxForce()#
The maximum force the servo can generate.
- Game Scenes:
Flight
- float getMaxAcceleration()#
The maximum acceleration the servo can achieve.
- Game Scenes:
Flight
- float getMaxSpeed()#
The maximum speed the servo can achieve.
- Game Scenes:
Flight
- float getElectricChargeRequired()#
The rate at which the servo consumes electric charge, in units per second, when moving.
- Game Scenes:
Flight
- float getSpringPower()#
- void setSpringPower(float value)#
The strength of the servo’s spring, when it has one.
- Game Scenes:
Flight
- float getDampingPower()#
- void setDampingPower(float value)#
The strength of the servo’s damping.
- Game Scenes:
Flight
- float getRotorAcceleration()#
- void setRotorAcceleration(float value)#
The acceleration of the servo when operating as a rotor.
- Game Scenes:
Flight
- boolean getIsLimited()#
- void setIsLimited(boolean value)#
Whether the servo’s range of movement is limited to the configured minimum and maximum positions.
- Game Scenes:
Flight
- boolean getIsRotational()#
Whether the servo moves rotationally (as opposed to linearly).
- Game Scenes:
Flight
- boolean getIsServo()#
Whether the part is operating as a servo (rather than a rotor).
- Game Scenes:
Flight
- boolean getCanHaveLimits()#
Whether the servo can have its range of movement limited.
- Game Scenes:
Flight
- boolean getHasSpring()#
Whether the servo has a spring.
- Game Scenes:
Flight
- boolean getIsRunning()#
Whether the servo is running, when operating as a rotor.
- Game Scenes:
Flight
- java.util.List<Float> getPresetPositions()#
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 (
float) – The position to move the servo to.speed (
float) – 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 (
float) – The position of the preset.
- Game Scenes:
Flight
- void removePresetAt(int index)#
Removes the preset position at the given index.
- Parameters:
index (
int) – 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