Add autostage option, fix bugs, tune things.

This commit is contained in:
Anna Rose Wiggins 2021-08-12 19:14:20 -04:00
parent 0481123487
commit bbf1d118e3
3 changed files with 32 additions and 13 deletions

View file

@ -28,6 +28,7 @@ function Launch {
parameter LEAD_ANGLE is 5.
// parameter INITIAL_PITCH is 85.
parameter MINIMUM_PITCH is 5.
parameter AUTOSTAGE is true.
// Configure subsystems.
RCS off.
@ -42,12 +43,14 @@ function Launch {
// staging logic. Stage as many times as needed until we finish ascent.
// Once Apo target is attained just drop this trigger.
when FlameOut() or SHIP:ORBIT:APOAPSIS > APOAPSIS_TARGET then {
if SHIP:ORBIT:APOAPSIS > APOAPSIS_TARGET {
return false.
if AUTOSTAGE {
when FlameOut() or SHIP:ORBIT:APOAPSIS > APOAPSIS_TARGET then {
if SHIP:ORBIT:APOAPSIS > APOAPSIS_TARGET {
return false.
}
stage.
return true.
}
stage.
return true.
}
// Hold throttle to maintain target TWR.