Jump to content

kOS Scriptable Autopilot System 0.9


KevinLaity

Recommended Posts

I`ve decided to post this in the KOS thread and in the Realchutes thread.

I`ve made an orbital drop pod which is controlled by KOS which uses Realchutes. Does the whole scary drop pod bit. Deorbits with retrorockets, waits until the very last second to pre-deploy the chutes (1000m) and the chutes open at 700m and take 4 seconds to open so they just slow the craft down to about 1/6 the speed of sound by about 45m. The program then activates deceleration thrusters for about 2 seconds that cut out 5m from the surface or so and BLAM. Landed at under 10m/s.

Perfect for spy missions, getting that last best hope behind enemy lines and so forth. Good for all the times you need to get from orbit to the ground as fast as you can with no fuel in a radar invisible one Kerbal craft.

I`ve made a little video too...

Doodbin Kerman has been sent on a super secret spy mission behind enemy lines. He has to launch pre-dawn and land at dusk on the far side of the planet. He will take the new Mk1 DropPod which has been shown to be reliable 37% of the time to the odds are better than normal. He must not use any fuel in the atmosphere above 50m for super secret spy reasons or carry a large chute for weight reasons. the chute will not slow him below 100mph so we have fitted a radar activated thrust pack which will activate at 46m to slow him the rest of the way.

We are thinking we might be able to shave 2-3m off that...

Full video from launch to land.

Time remapped video with slowdown for landing.

(Video shows old script which used staging, downloadable version uses action groups and is much more reliable Also, burn in video is prograde, not retrograde as it should be)

http://www./view/t85sfoc8cy8eqgk/Drop%20Pod.craft

http://www./view/s9fwhv2prg9shdc/drop.txt

Get it into orbit (up to about 120km) point prograde and run drop. You will fire rockets retrograde (from the top of you pod), you will deorbit and land.

This was made as a demonstration of the possibilites of KOS and Realchutes.

Edited by John FX
Link to comment
Share on other sites

I have a problem with kOS. Even though I opened the terminal, and toggled the power on for the kOS control unit, which is on the ship, I can't focus on the terminal window, which means I can't type anything. I tried clicking, double-clicking, right clicking, middle mouse button clicking, on both unmanned and manned spacecrafts, but nothing is happening. What's going on?
You need the fixed version (0.9.4) I made a couple of days ago:

Its on this page even...

This seems to need reposting every other post. Does nobody scan back a couple of pages when they get a new bug with a new patch anymore?

I am running 0.9.3. and I have a problem...

set b to body.

if b = "Kerbin" { print "1".}.

Syntax Error.

Why? Seems like any "..." on the line with if cause syntax error.

btw... is there another forums just for K-OS?

Also applies to you. You are comparing a literal string. Get the new version.

Edited by John FX
Link to comment
Share on other sites

My google-fu has failed me; Is there a suffix to change an existing maneuver node's time? I've found the suffixes :ETA, Radialout, normal, and prograde but so far the only option I have discovered to change a node's time is to remove it and add a new one. Surely there is a cleaner way?

Link to comment
Share on other sites

My google-fu has failed me; Is there a suffix to change an existing maneuver node's time? I've found the suffixes :ETA, Radialout, normal, and prograde but so far the only option I have discovered to change a node's time is to remove it and add a new one. Surely there is a cleaner way?

0.9.2 doesnt have the ability to change the Time till node. I have a fix in place on my fork and i plan on getting something out this weekend.

Link to comment
Share on other sites

Logris, would it be possible to release the sources of your update please ? I made some modifications for myself on the old version and I'd like to merge them on your version.

A page back he mentioned that he basicly grabbed a few pull requests for his release. He Linked to them in his post.

When I went to add a pull request on GitHub, I found there were already two there with pretty much what I had done:

https://github.com/Nivekk/KOS/pull/255/files

https://github.com/Nivekk/KOS/pull/290/files

Edited by erendrake
added Logris's post/
Link to comment
Share on other sites

Your algorithm describes how to find the slope of the terrain if you lived in a 2D world with dimensions X (horizontal) and Y (height) only. But when operating in a 3D world, you need to also know the slope in the crossways direction to your travel, which this algorithm doesn't find. Imagine a long trench gouging the ground from west to east. If your ship is traveling west to east and sampling the ground height along the slope on one side of this trench, it will think the ground has a flat slope when it has a very steep slope… but it's a slope perpendicular to the direction of travel so you can't "see" it on that one pass.

For the idea to work will require storing multiple data points in memory and moving in multiple directions to scan the slope in two different directions and remember the ground height. And that's where the current limitations of kOS are a problem as storing such a thing is going to be a real mess without arrays implemented. When you have to hardcode the name of each data point as a separate variable it's too unwieldy to work with it.

Link to comment
Share on other sites

Your algorithm describes how to find the slope of the terrain if you lived in a 2D world with dimensions X (horizontal) and Y (height) only. But when operating in a 3D world, you need to also know the slope in the crossways direction to your travel, which this algorithm doesn't find.

Agreed, and the gradient 'changes' depending on how perpendicular/parallel the craft travels in relation to the given slope. As you point out, travelling at exactly the same direction as a slope will return a gradient of zero - which is nonsense, or more correctly, there is a gradient of zero in that direction only. Conversely, approaching a slope at 90 degrees would yield the correct slope, but again, only in that direction of travel. One may argue the chances of travelling EXACTLY in the same direction as a grade is 2 in 360 degrees. That is, you would have to travel exactly east or exactly west in your example to get a gradient of zero. The chances of that happening is less than 1%. However, you do have a point in that the closer an approach to a slope is to perpendicular, the more accurate the reading of the slope will be.

As stated in the blog, this is not a perfect solution but I'm hoping a C# programmer can recognise there is a huge void in this space and even if terrain can't be avoided on all axis, then avoiding terrain on just one axis will give a bot a fighting chance.

Another approach I considered is to get a better idea of terrain all around by moving laterally across a 200m x 200m area during descent and then having a genuine idea of the terrain below it and deciding where to land accordingly. You would need a minimum of five data points (middle + four corners) or for better resolution, nine data points (middle plus 8 points around it). You could go 4x4 data points or 5x5 etc for more sophistication.

All this is probably well outside the realm of kOS at this point unfortunately so this moves into the space of a c# plugin. :(

Link to comment
Share on other sites

Hi all, Sorry to say that I do not have times to browse through 257 pages of thread...Just a few question needed some answer. Thanks in advance for help.

1) I've downloaded the version kOS_0_9_4. So, where should I put the file to? GameData? or Merge with KSP folder?

2) How to 'Save' the script? that I've written in the console? Everytime I abort the mission, my scrip just lost.

3) A master list of scrip?

My goal. Try to on/off a series of illumination. To form a sentence, or words.

Edited by Sirine
Link to comment
Share on other sites

Agreed, and the gradient 'changes' depending on how perpendicular/parallel the craft travels in relation to the given slope. As you point out, travelling at exactly the same direction as a slope will return a gradient of zero - which is nonsense, or more correctly, there is a gradient of zero in that direction only. Conversely, approaching a slope at 90 degrees would yield the correct slope, but again, only in that direction of travel. One may argue the chances of travelling EXACTLY in the same direction as a grade is 2 in 360 degrees. That is, you would have to travel exactly east or exactly west in your example to get a gradient of zero.:(

I picked the simplest example to illustrate the problem and assumed you'd extrapolate from that to understanding the more general case problem. It's still a problem if you read a much flatter slope than is really there even if it's not reading all the way down to zero. Reporting a slope of, say, 0.2 when it's really 0.8 is still a major problem. So the problem will happen a LOT more often than you're claiming. Slopes in KSP are rarely going to be zero. Only on a few worlds that have 'sea level' ground, like Minmus, will that happen. So the code will actually have to have a tolerance cutoff to be effective, say for example, "it's okay to land on a slope of 0.2 or less", rather than trying to find an absolutely zero slope. And that means, that the problem doesn't just occur when going only exactly perpendicular to the slope. It happens when going *close enough* to perpendicular to the slope to read falsely small enough numbers to fall below that tolerance window (which is NOT going to be zero) when the terrain isn't really that flat.

How do I know? Because I've done it in kOS already. My lander has exactly this problem and it happens a lot more often than you imply.

To make it work in kOS is going to require either arrays (to store a grid of different measurements as you drift in multiple directions, to make a small surface map), or directional ground radar that realistically aims in the direction the bottom of the ship is pointed rather than radar that aims straight vertical regardless of the craft's orientation (which is what KSP has now). With radar that aims with the craft, you could just rotate a bit in the crosswise direction to check the slope perpendicular to your travel.

Link to comment
Share on other sites

Thanks Steven. I can now see what you're saying. A gradient of 0.2 won't mean much if you don't know if you're running with or against the slope. I shall refine my idea, but not in this thread as I think this is beyond the power of kOS (currently). I appreciate your thoughtful reply. :)

Link to comment
Share on other sites

I would say a part like the Kos Sensor Reporter but that returns the slope at a lat/long point could be written using techniques from Mapsat or Scansat where they directly get the terrain height from the API AFAIK and this could be used to determine slope at that point which could be fed to KOS as a variable which could be used in programs. The direction of slope could then also be available.

Until this functionality can be built into KOS I would say that might be the easiest way to do it.

Hi all, Sorry to say that I do not have times to browse through 257 pages of thread...Just a few question needed some answer. Thanks in advance for help.

1) I've downloaded the version kOS_0_9_4. So, where should I put the file to? GameData? or Merge with KSP folder?

2) How to 'Save' the script? that I've written in the console? Everytime I abort the mission, my scrip just lost.

3) A master list of scrip?

My goal. Try to on/off a series of illumination. To form a sentence, or words.

1, if you just have a .dll file then you need to put that inside your current KOS installation inside gamedata overwriting your current KOS.dll. It`s at \GameData\kOS\Plugins

2, I would say to download either KOS ide or saturn which is another IDE for Kos and edit your programs outside of KSP. The ingame filesystem is not the best. Save your scripts in your archive as yourprogramname.txt and then when on the pad open your console and

copy yourprogramname from 0.
run yourprogramname.

3, your programs are kept in your KSP install directory then plugins/plugindata/archive

I would advise you looking at the wiki about the filesystem. It is much more complex than I have time to repeat here.

Edited by John FX
Link to comment
Share on other sites

Anyone know how to connect to the archive? I'm using remotetech, I have antennas, and I'm on the ground in a manned vehicle, but can't connect to the archive.

switch to archive.

or

switch to 0.

That should do the trick, even with out any antenna/dishes as long as you are with in the built in 3000m range.

Some people like write their programs externally and save in ksp\plugins\archive (I'm pretty sure thats the location). THen in kOS when you first start, rather than running the program straight from the archive:


copy [i]program name[/i] from archive.
run [i]program name[/i].

Link to comment
Share on other sites

i cant get this to work what do I do to get my keyboard to work for this?

edit: the window is there its just semi-transparent an i cant enter any text

Edited by zakkpaz
Link to comment
Share on other sites

i cant get this to work what do I do to get my keyboard to work for this?

edit: the window is there its just semi-transparent an i cant enter any text

This is why someone really needs to fork kOS, make a new name for the new split-off version of it, and make a new github page for it and a new name and a new Spaceport page. As long as the official version is still 0.92, and that's what people will see when they look for "some sort of programming in KSP thingy", this question will continue to be asked again and again and again and again. One person compiling a new version of it and putting it on a cloud and pointing to it in a forum post is a nice stopgap but if Kevin is still out of communication then this just isn't a viable way to continue and I fear it will wither and die.

Link to comment
Share on other sites

This is why someone really needs to fork kOS, make a new name for the new split-off version of it, and make a new github page for it and a new name and a new Spaceport page. As long as the official version is still 0.92, and that's what people will see when they look for "some sort of programming in KSP thingy", this question will continue to be asked again and again and again and again. One person compiling a new version of it and putting it on a cloud and pointing to it in a forum post is a nice stopgap but if Kevin is still out of communication then this just isn't a viable way to continue and I fear it will wither and die.

Ya know you could at least tell me what i'm doing wrong before you start on how i'm a part of some endemic.

Link to comment
Share on other sites

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