Jump to content

KOS: Easy flight recorder script for your auto liftoff needs!.


SpaceCarmelo

Recommended Posts

Are you tired of writing on paper your flight data when testing a rocket, in order to write a kos program for auto-liftoff later? 

I was tired too! That's why i invented my own software.

Let me introduce you ACFEL! Automatic Check For Experimental Liftoff!

If you are a n00b like me, probably you used to build an experimental rocket, flight it to Kerbin orbit, write down on paper at what altitude you where pitching your nose, and then trying to reproduce your flight it with KOS with more or less Kerbal-Style results. :rolleyes:

But with this simple program you can finally take some snapshots of your liftoff in order to check your data later and write your liftoff program with no stress!

(edit: some stress included when you forget "." at the end of a line :mad: )

Simply run ACFEL on your KOS CPU and spam Action Group 4 everytime you do something significant in your liftoff, ACFEL will print several .csv files containing altitude, apoapsis, throttle, pitch and all the informations you need when testing a rocket.

Then simply push your .csv on Github and make a Google Sheet document that takes data from the Github links (using the =IMPORTDATA("link") function on Google Sheets) and Hey! Look at that, that's your flight! Finally recorded. 

HPrWfUI.png

Hint#1: use ACFEL inside a folder since your .csv files will be exported in the same directory where the ACFEL.ks program is located! 

Hint#2: Google Sheets sometimes is buggy when gathering data from github, simply delete and paste the =IMPORTDATA function to make it update! 

Hint#3: Make graphics on Google Sheets and act like you're a NASA engineer!

TODO: Make an autopilot script that takes data from ACFEL! 

Script is here: 

 

Spoiler

//ACFEL V.10
//AUTOMATIC CHECK FOR EXPERIMENTAL LIFTOFFS
//pitch_for original link-> https://github.com/KSP-KOS/KSLib/blob/master/library/lib_navball.ks made by nuggreat 

// This file is distributed under the terms of the MIT license

//Author:  SpaceCarmelo

//INTRO

clearscreen.

PRINT "ACFEL - AUTOMATIC CHECK FOR EXPERIMENTAL LIFTOFFS".

//Functions Declaration
 

log ship:name to "name.csv".

function pisa {
  print "ALT: " + ceiling(ship:altitude).
  print "AP: " + ceiling(apoapsis).
  print "PE: " + ceiling(periapsis).
  print "ETA:AP " + ceiling(eta:apoapsis).
  print "PITCH: " + ceiling(pitch_for).
  print "THR: " + throttle.
  print "STATUS: " + ship:status.
}


function pitch_for {
  parameter ves is ship,thing is "default".
  local pointing is ves:facing:forevector.
  if not thing:istype("string") {
    set pointing to type_to_vector(ves,thing).
  }

  return 90 - vang(ves:up:vector, pointing).
}


function record { 

  clearscreen.

  print "Recording Data at: " + TIME.
  print pisa.
  log ceiling(ship:altitude) to "alt.csv".
  log ceiling(apoapsis) to "ap.csv".
  log ceiling(periapsis) to "pe.csv".
  log ceiling(eta:apoapsis) to "eta_ap.csv".
  log ceiling(pitch_for) to "pitch.csv".
  log throttle to "throttle.csv".
  log stage:number to "stage.csv".
  log ship:status to "status.csv".
  
  AG4 OFF.
}


//PROGRAM

UNTIL 0 { 
  if AG4 RECORD. 
  wait 0.1.
}

 

 

Edited by SpaceCarmelo
grammar correction
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...