Jump to content

kOS Scriptable Autopilot System 0.9


KevinLaity

Recommended Posts

Hi everyone,

I am still a newbie to the whole Scripted autopilot interface and idea. From what i have read and seen on the forums as well as youtube, it seems quiet fascinating to use. However, im having difficulties in order to understand how exactly to name a file, how to save the file in the kOS interface screen. I know it is noobish of me to ask this, but after-all, i don't have any background in programming. Please, if anybody can provide a noob like me with a step by step lay down on how to save and name a file etc step for step in the interface it self i would be indebted.

Link to comment
Share on other sites

So you are saying SOI belongs to the same category as things like radius, mass et cetera? The things Squad made up as they liked them, without much possibility of detecting them at a distance, but actually quite measurable when you go there?
Yes. The data that you can't get in game, like the body radius.

I don't even know what the hell you two are talking about anymore. Radius of every body can be found in game quite readily, as well as mass and SOI. (e.g. 600km, 5,292E+22 kg and 84159km for kerbin (sorry if I spoiled someone, and apparently spoiler tags don't work))

Guess you mean it's not available in kOS, but that's not what you are saying.

Edited by Sacred Aardvark
Link to comment
Share on other sites

They mean you can't get that info in flight, without checking in the map view. If you wanted something realistic, like Camacha, those numbers shouldn't be there.. you'd have to calculate them yourself (and by doing this you actually get more precision)

Link to comment
Share on other sites

I don't even know what the hell you two are talking about anymore. Radius of every body can be found in game quite readily, as well as mass and SOI. (e.g. 600km, 5,292E+22 kg and 84159km for kerbin (sorry if I spoiled someone, and apparently spoiler tags don't work))

Guess you mean it's not available in kOS, but that's not what you are saying.

Where are you finding SOI in game? If it was there I would want to use it in my code. Constant data that is discovered just once by scientific observation from back on Kerbin, and then plugged in as a constant to the code thereafter, that doesn't change with position or craft or anything else, is not something I consider cheating to use. It would be silly for a space program to discover a constant once (like working out the mass of a planet based on how it moves and how its moons move, or its radius based on field of vision in telescopes) and then keep re-deriving it again and again thereafter on each mission instead of plugging it in to the code. Re-deriving it live during the execution of the code would be just as silly as trying to re-derive pi and e and the gravitational constant when running code that needs those numbers.

So if you've seen a place where SOI is displayed in the game please let me know where it is. I'll add it to my body database.

Edited by Steven Mading
Link to comment
Share on other sites

SOI does exist in real life. Though obviously real life has n-body physics, not me+1 body physics.

http://en.wikipedia.org/wiki/Sphere_of_influence_%28astrodynamics%29

It's not real life. It's the radius at which patched conic approximations become unreliable based on an arbitrary standard. In real life, the radius at which you start paying attention to the effects of other bodies perturbing your orbit is dependent on how much precision you need. It's not a sudden cutoff where the effects just start above a radius where they didn't exist below that radius. It's a heuristic cutoff based on the human need to avoid a lot of math when it doesn't matter enough.

Edited by Steven Mading
Link to comment
Share on other sites

Hi everyone,

I am still a newbie to the whole Scripted autopilot interface and idea. From what i have read and seen on the forums as well as youtube, it seems quiet fascinating to use. However, im having difficulties in order to understand how exactly to name a file, how to save the file in the kOS interface screen. I know it is noobish of me to ask this, but after-all, i don't have any background in programming. Please, if anybody can provide a noob like me with a step by step lay down on how to save and name a file etc step for step in the interface it self i would be indebted.

Volumes: A Volume is the place you store a file. By default you start on the local volume on the kOS SCS part you right-clicked on when you brought up the terminal window, which is always called volume 1. You can switch to another one by saying SWITCH TO _. where _ is the name or number of the other volume. At minimum you always have volumes 0 and 1. 1 is the local one, and 0 is the archive back home on Kerbin.

switch to 1.

switch to 0.

Files: Whenever you want to make a new program file or change one that's already there just say EDIT _____. (where the ____ is the name of the program).

edit myprogram.

When you are in the built-in editor in the game, use F5 to save your changes and use F10 to quit the editor. Warning: if you quit without saving, it won't stop you from doing so.

Note that programs you make on the local volume (volume 1) will only be saved with the craft and NOT globally. If you terminate the flight, the code you put on the local volume is gone too.

On the other hand programs you put on volume 0 (the archive) will be saved globally (even across different saved games).

It's highly recommended that you edit your programs using a text editor external to kOS instead of using the editor in-game for anything beyond just playing around a bit. You can edit your programs with any text editor. If you save them in your Plugins/PluginData/Archive folder, then they will be automatically seen by kOS as being part of volume 0, without having to restart or anything. Name all program files with a .txt extension.

That's the quick and dirty explanation. I hope this helps.

Link to comment
Share on other sites

I`ve got a little question, How would I best change my facing to raise or lower my perispais on approach to a body?

Currently, using no maths, I face either up or prograde to raise or lower Pe.

This is not optimal.

I`d like to face 90 degrees from the direction of travel on a line away from/toward the centre of gravity on the body I am approaching.

Edited by John FX
Link to comment
Share on other sites

So if you've seen a place where SOI is displayed in the game please let me know where it is. I'll add it to my body database.

In map view if you focus on a body and open the info thingys on the right edge of the screen the i icon and not sure what the other one represents, one gives you a description of the planet and I think it was the lower button that shows mass, radius, soi, gravity ASL and some other data about the planet/moon in focus.

The SOI info might have been added there in 0.22, since I looked for it in there back in .21 and didn't find it, but I could have just been blind then ^_^

[edit] The info panels work in tracking station as well, don't necessarily need to launch a ship.

[edit2] screenshot of the info panel for extra clarity (and because Infinity km SOI :cool: )

http://i.imgur.com/5WuHPIk.png

Edited by Sacred Aardvark
Link to comment
Share on other sites

Currently, using no maths, I face either up or prograde to raise or lower Pe.

This is not optimal.

It is actually optimal if you face prograde or retrograde, as long as you do your burns on or very near the apoapsis or periapsis. That is a quick mathless way to do things somewhat efficiently. Of course that does not take the different manoeuvre types into account.

Link to comment
Share on other sites

I`ve got a little question, How would I best change my facing to raise or lower my perispais on approach to a body?

Currently, using no maths, I face either up or prograde to raise or lower Pe.

This is not optimal.

I`d like to face 90 degrees from the direction of travel on a line away from/toward the centre of gravity on the body I am approaching.

Sounds like you want to figure out the radial in / radial out vectors. Like as you are trying to lower your Pe on approach for an aero-capture or something ... correct? You should be able to do a rotation of your prograde vector something like

lock steering to prograde + R(0,90,0). // radial out

lock steering to prograde + R(0,-90,0). // radial in

Link to comment
Share on other sites

In map view if you focus on a body and open the info thingys on the right edge of the screen the i icon and not sure what the other one represents, one gives you a description of the planet and I think it was the lower button that shows mass, radius, soi, gravity ASL and some other data about the planet/moon in focus.

The SOI info might have been added there in 0.22, since I looked for it in there back in .21 and didn't find it, but I could have just been blind then ^_^

[edit] The info panels work in tracking station as well, don't necessarily need to launch a ship.

[edit2] screenshot of the info panel for extra clarity (and because Infinity km SOI :cool: )

http://i.imgur.com/5WuHPIk.png

Okay thank you. This is useful.

Link to comment
Share on other sites

It is actually optimal if you face prograde or retrograde, as long as you do your burns on or very near the apoapsis or periapsis. That is a quick mathless way to do things somewhat efficiently. Of course that does not take the different manoeuvre types into account.

Well, if you're trying to do a maneuver that combines two different orthogonal directions it can sometimes be more efficient to combine then into one burn in a direction diagonally between the two. (i.e. you want to both go to a higher orbit AND rotate your semi-major axis to a new longitude a bit with a radial out burn, so you aim a few degrees deflected toward "skyward" from prograde to get both a prograde and radial out burn in one maneuver.) When burning diagonally your delta V is the hypotenuse of the triangle formed by the two orthogonal delta V's, which is less than the sum of the two orthogonal delta V's.

The only case where this isn't better is when trying to combine an inclination burn with a prograde or retrograde burn. Because then the optimal place for both burns isn't the same and it's not a good idea to do them together when one should be at apoapsis and the other at periapsis.

Link to comment
Share on other sites

Well, if you're trying to do a maneuver that combines two different orthogonal directions it can sometimes be more efficient to combine then into one burn in a direction diagonally between the two. (i.e. you want to both go to a higher orbit AND rotate your semi-major axis to a new longitude a bit with a radial out burn, so you aim a few degrees deflected toward "skyward" from prograde to get both a prograde and radial out burn in one maneuver.) When burning diagonally your delta V is the hypotenuse of the triangle formed by the two orthogonal delta V's, which is less than the sum of the two orthogonal delta V's.

Yes, that is absolutely right. Since we did not seem to be talking about such a scenario and John FX was talking about not using math, I just thought I would keep it as simple as possible :)

Link to comment
Share on other sites

Hi everyone,

I am still a newbie to the whole Scripted autopilot interface and idea. From what i have read and seen on the forums as well as youtube, it seems quiet fascinating to use. However, im having difficulties in order to understand how exactly to name a file, how to save the file in the kOS interface screen. I know it is noobish of me to ask this, but after-all, i don't have any background in programming. Please, if anybody can provide a noob like me with a step by step lay down on how to save and name a file etc step for step in the interface it self i would be indebted.

Is that not in the Wiki? If not, I guess it is time that gets put in there, since this question returns every 3 to 5 pages and is typically something every beginner deals with.

Link to comment
Share on other sites

It is actually optimal if you face prograde or retrograde, as long as you do your burns on or very near the apoapsis or periapsis. That is a quick mathless way to do things somewhat efficiently. Of course that does not take the different manoeuvre types into account.

The key part was `on approach to a body` I should clarify as that is a bit vague, I have no apoapsis, I am on an escape path and I have just entered the SOI and want to raise or lower my Pe before capture.

This is why I wanted to burn at 90 degrees to my direction of motion on a line vertical to the direction of the center of mass of the body I am approaching. Currently I burn up or prograde to raise or lower my Pe.

I am completely happy with normal orbital maneuvers, I just need to know how to tell KOS what I know I want to do. Mainly I get very confused by the direction/vector/xyz stuff .

How do I rotate my craft away from the body it is orbiting (or towards)?

If you say something like


set tf11 to tfCosA*tfCosC + tfSinA*tfSinB*tfSinC .
set tf21 to tfCosC*tfSinA*tfSinB - tfCosA*tfSinC .
set tf31 to tfCosB*tfSinA .
set tf12 to tfCosB*tfSinC .
set tf22 to tfCosB*tfCosC .
set tf32 to 0-tfSinB .
set tf13 to tfCosA*tfSinB*tfSinC - tfCosC*tfSinA .
set tf23 to tfSinA*tfSinC + tfCosA*tfCosC*tfSinB .
set tf33 to tfCosA*tfCosB .
set tfV to V( 0,0,1 ).

Then I simply will not put maths like that in a program simply to `turn away from the parent body until you are 90 degrees from the direction of travel.` and I will stick with the much less efficient method.

Link to comment
Share on other sites

Sounds like you want to figure out the radial in / radial out vectors. Like as you are trying to lower your Pe on approach for an aero-capture or something ... correct? You should be able to do a rotation of your prograde vector something like

lock steering to prograde + R(0,90,0). // radial out

lock steering to prograde + R(0,-90,0). // radial in

I appear to have missed this post which completely answered my question. Thank you for this, I was looking for a simple way to do exactly this without complex maths. The maths isn`t the problem but I wanted to write a total brute force KGC (AGC).

Read this post or this post :)

We really need to put this somewhere where people will easily find it, because we get this question a bit too often now.

I totally agree. A more complete WIKI with a main page leading to tutorials and code examples would be awesome.

Edited by John FX
Link to comment
Share on other sites

no it still dont work i made a tekst With evrything but no...

You are going to have to be a little more specific what you are trying to do and how you are trying to do it :) Just it does not work could mean anything and provides little we can help you with.

Link to comment
Share on other sites

You are going to have to be a little more specific what you are trying to do and how you are trying to do it :) Just it does not work could mean anything and provides little we can help you with.

i had a quote!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...