diff --git a/kOS.xml b/kOS.xml new file mode 100644 index 0000000..7ca57bb --- /dev/null +++ b/kOS.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/launch.ks b/launch.ks index 79ea8d8..7cba548 100755 --- a/launch.ks +++ b/launch.ks @@ -91,7 +91,7 @@ function launch { // Create maneuver node that will circularize the orbit. // NOTE: Potential errors in the inclination are not fixed, since we are most likely going to change our orbit, which will make the inclination change cheaper later on. - local node is node(TIME:SECONDS + ETA:APOAPSIS, 0, 0, 0). + local node is NODE(TIME:SECONDS + ETA:APOAPSIS, 0, 0, 0). // Burn magnitude in the prograde direction is the difference between the required velocity to acheive circular orbit at apoapsis altitude and our velocity at apoapsis local required_velocity is orbital_velocity_from_ap_pe(APOAPSIS, APOAPSIS, target_orbit_altitude). diff --git a/lib/node.ks b/lib/node.ks index 63b96f5..1319028 100755 --- a/lib/node.ks +++ b/lib/node.ks @@ -35,17 +35,17 @@ function execute_node { wait until vang(SHIP:facing:vector, node:deltav) < 0.5. print "Initializing warp". - warp_for(MAX(0, node:eta - (burn_duration/2) - 5)). // warp until 5s before node + warp_for(max(0, node:eta - (burn_duration/2) - 5)). // warp until 5s before node print "Approaching". - wait until node:eta <= CEILING(burn_duration/2). // CEILING instead of ROUND, since we'd rather start the burn too soon to have time for perfecting the burn + wait until node:eta <= ceiling(burn_duration/2). // CEILING instead of ROUND, since we'd rather start the burn too soon to have time for perfecting the burn print "Burn!". lock THROTTLE to 1.0. // Decrease throttle linearly when the burn duration is less than 1 second wait until estimated_burn_duration(node) <= 1. - lock THROTTLE to MAX(0.01, estimated_burn_duration(node)). // ensure we always finish by burning with at least 1% power + lock THROTTLE to max(0.01, estimated_burn_duration(node)). // ensure we always finish by burning with at least 1% power // The burn vector will start to drift once we have very little left to burn. Therefore, take a "snapshot" of the burn vector as it is right now, and lock steering to it, instead of the dynamic vector local dv0 is node:deltav.