35 lines
771 B
Plaintext
35 lines
771 B
Plaintext
// Automated reentry.
|
|
// Assumes stage 0 contains only parachutes.
|
|
// Primarily written for small science payload probes.
|
|
|
|
RunOncePath("lib/systems").
|
|
|
|
function PerformReentry {
|
|
parameter retractAntennae is true.
|
|
|
|
SAS off.
|
|
|
|
print "Reentry mode activated. Control permanently locked.".
|
|
|
|
local normal is VCrs(SHIP:SRFPROGRADE:FOREVECTOR, SHIP:UP:FOREVECTOR).
|
|
lock STEERING to normal.
|
|
wait until Vang(SHIP:FACING:FOREVECTOR, normal) < 5.
|
|
wait until SHIP:ALTITUDE < 70000.
|
|
|
|
// stage until only stage 0 remains.
|
|
until STAGE:NUMBER <= 1 {
|
|
stage.
|
|
}
|
|
|
|
lock STEERING to SHIP:SRFRETROGRADE.
|
|
|
|
if retractAntennae {
|
|
Antennas(false).
|
|
}
|
|
|
|
wait until SHIP:ALTITUDE - Max(SHIP:GEOPOSITION:TERRAINHEIGHT, 0) < 2500.
|
|
CHUTES on.
|
|
|
|
wait until false.
|
|
}
|