Arbitrary function name change seems to have fixed strange runtime bug.

This commit is contained in:
Anna Rose 2021-08-21 04:49:34 -04:00
parent 15c479cd18
commit 55af841aeb

View File

@ -2,14 +2,12 @@ RunOncePath("lib/throttle").
RunOncePath("lib/navigation").
// Calculate the direction to lock during ascent.
function getAscentDir {
parameter leadAngle is 5.
function getClampedDir {
parameter minPitch is 5.
// face just beneath prograde, but hold a solid eastern heading and don't
// rotate the ship
local newHeading is lookdirup(SHIP:SRFPROGRADE:FOREVECTOR, heading(90, 0, 270):TOPVECTOR).
set newHeading to angleaxis(leadAngle, newHeading:TOPVECTOR)*newHeading.
if getPitch(newHeading:FOREVECTOR) < minPitch {
set newHeading to heading(90, minPitch, 270).
}
@ -88,7 +86,7 @@ function Launch {
wait pitchTime.
print "Phase 3: Stable Prograde Boost.".
lock STEERING to getAscentDir(0, minPitch).
lock STEERING to getClampedDir(minPitch).
wait until SHIP:ORBIT:APOAPSIS > apoapsisTarget.
// TODO: A smoother approach based on target orbital velocity should be considered.