Jump to content

kOS Scriptable Autopilot System 0.9


KevinLaity

Recommended Posts

SOI body. I had assumed I'd have to use the latitude for determining whether I was ascending or descending, and also isolating where the burn will need to occur. I guess I was just hopeful that there was an undocumented inclination function!

It should be possible to work it out using this logic: Your path follows a sine wave when projected onto the planet surface, where the equator is its center line. You can ignore all the components of the velocity vector other than the Y component, because Y is always the SOI body's northward direction (NOTE 3-D north, not surface north. In other words if you're near the pole it's pointing UP, not at the north pole.).

So you can basically transform it into a one-dimensional sine wave pattern (like a weight on a spring oscillating up and down) that way. Your latitude combined with your altitude and the body's radius can give your Y position and your Y component of velocity is your Y velocity.

So basically you have a snapshot of "I am this far off the center line, and I am moving at this speed up (or this speed down)." to work out the parameters of your sine wave oscillation, including where it peaks (which tells you your inclination.)

Relative target inclination would be the next step.

Yeah the problem is you have less data about the target than you do about yourself. You can't get its velocity.

Link to comment
Share on other sites

HOWEVER, it insists:

line1: mismatching delimiter.

I have no idea.

Please read the preceding posts in the forum that came between your last post and this one. They describe how version 0.8 is broken in this regard.

Link to comment
Share on other sites

I am starting to wonder more and more how feasible it is to just send out multiple craft that do things on their own. As far as I can tell you still need to focus on the ship doing whatever it is doing, right? So sending a dropship that drops an autonomous probe and then returns home while the probe does its things is not really possible.

I have seen a mod that extends the loading distance, but I can not image that distance spanning a large part of a planet without causing a lot of problems.

Link to comment
Share on other sites

I'm having trouble getting "Lock Throttle to 1." to work in my windows 8 install, I have tried running it though the console and also via a loaded program but neither one will actually effect the in game throttle. I've tried querying it with Print Throttle. and that prints as one would expect (so Lock Throttle to 1. produces Print Throttle "1") I can still stage and other things but for some reason Lock doesn't seem to work - any ideas?

Ok well I found a 7.x version in my downloads folder and that works perfectly with the "launching 101" script I was trying so I'm guessing...

Edited by Jahulath
Link to comment
Share on other sites

I have no idea what's wrong. This mod is a cool idea, although the english-ness of the thing puts me off.

This is going to be another applescript.

But anyway: I'm trying to run this program:


SET X to 1.
UNTIL X > 10 {
PRINT X.
SET X to X + 1.
}. // Prints the numbers 1-10.

from the wiki.

HOWEVER, it insists:

line1: mismatching delimiter.

I have no idea.

This is a bug in 0.8. Please try 0.81, sorry!

Link to comment
Share on other sites

Another thing I just noticed:


switch to 1. // doesn't work
copy flight-params from archive. // doesn't work. kOS doesn't like the dash?
copy prelaunch from archive. // works, because there's no dash?

I'm going to have to switch back to kOS 0.7 until this is fixed.

This should now be fixed in 0.82!

Link to comment
Share on other sites

Some random thoughts:

The editor terminates with an error when the legth of a line exceeds the terminal window.

The Font is difficult to read, stuff like < and { or ( should be easier to distinguish.

Some useful math functionality like logarithms is missing.

It would be nice to have else or even elseif cases for if statements.

A while loop would be nice, so that its easier to choose between checking the conditions before or after each loop body execution.

Apparantly some people use sub-programs and I assume that they share variables, but it would be really nice to have proper functions with parameters and return values.

The documentation is so terrible that it overshadows what is accomplished with this mod.

It seems to be impossible to determine basic stuff like the attitude of your craft, especially pitch. Various people asked for it three atleast three times in this thread without getting an answer and its not documented anywhere.

While its a very nice mod I don't see it going anywhere until decent documentation is available.

Link to comment
Share on other sites

This should now be fixed in 0.82!

Wow, nice, 2 patches back to back while you're on vacation, or getting ready to be on vacation. :) I haven't even had a chance to dl 0.8 yet so I guess I don't have to deal with editing my program(s) to have {}'s on one line. Thanks! :)

Link to comment
Share on other sites

Lock throttle doesn't work in .82

You can set it and query it, but the actual throttle doesn't change.

Hmm yeah, I was just noticing that too. I just added the sensor reporter plugin. Do you have that as well? Was going to try removing it to see if that made a difference.

Update: It appears that lock steering also doesn't work. At least, not reliably. It does seem to sort of work after getting above a certain height. One test I did it worked once then quit working. Lock throttle though hasn't worked at all. Going to try removing the SR plugin. On a side note, post 1337 ;) lol

Update 2: Ok, so the plugin wasn't the problem. Wishful thinking I guess lol

Edited by Sma
Link to comment
Share on other sites

While its a very nice mod I don't see it going anywhere until decent documentation is available.

You read the thread, so you know where that is going: there is a wiki waiting for your new entries! Bizz Keryear has made a good start.

Link to comment
Share on other sites

Some random thoughts:

The editor terminates with an error when the legth of a line exceeds the terminal window.

I don't use the built in editor to edit my programs, I use an external one, (kOS IDE link to the forum post about this IDE also available on the kOS Wiki, link below) so I can't speak to this part.

The Font is difficult to read, stuff like < and { or ( should be easier to distinguish.

I don't really have a problem with this, again likely because I use an external editor, but even still I don't have a problem telling them apart in the editor window.

Some useful math functionality like logarithms is missing.

I haven't done anything too complicated yet, but it does include math functions like sin, cos, tan, arcsin, arccos, arctan, arctan2, and abs, for what it's worth. Seems some people are getting good use with those.

It would be nice to have else or even elseif cases for if statements.

A while loop would be nice, so that its easier to choose between checking the conditions before or after each loop body execution.

Apparantly some people use sub-programs and I assume that they share variables, but it would be really nice to have proper functions with parameters and return values.

There are until loops, while not the same they can basically be used to accomplish the same thing, to a certain extent anyway. While it may be nice to have else or else if, it's not 100% necessary for working programs. I think part of the idea behind this is to have the "clunkyness" that is associated with doing things the Kerbal way.

The documentation is so terrible that it overshadows what is accomplished with this mod.

It seems to be impossible to determine basic stuff like the attitude of your craft, especially pitch. Various people asked for it three atleast three times in this thread without getting an answer and its not documented anywhere.

While its a very nice mod I don't see it going anywhere until decent documentation is available.

This mod is basically a work in progress. As such the developer doesn't have time to write extensive documentation on a work in progress. I'm pretty sure Kevin has said/mentioned a few times he would like to take time to update the documentation, how ever, for me personally I'd prefer he works more on working on updates when he can. He has a life outside of KSP/kOS so he can't be expected to work on it 24/7. Besides that maybe you haven't seen the kOS wiki put together by the community. As Camacha has said, Bizz has been doing quite a bit of work to keep it up to date.

As it is now you can accomplish quite a bit using this mod. So far I've only written a launch and deorbit program, but others have worked on programs to control planes. A few have made programs to run cruise missiles, and others have done programs for skycranes and rovers. All with out "decent documentation" as you put it. Again, it's a work in progress, I suspect once it gets closer to 1.0 more documentation will be available.

Edited by Sma
Link to comment
Share on other sites

I don't really have a problem with this, again likely because I use an external editor, but even still I don't have a problem telling them apart in the editor window.

It's using the old Commodor 64 font, which someone on the internet has translated into TrueType. I can confirm that it is hard to tell "(" and "{" apart in the font because I tried using the same c64 font in my external text editor and had the same problem as in the game's editor. At point sizes of 8,9,and 10 it's hard to tell. It has to get up to about 12 before you can see it well.

Link to comment
Share on other sites

kOS Mapping Software

After I overcame some problems, my mapping program finally does the job it's supposed to do. The program basically just converts latitude / longitude coordinates to screen coordinates. It afterwards checks whether altitude - alt:radar is higher than 1000m or 1km and prints "*" to the screen if that's the case.

Here are two screenshots. One I've taken shortly after the program started, one taken after 3 hours of 4x physical time warp.

Javascript is disabled. View full album

For now, it is only possibly to map celestial-bodys that don't have an atmosphere because the orbit needs to be really low for the radio altitude to work. I used a circual 7,5 by 7,5km orbit around minmus. After looking into the code, you might quickly realize that converting floating point numbers into integers for the print at(x,y) function was another major problem. The function doesn't convert the numbers on it's own so I had to the job manually, which makes the program really slow, but it seems to be the only way for now. I also tried using faster time warps to increase the mapping speed, but the radar altitude doesn't seem to work using it either.

I'm going to finish the map of minmus for now. Have fun with the program!

set longscale to 48 / 360.
set latscale to 31 / 180.

clearscreen.
print "--------------------------------------------------" at (0, 1).
print "--------------------------------------------------" at (0, 34).
print "-180 0 180" at (0, 35).


until 1 = 2 {
set height to altitude - alt:radar.
set screenx to 24 + (longitude * longscale).
set screeny to 17 - (latitude * latscale).

print "MAPPING " + body + " - CURRENT ELEVATION: " + height at(0, 0).

if height > 1000 {

if screenx < 50 {
set rscreenx to 50.
}
if screenx < 49 {
set rscreenx to 49.
}
if screenx < 48 {
set rscreenx to 48.
}
if screenx < 47 {
set rscreenx to 47.
}
if screenx < 46 {
set rscreenx to 46.
}
if screenx < 45 {
set rscreenx to 45.
}
if screenx < 44 {
set rscreenx to 44.
}
if screenx < 43 {
set rscreenx to 43.
}
if screenx < 42 {
set rscreenx to 42.
}
if screenx < 41 {
set rscreenx to 41.
}
if screenx < 40 {
set rscreenx to 40.
}
if screenx < 39 {
set rscreenx to 39.
}
if screenx < 38 {
set rscreenx to 38.
}
if screenx < 37 {
set rscreenx to 37.
}
if screenx < 36 {
set rscreenx to 36.
}
if screenx < 35 {
set rscreenx to 35.
}
if screenx < 34 {
set rscreenx to 34.
}
if screenx < 33 {
set rscreenx to 33.
}
if screenx < 32 {
set rscreenx to 32.
}
if screenx < 31 {
set rscreenx to 31.
}
if screenx < 30 {
set rscreenx to 30.
}
if screenx < 29 {
set rscreenx to 29.
}
if screenx < 28 {
set rscreenx to 28.
}
if screenx < 27 {
set rscreenx to 27.
}
if screenx < 26 {
set rscreenx to 26.
}
if screenx < 25 {
set rscreenx to 25.
}
if screenx < 24 {
set rscreenx to 24.
}
if screenx < 23 {
set rscreenx to 23.
}
if screenx < 22 {
set rscreenx to 22.
}
if screenx < 21 {
set rscreenx to 21.
}
if screenx < 20 {
set rscreenx to 20.
}
if screenx < 19 {
set rscreenx to 19.
}
if screenx < 18 {
set rscreenx to 18.
}
if screenx < 17 {
set rscreenx to 17.
}
if screenx < 16 {
set rscreenx to 16.
}
if screenx < 15 {
set rscreenx to 15.
}
if screenx < 14 {
set rscreenx to 14.
}
if screenx < 13 {
set rscreenx to 13.
}
if screenx < 12 {
set rscreenx to 12.
}
if screenx < 11 {
set rscreenx to 11.
}
if screenx < 10 {
set rscreenx to 10.
}
if screenx < 9 {
set rscreenx to 9.
}
if screenx < 8 {
set rscreenx to 8.
}
if screenx < 7 {
set rscreenx to 7.
}
if screenx < 6 {
set rscreenx to 6.
}
if screenx < 5 {
set rscreenx to 5.
}
if screenx < 4 {
set rscreenx to 4.
}
if screenx < 3 {
set rscreenx to 3.
}
if screenx < 2 {
set rscreenx to 2.
}
if screenx < 1 {
set rscreenx to 1.
}
if screenx < 0 {
set rscreenx to 0.
}

if screeny < 35 {
set rscreeny to 35.
}
if screeny < 34 {
set rscreeny to 34.
}
if screeny < 33 {
set rscreeny to 33.
}
if screeny < 32 {
set rscreeny to 32.
}
if screeny < 31 {
set rscreeny to 31.
}
if screeny < 30 {
set rscreeny to 30.
}
if screeny < 29 {
set rscreeny to 29.
}
if screeny < 28 {
set rscreeny to 28.
}
if screeny < 27 {
set rscreeny to 27.
}
if screeny < 26 {
set rscreeny to 26.
}
if screeny < 25 {
set rscreeny to 25.
}
if screeny < 24 {
set rscreeny to 24.
}
if screeny < 23 {
set rscreeny to 23.
}
if screeny < 22 {
set rscreeny to 22.
}
if screeny < 21 {
set rscreeny to 21.
}
if screeny < 20 {
set rscreeny to 20.
}
if screeny < 19 {
set rscreeny to 19.
}
if screeny < 18 {
set rscreeny to 18.
}
if screeny < 17 {
set rscreeny to 17.
}
if screeny < 16 {
set rscreeny to 16.
}
if screeny < 15 {
set rscreeny to 15.
}
if screeny < 14 {
set rscreeny to 14.
}
if screeny < 13 {
set rscreeny to 13.
}
if screeny < 12 {
set rscreeny to 12.
}
if screeny < 11 {
set rscreeny to 11.
}
if screeny < 10 {
set rscreeny to 10.
}
if screeny < 9 {
set rscreeny to 9.
}
if screeny < 8 {
set rscreeny to 8.
}
if screeny < 7 {
set rscreeny to 7.
}
if screeny < 6 {
set rscreeny to 6.
}
if screeny < 5 {
set rscreeny to 5.
}
if screeny < 4 {
set rscreeny to 4.
}
if screeny < 3 {
set rscreeny to 3.
}
if screeny < 2 {
set rscreeny to 2.
}
if screeny < 1 {
set rscreeny to 1.
}
if screeny < 0 {
set rscreeny to 0.
}

print "*" at(rscreenx, rscreeny).
}
}

Link to comment
Share on other sites

kOS Mapping Software

[...]

Really nice, and totally useless.

I like it.

Could You

357px-Bizz_Keryear_want_you.jpg

add that to the wiki?

Edit: You know that Foor() round() and so on were addded in 0.8x?

Edit2: Sweet 0.82 is out: Now with less bugs (than Joe's Apartment).

did someone else has noticed that the k-OS part has a slight amount of air ? (taken from 0.8) CrH0oZO.png

Edited by Bizz Keryear
Link to comment
Share on other sites

I've been using kos for over a month now, and unlike most other mods and plugins, kos is still a fresh and enjoyable part to building and launching rockets.

That said, I still deeply miss using remote tech. I've figured out a workaround for not being able to type without setting off all of the ships controls and stages*, but I was wondering if anyone had come up with a way to get around the complete lack of throttle control. Either another plugin, or a small fix, or maybe even Kevin himself is working on something?

RT and kos would be fantastic working side by side, it's such a shame that we need to pick one or the other.

Thanks again for an amazing plugin, though! Five stars!

*To get around the typing issue, I launch the rocket from a manned 'launch control' platform, and use action groups to toggle the antennae. The platform has one crew member to allow local control.

First, I toggle the antennae off, and deactivate local control, breaking all keyboard inputs from having an effect on the craft.

Second, I open the terminal and begin coding/loading/running programs, making sure it will begin running the next program automatically.

Third, I make sure the program will turn the antennae back on again before launch, but a few seconds after the program begins.

Fourth, I switch on local control, to allow kos to begin running programs.

Fifth, I click 'control from here' on the payload to be launched (otherwise you just watch it launch from your pod).

Sixth, I run the program for launching the rocket.

Seventh, and finally, I switch off local control once the antennae are re-activated.

Link to comment
Share on other sites

I've been using kos for over a month now, and unlike most other mods and plugins, kos is still a fresh and enjoyable part to building and launching rockets.

That said, I still deeply miss using remote tech. I've figured out a workaround for not being able to type without setting off all of the ships controls and stages*, but I was wondering if anyone had come up with a way to get around the complete lack of throttle control. Either another plugin, or a small fix, or maybe even Kevin himself is working on something?

RT and kos would be fantastic working side by side, it's such a shame that we need to pick one or the other.

Thanks again for an amazing plugin, though! Five stars!

*To get around the typing issue, I launch the rocket from a manned 'launch control' platform, and use action groups to toggle the antennae. The platform has one crew member to allow local control.

First, I toggle the antennae off, and deactivate local control, breaking all keyboard inputs from having an effect on the craft.

Second, I open the terminal and begin coding/loading/running programs, making sure it will begin running the next program automatically.

Third, I make sure the program will turn the antennae back on again before launch, but a few seconds after the program begins.

Fourth, I switch on local control, to allow kos to begin running programs.

Fifth, I click 'control from here' on the payload to be launched (otherwise you just watch it launch from your pod).

Sixth, I run the program for launching the rocket.

Seventh, and finally, I switch off local control once the antennae are re-activated.

Its an Issue of RT. I overrides the keyboard inputs. And in a way that Kevin can't do anything about that.

The only way is to fix that in RT. And I assume they might never do that.

Link to comment
Share on other sites

... Now kOS is ignoring my gravity turn commands.. the damn thing just shoots straight up. I changed nothing... its been working for the past few days, but now it just **** the bed. Whew... well im done with kOS for time time being. Ever since I got it its been nothing, but problems and headaches. Im sorry this is a killer app.. really it is, but I will only use this for small rockets. Satellite launches and what not from now on. I mean for christ sake I can pilot my rockets WAY better with manual control. Everything works just as it should.

kOS simpy cannot do it. They spin like a top without SAS. They oscillate violently. These... ghost commands come out from nowhere and start pitching my rocket wherever the hell it wants. Is it me? ..probably. But all I know is I can fly my rockets just FINE without this program so that's what im going to do. Its ashame I was looking for a more cinematic experience with KSP. I though this program could do it, but.. its just too much. Thank you so much to everyone that's been helping me out on this thread. Ive been trying to figure this out for the past months and once I think im starting to get a foothold of kOS it screws up and im back to square one. kOS.. you win. You beat me. Im waving my white flag. So again thanks for the help everyone, but I will be setting kOS aside from here on. I just had to get this off my chest I apologize.

Edited by Motokid600
Link to comment
Share on other sites

Well, it is very much alpha software. If you want to sit back an watch the rocket fly I would suggest using MechJeb, which offers easy control without having to do much for it yourself in the way of programming and stuff like that.

Link to comment
Share on other sites

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