Servo#
- class InfernalRobotics.Servo#
Represents a servo. Obtained using
InfernalRobotics.ServoGroup.servos,InfernalRobotics.ServoGroup:servo_with_name()orInfernalRobotics.servo_with_name().-
name:
string# The name of the servo.
- Attribute:
Can be read or written
-
uid:
number# The unique identifier of the servo.
- Attribute:
Read-only, cannot be set
-
part:
SpaceCenter.Part# The part containing the servo.
- Attribute:
Read-only, cannot be set
-
mode:
InfernalRobotics.ServoMode# Whether the part acts as a servo or a rotor.
- Attribute:
Read-only, cannot be set
-
highlight:
boolean# Whether the servo should be highlighted in-game.
- Attribute:
Write-only, cannot be read
-
position:
number# The position of the servo.
- Attribute:
Read-only, cannot be set
-
min_config_position:
number# The minimum position of the servo, specified by the part configuration.
- Attribute:
Read-only, cannot be set
-
max_config_position:
number# The maximum position of the servo, specified by the part configuration.
- Attribute:
Read-only, cannot be set
-
min_position:
number# The minimum position of the servo, specified by the in-game tweak menu.
- Attribute:
Can be read or written
-
max_position:
number# The maximum position of the servo, specified by the in-game tweak menu.
- Attribute:
Can be read or written
-
config_speed:
number# The speed multiplier of the servo, specified by the part configuration.
- Attribute:
Read-only, cannot be set
-
speed:
number# The speed multiplier of the servo, specified by the in-game tweak menu.
- Attribute:
Can be read or written
-
current_speed:
number# The current speed at which the servo is moving.
- Attribute:
Read-only, cannot be set
-
acceleration:
number# The current speed multiplier set in the UI.
- Attribute:
Can be read or written
-
is_moving:
boolean# Whether the servo is moving.
- Attribute:
Read-only, cannot be set
-
is_free_moving:
boolean# Whether the servo is freely moving.
- Attribute:
Read-only, cannot be set
-
is_locked:
boolean# Whether the servo is locked.
- Attribute:
Can be read or written
-
is_axis_inverted:
boolean# Whether the servos axis is inverted.
- Attribute:
Can be read or written
-
target_position:
number# The target position the servo is moving towards.
- Attribute:
Read-only, cannot be set
-
target_speed:
number# The target speed the servo is moving at.
- Attribute:
Read-only, cannot be set
-
commanded_position:
number# The position the servo is currently being commanded to move to.
- Attribute:
Read-only, cannot be set
-
default_position:
number# The default (built) position of the servo.
- Attribute:
Read-only, cannot be set
-
force_limit:
number# The force limit of the servo, as a percentage of the maximum force.
- Attribute:
Can be read or written
-
max_force:
number# The maximum force the servo can generate.
- Attribute:
Read-only, cannot be set
-
max_acceleration:
number# The maximum acceleration the servo can achieve.
- Attribute:
Read-only, cannot be set
-
max_speed:
number# The maximum speed the servo can achieve.
- Attribute:
Read-only, cannot be set
-
electric_charge_required:
number# The rate at which the servo consumes electric charge, in \(\mathrm{units/s}\), when moving.
- Attribute:
Read-only, cannot be set
-
spring_power:
number# The strength of the servo’s spring, when it has one.
- Attribute:
Can be read or written
-
damping_power:
number# The strength of the servo’s damping.
- Attribute:
Can be read or written
-
rotor_acceleration:
number# The acceleration of the servo when operating as a rotor.
- Attribute:
Can be read or written
-
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
-
is_rotational:
boolean# Whether the servo moves rotationally (as opposed to linearly).
- Attribute:
Read-only, cannot be set
-
is_servo:
boolean# Whether the part is operating as a servo (rather than a rotor).
- Attribute:
Read-only, cannot be set
-
can_have_limits:
boolean# Whether the servo can have its range of movement limited.
- Attribute:
Read-only, cannot be set
-
has_spring:
boolean# Whether the servo has a spring.
- Attribute:
Read-only, cannot be set
-
is_running:
boolean# Whether the servo is running, when operating as a rotor.
- Attribute:
Read-only, cannot be set
-
preset_positions:
List# The list of preset positions configured for the servo.
- Attribute:
Read-only, cannot be set
- 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:
number, speed:number)# 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.
- stop()#
Stops the servo.
-
add_preset(position:
number)# Adds a preset position to the servo.
- Parameters:
position – The position of the preset.
-
remove_preset_at(index:
number)# Removes the preset position at the given index.
- Parameters:
index – The index of the preset to remove.
- sort_presets()#
Sorts the preset positions of the servo into ascending order.
-
name:
- 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.