Infernal Robotics¶
Warning
The Infernal Robotics mod has been migrating to Infernal Robotics Next. kOS includes support for IR Next only, and no longer supports re-compiled versions of the original IR. The links to the original mod forum thread and downloads remain in this file for historical context and reference.
Infernal Robotics Next download: https://github.com/meirumeiru/InfernalRobotics/releases
Infernal Robotics Next forum thread: https://forum.kerbalspaceprogram.com/index.php?/topic/170898–/
Historical download: http://kerbal.curseforge.com/ksp-mods/220267
Historical alternative download: https://github.com/MagicSmokeIndustries/InfernalRobotics/releases
Historical Forum thread, including full instructions: http://forum.kerbalspaceprogram.com/index.php?/topic/104535–/
Infernal Robotics might not be installed on your copy of the game.
Your script can test whether or not it’s installed by using
the boolean expression addons:available("ir")
.
Warning
At the time of this writing, IR Next officially supports KSP 1.3.1 and 1.4.2 with the beta 3 patch 7 “pre-release”. The addon has been tested using this 1.4.2 zip file running on KSP 1.6.1 with no errors reported. While using this addon, please keep in mind that IR Next may have underlying issues due to KSP version mismatch, and that newer releases to IR Next may cause this addon to break in unexpected ways.
Infernal Robotics introduces robotics parts to the game, letting you create moving or spinning contraptions that just aren’t possible under stock KSP.
Access structure IRAddon via ADDONS:IR
.
- structure IRAddon¶
Suffix
Type
Description
boolean (readonly)
Returns True if mod Infernal Robotics is installed, available to KOS and applicable to current craft. It is better to use
addons:available("rt")
.List of
IRControlGroup
Lists all Servo Groups for the Vessel on which CPU runs this command (see details below).
List of
IRServo
Lists all Servos for the Vessel on which CPU runs this command (see details below).
List of
IRServo
Lists all Servos for the provided part
- IRAddon:AVAILABLE¶
- Type
- Access
Get only
It is better to first call
ADDONS:AVAILABLE("IR")
to find out if the plugin exists.Returns True if mod Infernal Robotics is installed, available to KOS and applicable to current craft. Example of use:
if ADDONS:IR:AVAILABLE { //some IR dependent code }
- IRAddon:GROUPS¶
- Type
List
ofIRControlGroup
objects- Access
Get only
Lists all Servo Groups for the Vessel on which the script is being executed. Example of use:
for g in ADDONS:IR:GROUPS { Print g:NAME + " contains " + g:SERVOS:LENGTH + " servos". }
- IRAddon:ALLSERVOS¶
-
Lists all Servos for the Vessel on which the script is being executed. Example of use:
for s in ADDONS:IR:ALLSERVOS { print "Name: " + s:NAME + ", position: " + s:POSITION. }
- structure IRControlGroup¶
Suffix
Type
Description
Name of the Control Group
Speed multiplier set in the IR UI
True if Group is expanded in IR UI
Key assigned to forward movement
Key assigned to reverse movement
List (readonly)
List of servos in the group
Vessel object, owning this servo group. Readonly.
void
Commands servos in the group to move in positive direction
void
Commands servos in the group to move in negative direction
void
Commands servos in the group to move to default position
void
Commands servos in the group to move to next preset
void
Commands servos in the group to move to previous preset
void
Commands servos in the group to stop
- IRControlGroup:SPEED¶
- Type
- Access
Get/Set
Speed multiplier as set in the IR user interface. Avoid setting it to 0.
- IRControlGroup:FORWARDKEY¶
- Type
- Access
Get/Set
Key assigned to forward movement. Can be empty.
- IRControlGroup:REVERSEKEY¶
- Type
- Access
Get/Set
Key assigned to reverse movement. Can be empty.
- IRControlGroup:SERVOS¶
- Type
List of
IRServo
objects- Access
Get only
Lists Servos in the Group. Example of use:
for g in ADDONS:IR:GROUPS { Print g:NAME + " contains " + g:SERVOS:LENGTH + " servos:". for s in g:servos { print " " + s:NAME + ", position: " + s:POSITION. } }
- IRControlGroup:MOVERIGHT()¶
- Returns
void
Commands servos in the group to move in positive direction.
- IRControlGroup:MOVELEFT()¶
- Returns
void
Commands servos in the group to move in negative direction.
- IRControlGroup:MOVECENTER()¶
- Returns
void
Commands servos in the group to move to default position.
- IRControlGroup:MOVENEXTPRESET()¶
- Returns
void
Commands servos in the group to move to next preset
- IRControlGroup:MOVEPREVPRESET()¶
- Returns
void
Commands servos in the group to move to previous preset
- IRControlGroup:STOP()¶
- Returns
void
Commands servos in the group to stop
- structure IRServo¶
Suffix
Type
Description
Name of the Servo
scalar (int)
Unique ID of the servo part (part.flightID).
Boolean (set-only)
Set Hightlight status of the part.
scalar (readonly)
Current position of the servo.
scalar (readonly)
Minimum position for servo as defined by part creator in part.cfg
scalar (readonly)
Maximum position for servo as defined by part creator in part.cfg
Minimum position for servo, from tweakable.
Maximum position for servo, from tweakable.
scalar (readonly)
Servo movement speed as defined by part creator in part.cfg
Servo speed multiplier, from tweakable.
scalar (readonly)
Current Servo speed.
Servo acceleration multiplier, from tweakable.
Boolean (readonly)
True if Servo is moving
Boolean (readonly)
True if Servo is uncontrollable (ex. docking washer)
Servo’s locked status, set true to lock servo.
Servo’s inverted status, set true to invert servo’s axis.
A reference to a Part containing servo module.
void
Commands servo to move in positive direction
void
Commands servo to move in negative direction
void
Commands servo to move to default position
void
Commands servo to move to next preset
void
Commands servo to move to previous preset
void
Commands servo to stop
void
Commands servo to move to position with speedMult multiplier
- IRServo:MINCFGPOSITION¶
- Type
- Access
Get
Minimum position for servo as defined by part creator in part.cfg
- IRServo:MAXCFGPOSITION¶
- Type
- Access
Get
Maximum position for servo as defined by part creator in part.cfg
- IRServo:CONFIGSPEED¶
- Type
- Access
Get
Servo movement speed as defined by part creator in part.cfg
- IRServo:INVERTED¶
- Type
- Access
Get/Set
Servo’s inverted status, set true to invert servo’s axis.
- IRServo:PART¶
- Type
- Access
Get
Returns reference to the
Part
containing servo module. Please note that Part:UID does not equal IRServo:UID.
- IRServo:MOVERIGHT()¶
- Returns
void
Commands servo to move in positive direction
- IRServo:MOVELEFT()¶
- Returns
void
Commands servo to move in negative direction
- IRServo:MOVECENTER()¶
- Returns
void
Commands servo to move to default position
- IRServo:MOVENEXTPRESET()¶
- Returns
void
Commands servo to move to next preset
- IRServo:MOVEPREVPRESET()¶
- Returns
void
Commands servo to move to previous preset
- IRServo:STOP()¶
- Returns
void
Commands servo to stop
- IRServo:MOVETO(position, speedMult)¶
- Parameters
position – (float) Position to move to
speedMult – (float) Speed multiplier
- Returns
void
Commands servo to move to position with speedMult multiplier.
Example code:
print "IR Iavailable: " + ADDONS:IR:AVAILABLE.
Print "Groups:".
for g in ADDONS:IR:GROUPS
{
Print g:NAME + " contains " + g:SERVOS:LENGTH + " servos:".
for s in g:servos
{
print " " + s:NAME + ", position: " + s:POSITION.
if (g:NAME = "Hinges" and s:POSITION = 0)
{
s:MOVETO(30, 2).
}
else if (g:NAME = "Hinges" and s:POSITION > 0)
{
s:MOVETO(0, 1).
}
}
}