diff --git a/lib/launch_rocket.ks b/lib/launch_rocket.ks index c742cb8..7842828 100644 --- a/lib/launch_rocket.ks +++ b/lib/launch_rocket.ks @@ -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.