Skip to content

Instantly share code, notes, and snippets.

@hughes
Created September 28, 2013 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hughes/6746545 to your computer and use it in GitHub Desktop.
Save hughes/6746545 to your computer and use it in GitHub Desktop.
// setup
SET offset TO ALT:RADAR.
SET alt_target TO 25.
SET max_throttle TO 0.5.
SAS ON.
LOG "MISSION START" TO output.
UNTIL 0 {
// setup
SET alt_radar TO ALT:RADAR - offset.
SET time TO MISSIONTIME.
SET throttle_target TO 0.
// control
SET error TO alt_target - alt_radar.
IF error > 0 AND time < 60 {
LOCK THROTTLE TO max_throttle.
}.
IF error < 0 OR time > 60 {
LOCK THROTTLE TO 0.
}.
// logging
SET line TO time + "," + alt_radar + "," + throttle_target.
LOG line TO output.
WAIT 0.1.
}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment