Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // kOS Launch Example
- // Set desired orbit parameters
- SET targetApoapsis TO 100000.
- SET targetInclination TO 0.
- // Stage separation altitude
- SET separationAltitude TO 25000.
- // Activate SAS and throttle up
- LOCK STEERING TO HEADING(90, 90).
- LOCK THROTTLE TO 1.
- // Launch countdown
- WAIT UNTIL COUNTDOWN < 5.
- // Ignition!
- STAGE. // Ignite the first stage
- // Gravity turn
- WAIT UNTIL SHIP:ALTITUDE > separationAltitude. // Begin gravity turn
- LOCK STEERING TO HEADING(90, 90 - (SHIP:ALTITUDE / 10000)). // Adjust heading based on altitude
- // Circularization burn
- WAIT UNTIL SHIP:APOAPSIS > targetApoapsis - 10000. // Begin circularization burn
- LOCK THROTTLE TO 0.5. // Reduce throttle for a controlled burn
- // Fine-tune orbit
- WAIT UNTIL SHIP:ORBIT:INCLINATION > targetInclination - 1 AND SHIP:ORBIT:INCLINATION < targetInclination + 1. // Adjust inclination
- LOCK THROTTLE TO 0. // Turn off engines
- // Print orbit information
- PRINT "Desired Apoapsis: " + targetApoapsis + " m.".
- PRINT "Desired Inclination: " + targetInclination + " degrees.".
- PRINT "Launch successful!".
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement