Jump to content

kOS Scriptable Autopilot System 0.9


KevinLaity

Recommended Posts

@erendrake

Ok, now (I think) I understand you. You don't fall for any "illusion" of parallel, no matter how good it may be. Serial computing is serial computing! And thus, kOS is --- must be! --- serial. Perfectly logical.

As to my "how does the CPU know if a program has one or multiple threads?" and you answering "it doesn't know about programs or threads or processes": thank you for proving my point: it does depend on the point of view.

@erendrake, Steven Mading

In the Kerbal universe the CX-4181 Scriptable Control System part can and will run on several code paths at one time, interleaving them --- benchmarking also shows that there's no runtime difference (literally zero to +4%) between no additional code path running in the background and five of them running full tilt.

Now, as a Kerbal programming that CX-4181, how would you call these code paths and what word would you use to describe the time-needed-to-run-to-completion behaviour of multiple of them? I'd like to think I'd say thread and multithreading and "in parallel" and probably multi-core CPU backwards in Spanish.

@Steven Mading

I assume "capable of having multiple parts of a program (threads) being executed at one time" misses your definition of multithreading somehow?


clearscreen.
set rounds to 300.

set x to 0.
set start to missiontime.
until (x == rounds) {
set x to x + 1.
}.
set end to missiontime.
print "Simple: " + round ((end - start) / x, 7) + "s per round".

set x to 0.
set ia to 0.
set ib to 0.
set ic to 0.
set id to 0.
set ie to 0.
when (x == 0) then { until (ia = (rounds * 4)) { set ia to ia + 1. }. }.
when (x == 0) then { until (ib = (rounds * 4)) { set ib to ib + 1. }. }.
when (x == 0) then { until (ic = (rounds * 4)) { set ic to ic + 1. }. }.
when (x == 0) then { until (id = (rounds * 4)) { set id to id + 1. }. }.
when (x == 0) then { until (ie = (rounds * 4)) { set ie to ie + 1. }. }.

set start to missiontime.
until (x == rounds) {
set x to x + 1.
}.
set end to missiontime.
print "with 5 whens: " + round ((end - start) / x, 7) + "s per round".

Link to comment
Share on other sites

Weissel, stop trolling. Pretending that you "won" because others are sick of putting up with you is a common trolling tactic. Pretending that your questions haven't already been answered just so you can keep asking them again when they've already been addressed is another common trolling tactic. Just please stop derailing the topic with a pointless terminology claim. Be an adult and just let it drop.

Link to comment
Share on other sites

Thinking of installing this, would be nice to code probes!

Any idea on how much space it takes up in ksp? I'm running at around 2.8Gb in task manager, I'm guessing it won't be much :)

(also lack of coding skill means I will have to learn, any tips for a nub?)

Edited by Boamere
Link to comment
Share on other sites

Thinking of installing this, would be nice to code probes!

Any idea on how much space it takes up in ksp? I'm running at around 2.8Gb in task manager, I'm guessing it won't be much :)

(also lack of coding skill means I will have to learn, any tips for a nub?)

One very important thing is to check this thread back a few pages (I can't remember now how far back and I'm typing on my phone where it's hard to deal with the tiny screen for stuff like that). kOS does NOT WORK with KSP 0.23 if you use the default download link mentioned on the front page of this thread. It's a long story but what matters is that the original author went out of communication entirely and stopped updating and this happened before the KSP 0.23 update so the version mentioned on the front page is for version 0.22 and doesn't work with 0.23.

But there is a version for 0.23 that is being updated by another user. Go back a few pages in the thread to try to find the link to it.

Link to comment
Share on other sites

If anyone cares, i've made a fork of kOS that is designed to make it compatible with the Realism Overhaul and associated mods. Right now its just a fix for the re-scaling of Kerbin in RSS, so that it sees you as the proper distance away.

Link to comment
Share on other sites

One very important thing is to check this thread back a few pages (I can't remember now how far back and I'm typing on my phone where it's hard to deal with the tiny screen for stuff like that). kOS does NOT WORK with KSP 0.23 if you use the default download link mentioned on the front page of this thread. It's a long story but what matters is that the original author went out of communication entirely and stopped updating and this happened before the KSP 0.23 update so the version mentioned on the front page is for version 0.22 and doesn't work with 0.23.

But there is a version for 0.23 that is being updated by another user. Go back a few pages in the thread to try to find the link to it.

Thanks, I saw the link on spaceport :)

Link to comment
Share on other sites

I've started incorporating more of the Realism Overhaul functions into my version of kOS. Currently I have it integrated with the RemoteTech2 API from Cilph. I've also integrated RT2 functionality directly into the appropriate aspects, such as accessing the Archive volume (You need a valid RT2 connection KSC), and valid Vessel Targets (You can only target vessels with a RT2 connection to you).

Also I've started adding FAR integration. I'll send the code to Ferram soon, but right now kOS has access to some basic FAR flight data; Mach Velocity, EAS, and Dynamic Pressure

Link to comment
Share on other sites

I've started incorporating more of the Realism Overhaul functions into my version of kOS. Currently I have it integrated with the RemoteTech2 API from Cilph. I've also integrated RT2 functionality directly into the appropriate aspects, such as accessing the Archive volume (You need a valid RT2 connection KSC), and valid Vessel Targets (You can only target vessels with a RT2 connection to you).

Also I've started adding FAR integration. I'll send the code to Ferram soon, but right now kOS has access to some basic FAR flight data; Mach Velocity, EAS, and Dynamic Pressure

Cool! i have this kind of integration on my own roadmap too and i would be excited to work with you on it! If you want to get these into the main release I would be happy to look at some pull requests :)

Link to comment
Share on other sites

@erindrake> (Asked with politeness) Would it be too much to ask to start a new thread based on your Github version is now a couple generations younger than 0.9 is, not to mention you're maintaining it? I'm not that big of a fan of watching the OP of this thread get grey hair. ;)

Link to comment
Share on other sites

Cool! i have this kind of integration on my own roadmap too and i would be excited to work with you on it! If you want to get these into the main release I would be happy to look at some pull requests :)

I don't mind contributing if you want these changes, but right now the way i've done it RT2 is pretty much a requirement, rather than optional. Since what i'm doing is for the Realism Overhaul, I can be pretty sure the user will be using both RT2 and FAR, as well as some others like RSS and what not. If you want to keep it more generic, then the code will need to change a bit.

Anyway if you want, let me know. I'm not all that GitHub savvy so you might need to help me there. https://github.com/jwvanderbeck/KOS

Link to comment
Share on other sites

@erindrake> (Asked with politeness) Would it be too much to ask to start a new thread based on your Github version is now a couple generations younger than 0.9 is, not to mention you're maintaining it? I'm not that big of a fan of watching the OP of this thread get grey hair. ;)

Granted, I have been a slacker on that kind of thing :P

New Thread!

Link to comment
Share on other sites

Spaceport is a little annoying, I tried to put the new version up days ago and it kept giving me errors. Now i have 3 copies of it up there :P

BTW I have posted it on spaceport apparently!

http://kerbalspaceprogram.com/kos-autopilot/

Cool, its been a while since I've tried messing with kOS, may have to try it out again though.

Wondering, even though it is in the readme file, should it also be mentioned on spaceport that it was originally started by Kevin? Just wondering. :)

Edited by Sma
Link to comment
Share on other sites

Cool, its been a while since I've tried messing with kOS, may have to try it out again though.

I cant wait to see what everyone comes up with :) there are a ton of possibilities.

Wondering, even though it is in the readme file, should it also be mentioned on spaceport that it was originally started by Kevin? Just wondering. :)

I will add attribute anywhere the community feels it appropriate. I will never try to dismiss or forget his contribution.

Link to comment
Share on other sites

I can see KOS has started to get split ends meaning multiple threads of development which leads to nobody knowing which version to use or which version is stable or has the features they want. Only a few hardened github users will be able to make sense of it all.

Link to comment
Share on other sites

Ugh, I am veritably itching to continue development on the software suite I was working on for kOS. Graduating is nice and all, but it does take a real chunk out of your kOS time :D

Lol...just like education to get in the way of kOS time....which technically is also education if you think about it. Learning "space programing" ;) For the most part it's "almost" the same thing as what goes on in actual space programs, with the exception of the fact that they have a lot more variables to consider, plus they can monitor things at MUCH faster speeds than we can.

But I wouldn't be surprised that in the future a "martian" is doing an interview on TV/Youtube etc, and credits KSP/kOS for getting them to where they are, by inspiring them to look into an education in the needed fields of study. :)

I cant wait to see what everyone comes up with :) there are a ton of possibilities.

I was working on a script for launching/deploying a "komm sat" network (for use with remote tech, although you could do it without). I had gotten up to the point where I got the launcher to 2,868.75km, and even had it (I think) set to change the PE so that every time the launcher came around it would be 1/3 of the way around compared to the 2,868.75km circular orbit. I say I think, because I might have just had it calculate the DV needed to achieve the specific orbital period (as mentioned by Scott Manley) needed to make it 1/3 of the way around, instead of having it actually calculate the 1/3 on its own. IIRC I was up to the point of having needing to write the program that would circularize the kommsat, as I was trying to figure out if there was a way to have the launcher trigger the circularize program on the released kommsat, though I don't think thats possible so I was just going to have to run that part manually. That's when dev halted, plus i think it was around the time 0.23 came out and Remote Tech handn't been updated just yet.

I will add attribute anywhere the community feels it appropriate. I will never try to dismiss or forget his contribution.

Ok Cool, thats what I like to hear. :)

Link to comment
Share on other sites

  • 2 weeks later...

lock steering to node.

How to use it?

I tried:

ADD NODE(30, 100, 0, 200).
lock steering to node.
wait until periapsis > 200000.

But the my spacecraft does not make any movements.To the side of the blue mark.

Link to comment
Share on other sites

lock steering to node.

How to use it?

I tried:

ADD NODE(30, 100, 0, 200).
lock steering to node.
wait until periapsis > 200000.

But the my spacecraft does not make any movements.To the side of the blue mark.

ADD NODE(30, 100, 0, 200).
lock steering to nextnode.
wait until periapsis > 200000.

IIRC

Link to comment
Share on other sites

  • 4 weeks later...

How do I save my code so that I can use it later? F5 saves the script, but if I relaunch or switch to another vessel it will vanish, is there a way to save to archive? Can't find anything on how to save scripts :(

Link to comment
Share on other sites

How do I save my code so that I can use it later? F5 saves the script, but if I relaunch or switch to another vessel it will vanish, is there a way to save to archive? Can't find anything on how to save scripts :(

once you have saved a file locally, you can

COPY FOO TO ARCHIVE.

where FOO is your new file.

Edit: I didnt notice this was in the old thread, boo for thread necromancy!

Edited by erendrake
Foo yourself, Camacha!
Link to comment
Share on other sites

How do I save my code so that I can use it later? F5 saves the script, but if I relaunch or switch to another vessel it will vanish, is there a way to save to archive? Can't find anything on how to save scripts :(

There is a difference between the local drive (F5) and the archive ('cloud drive'). You have to save your script and copy it to archive to permanently save it. However, I would suggest that you use an external editor instead of the built in one, that tends to work a lot better. Saturn IDE currently is an excellent choice.

Also, this is the old thread and you are probably using an old version of kOS, so I would advise you to go to the new one and download that version. It has a lot of improvements.

Edit: foo yourself, erendrake! :P

Link to comment
Share on other sites

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