Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


erendrake

Recommended Posts

I find kOS will disable Ship:Control:Pitch when "set Ship:Control:Pitch to 1."

But it doesn't work when "set Ship:Control:Pitch to 0."

Maybe "Ship:Control:Pitch=0" means kOS is no controling veesl's Pitch.

So a compromised way is:

set Ship:Control:Pitch to a very small value(like 0.0001).

And in next turn,set Ship:Control:Pitch to -Ship:Control:Pitch.

- - - Updated - - -

Oh... ":" and "P" equals :P ?

Link to comment
Share on other sites

Anyone knows how to change kOS's full physics range? (2.5 km) Thanks.

you can't. The devs only recently realized they are only modifying part of the game's physics range properties and that doesn't make a difference. Might be fixed in the next update. For now I just use BDarmory to increase physics range for all my crafts

Link to comment
Share on other sites

Has anyone writing kOS codes by Vim/Gvim?

I'm looking for the Vim/Gvim's Syntax Config Files for kOS?

Thanks.

Here you can find syntax files for: Atom, Nano, Notepad++ and last but not least Vim.

https://github.com/KSP-KOS/EditorTools

Link to comment
Share on other sites

In the name of simplicity I've started playing around with KoS, which I fell in love with and what is more simple than a blinking "Warning" text? I Failed :D. Has anyone ever tried to make a text blink at (1,1) without using clearscreen? :D Simply put when I print "Warning" how can I erase this word at the same spot without clearing everything else? I know it's only a silly GUI improvement but I insist on it. I can do orbit with KoS but not this :D

Edited by Adik3714
Link to comment
Share on other sites

In the name of simplicity I've started playing around with KoS, which I fell in love with and what is more simple than a blinking "Warning" text? I Failed :D. Has anyone ever tried to make a text blink at (1,1) without using clearscreen? :D Simply put when I print "Warning" how can I erase this word at the same spot without clearing everything else? I know it's only a silly GUI improvement but I insist on it. I can do orbit with KoS but not this :D

I think you can print a series of space key like '_______' after a 'wait' at the same spot, that could do the job ^^

Edited by astrobond
Link to comment
Share on other sites

I think you can print a series of space key like '_______' after a 'wait' at the same spot, that could do the job ^^
I've tried these: print "". ; print: " ". ; print "_______". But neither of it works. It only adds "___" next to my test word if it is longer. Here's code. O gush I'm sure It's supposed to be so easy and I'm missing something obvious.

clearscreen.

until false {

print "dragon" at (1,1).

WAIT 1.

print "_______" at (1,1).}

Anyway I'd like to make a function BLINK ("text, 10") which would flash for a specific amount of time.The Timer isn't problem, blinking is. It would be good if it was blinking without specifying the location anywhere where the function is.

Edited by Adik3714
Link to comment
Share on other sites

Hi again,

I can't test at work, but i had this two lines that worked in one of my script:

PRINT " " AT (2,40).

PRINT "Safe Thr: " + round(safethrottle*100) + "%" AT (2,40).

can you try your code at 2,2 to see if that is better ?

Edit: (there is more than 1 'space' in my first line, about 20 'spaces' )

Edit: new idea ^^ add also a WAIT 1. after your second print in your code ;)

Edited by astrobond
Link to comment
Share on other sites

2,2 and even 10,10. I switched the lines and positions over and over => print " " at (10,10) is on the first line now. Looks like this and still doesn't work. The output on GUI => ragon. So it is rather erasing the signs permanently and definitely not blinking. I think once you print something it just stays until you clearscreen it.

clearscreen.

until false {

print " " at (10,10).

WAIT 1.

print "dragon" at (10,10).

}

Edited by Adik3714
Link to comment
Share on other sites

Eureca! :) What a detail. Thank you very much. The another wait command helped.

edit 1. It even makes sense. I need to switch my mind to KoS type of thinking.

Edited by Adik3714
Link to comment
Share on other sites

I'm not familiar with github, so I'll post it here hoping you guys read it.

In relation to my previously submitted issue (#389, LOCK STEERING broken for RCS-only (no torque) ships), and the related fix attempt (#1118, github user hvacengi is committing there). At the latest KSP/kOS version my RCS-only craft responded to LOCK command properly and aligned itself onto a given heading. But my gimbal-only (no reaction wheels, no RCS) craft ended up exactly the same as the other one.

Reproduction steps include building a craft that only has a non-torque probe core, kOS computer, fuel tank and gimbal-equipped engine and launching it under gravity hack. Inputting a LOCK STEERING command into the terminal makes the gimbal wobble like in the video for the previous issue, which I linked above.

Not sure if hvacengi's solution is going to be a major rework of the cooked control system that would solve that case too, in any case I'm letting you know about the issue.

I recently started a RSS/RO save and attempted to write kind of a real-life autopilot using Powered Explicit Guidance algorithm, but I never had the patience to do PID tuning, so I'd rather be able to use cooked control than try to align the craft on the pilot input mode ;)

Link to comment
Share on other sites

Hi guys, I did a little bit of research and I guess I can state that printing total DeltaV of three stage vessel at launchpad is kinda rocket programming science. Am I right? Or is there a mid difficult solution? Any leads? I did it for one stage rocket with no problem but with multiple stages I did not figure out how to list parts in individual stages and proceed them to the final result. Is there a way - concerning especially the listing part.

Link to comment
Share on other sites

holy mother of the space kraken... it took me four days to figure this out:

LOCK WHEELSTEERING TO 090. <----- DOESN'T WORK

LOCK WHEELSTEERING TO 090.0 <----- DOESN'T WORK

LOCK WHEELSTEERING TO 090.1 <----- WORKS

looks like a bug

Edited by WeirdCulture
Link to comment
Share on other sites

I've been trying to lock steering to without much success. In fact I wanted it to point to a specific vector, but that didn't do either.

Unless the vessel is almost "there" it starts wobbling more and more and in a few seconds it's rolling/yawning/pitching very fast. If I go from v(0,1,0) to v(1,1,0) it behaves automatically OK, but if I go from 0,1,0 to 0,-1,0 it will certainly not get there.

Can it be something about resonances? The vessel is extremely light, and the torque generated is enough to turn the ship 180 degrees under 2 seconds with MJ. No rcs is available at all.

Tomorrow I'll have a try with another vessel when I get to the laptop.

Link to comment
Share on other sites

That's the problem with lock steering to <vector>. - it may choose completely different roll and do a rather stupid maneuver.

Try lock steering to lookdirup(<vector>, ship:facing:topvector). - this keeps roll as it is.

Also, you better don't have SAS on. On larger maneuvers even basic SAS conflicts with the autopilot.

Link to comment
Share on other sites

Hi guys, I did a little bit of research and I guess I can state that printing total DeltaV of three stage vessel at launchpad is kinda rocket programming science. Am I right? Or is there a mid difficult solution? Any leads? I did it for one stage rocket with no problem but with multiple stages I did not figure out how to list parts in individual stages and proceed them to the final result. Is there a way - concerning especially the listing part.

One difficulty is that for a complex rocket it may not be apparent how the pilot is expected to operate the staging.

Link to comment
Share on other sites

One difficulty is that for a complex rocket it may not be apparent how the pilot is expected to operate the staging.
The way like the KER presumes it would be perfect and enough. It must also analyze the stages somehow.
Link to comment
Share on other sites

That's the problem with lock steering to <vector>. - it may choose completely different roll and do a rather stupid maneuver.

Try lock steering to lookdirup(<vector>, ship:facing:topvector). - this keeps roll as it is.

Also, you better don't have SAS on. On larger maneuvers even basic SAS conflicts with the autopilot.

Sas is definitely turned offffff ... from several places around the code, just in case.

Although this change definitely helped, there's something wrong with this particular ship. The code works just fine with another tiny vessel, but the one I need is still spinning a lot. Although when I unlock steering and turn sas on, it stops wiggling surprisingly close to the direction I wanted! So crazy, but it converges little by little. Although a bit dangerous since it's being used for docking.

I'm completely wowed. By extending all gear, antennas, solar I was able to make it behave more or less properly. Also, if I target a vessel that is far away it goes better than a near one.

Now the main problem is spin, any crazy ideas to reduce that?

EDIT:

Now, I could make THIS work perfectly. I'm stunned.


sas off.
LOCK STEERING to lookdirup(dir,ship:facing:topvector).


when true then{
UNLOCK STEERING.
sas on.
}

It's too good to be true. Is this something I can rely on, or may it become obsolete in a future kOS release?

Edited by Qigon
Link to comment
Share on other sites

The general problem I'm dealing with is about TARGET. Sometimes I double click on some vessel, to which case TARGET is a vessel. But sometimes I right click on some docking port and in that case TARGET is a part.

Here's some things I'm struggling with:

1- How can I tell whether TARGET is a vessel or a part?

2- I've been looking into the docs for some way of finding to which vessel a part belongs? I tried p:parent:parent:parent until I got nothing, and also p:rootPart. I tried an alternative self exploring way, but I couldn't use HASFIELD on a part to do some clever checkings, is there something similar to what we do on modules?

3- In case it's not possible to find a vessel starting with a pointer to one of its parts, how do I find its vessel's velocity? For docking procedures.

Link to comment
Share on other sites

Im having trouble getting the code listed below to run when I saved it to the archive or any other volume. When I run it straight from the terminal it works fine.

WHEN SHIP:SOLIDFUEL < 0.1 THEN {
STAGE.
}

More specifically, I cannot get the code to run through the loop. Am I missing something for the volume?

Link to comment
Share on other sites

Im having trouble getting the code listed below to run when I saved it to the archive or any other volume. When I run it straight from the terminal it works fine.

More specifically, I cannot get the code to run through the loop. Am I missing something for the volume?

WHEN is not loop, but trigger. If you program ends right after it, the program just ends and the trigger gets removed.

If this is all you need to do, try this instead:

WAIT UNTIL SHIP:SOLIDFUEL < 0.1.

STAGE.

Link to comment
Share on other sites

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