Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


erendrake

Recommended Posts

I have installed the latest kOS and the latest blizzy toolbar. I had to install the toolbar because it's not showing up on the stock menu. But now every time I leave a building the kOS config screen pops up???

Link to comment
Share on other sites

I have installed the latest kOS and the latest blizzy toolbar. I had to install the toolbar because it's not showing up on the stock menu. But now every time I leave a building the kOS config screen pops up???

Could you please include your logs (output_log.txt).

Link to comment
Share on other sites

like how far a engine is from the CoM.

http://ksp-kos.github.io/KOS_DOC/structures/vessels/part.html?highlight=part#attribute:PART:POSITION

is there or will there be a warp to command?

Predictions are hard, especially about the future. We dont have it now.

I dunno why but I still get a message that is build for 0.90 KSP Add-on checker GUI.

Maybe you haven't forget to update the file that sets this number?

That was the problem, we got a PR to fix it this morning.

https://github.com/KSP-KOS/KOS/pull/944

Is the feature to scale the terminal window with font scaling accordingly anywhere in your todo list? Pleeeeeeease!

it is not, you are welcome to add it here https://github.com/KSP-KOS/KOS/issues

So, what is (at least some) replacement for ship:termvelocity

?

What are you trying to do that you were doing with termvelocity before? is it some kind of metric for limiting throttle? many people use TWR and i think its a find choice.

Link to comment
Share on other sites

for now, if you have KERBAL ALARM CLOCK installed, u may use code like this.

set rt to nextnode:eta - burntime - 60.

set na to addalarm("raw", time:seconds + rt, "", "").

set na:action to "KillWarpOnly".

if rt > 5 { set warp to 1. }

if rt > 10 { set warp to 2. }

if rt > 50 { set warp to 3. }

if rt > 100 { set warp to 4. }

if rt > 1000 { set warp to 5. }

if rt > 10000 { set warp to 6. }

if rt > 100000 { set warp to 7. }

it's just a rough code, do test before run it.

Link to comment
Share on other sites

I presume that SHIP:HEADING would return the ship's relative position to itself, is there any way to get a ship's current compass heading?

EDIT:

While I am asking I may as well also wonder if there is an easy way to get it's pitch relative to the horizon or roll relative to level flight too.

Edited by Blu_C
Link to comment
Share on other sites

I presume that SHIP:HEADING would return the ship's relative position to itself, is there any way to get a ship's current compass heading?

regarding the SHIP:something properties, is there a list of all of them? I couldn't find a list of them in the Docs and I'm not sure if they are a residue from older version and just present to ensure compatibility with older version, or just forgotten.

btw, thanks for updating the Docs. :thumbsup:

Link to comment
Share on other sites

regarding the SHIP:something properties, is there a list of all of them? I couldn't find a list of them in the Docs and I'm not sure if they are a residue from older version and just present to ensure compatibility with older version, or just forgotten.

btw, thanks for updating the Docs. :thumbsup:

Here:

http://ksp-kos.github.io/KOS_DOC/structures/vessels/vessel.html

And because a vessel is also an orbitable these too:

http://ksp-kos.github.io/KOS_DOC/structures/orbits/orbitable.html

Link to comment
Share on other sites

I feel like I'm missing something really obvious here. I can execute commands in the terminal directly, but scripts don't do anything. For example "lock throttle to 1.0." in a .ks file does nothing whereas typing it directly works. I get kOS: Execution broken in the debug menu.qpLooJw.png

FlightCtrlParam: Enabled: throttle False => True this doesn't happen with the script. It goes from False to False.

Occasionally it throws this:

[Log]: kOS.Safe.Exceptions.KOSUndefinedIdentifierException: Undefined Variable Name 'throttle*'.

at kOS.Execution.CPU.GetVariable (System.String identifier, Boolean barewordOkay, Boolean failOkay) [0x00000] in <filename unknown>:0

at kOS.Execution.CPU.GetValue (System.Object testValue, Boolean barewordOkay) [0x00000] in <filename unknown>:0

at kOS.Safe.Compilation.OpcodeCall.Execute (ICpu cpu) [0x00000] in <filename unknown>:0

at kOS.Execution.CPU.ExecuteInstruction (IProgramContext context) [0x00000] in <filename unknown>:0

Edited by AndreyATGB
Link to comment
Share on other sites

Can you add an option to play sounds? I want to play sound effects like "pull up" or even add an option to play MP3s in a planned flight assist program.

Even a buzzer or something like that would be apreciated.

Link to comment
Share on other sites

I know I'm being super lazy here but I don't suppose there is a way to set kOS up so that if my electric charge runs below say 5% I can activate a fuel Cell and when it reaches 10% electric charge to turn them back off because I'm running a probe with Ion engines and purely running off the Fuel cells would be inefficient so I have 2 RTG's and some solar pannels. Which the solar panels wont work once I get out to Jool and the 2 RTG's wont provide nearly enough power.

But with a decent battery bank and the supplemental power from the RTG's and the small amount of power I will get from the solar panels I can reduces my liquid fuel and oxidizer consumption considerably, but he fuel cells automatically burn fuel when activated so I would have to watch the electic charge all the time. which does not use power I have built up with the RTG's and solar panels which would give me 2m 37s of thrust or 310m/s deltaV from the batteries and RTG's, not including solar because I can't relay on it.

Edited by etheoma
Link to comment
Share on other sites

I feel like I'm missing something really obvious here. I can execute commands in the terminal directly, but scripts don't do anything.

People keep messing this up. I feel like we need to make the following line in the documentation page stand out better:

When the program ends, these automatically unlock as well, which means that to control a craft you must make sure the program doesn’t end. The moment it ends it lets go of the controls.

Link to comment
Share on other sites

Currently kOS throws a version warning for the KSPAPIExtensions included, however v1.7.4.0 of KSPAPIExtensions is now out and fully 1.0.2 compatable. Could someone bundle that version with kOS instead of the current version we have in there (v1.7.3.0 is in there now).

Link to comment
Share on other sites

'LIST ENGINES FROM SHIP.' is returning a syntax error on the F. Likewise, using copy pasta from the kOS docs "LIST RESOURCES FROM TARGET." (http://ksp-kos.github.io/KOS_DOC/commands/list.html?highlight=list) is also not happy.

How do I get a list from an object (a ship in this case) that isn't the default?

Edited by CorBlimey
Link to comment
Share on other sites

Is there a way to increase the font size for the program editor? I don't like squinting so much at the screen.

Not at the moment, but you can edit your programs externally to the game, in whatever text editor you like.

Link to comment
Share on other sites

Not at the moment, but you can edit your programs externally to the game, in whatever text editor you like.

External editors are fine when you know what you're doing. But when you are trying to learn things and type different commands from the manual you tend to work with console closely :( And yes, bigger size would be nice at that point.

Link to comment
Share on other sites

External editors are fine when you know what you're doing. But when you are trying to learn things and type different commands from the manual you tend to work with console closely :( And yes, bigger size would be nice at that point.

I'm in the process of learning KOS at the moment, and I find Notepad++ to be extremely convenient. Just save the [programname].ks file in your ...KSP/Ships/Scripts folder, and from the KOS console type "Copy [program name] from 0." whenever you make a change and save. Afterwards, run as normal. Not really as complicated as it would seem.

Link to comment
Share on other sites

I know I'm being super lazy here but I don't suppose there is a way to set kOS up so that if my electric charge runs below say 5% I can activate a fuel Cell and when it reaches 10% electric charge to turn them back off because I'm running a probe with Ion engines and purely running off the Fuel cells would be inefficient so I have 2 RTG's and some solar pannels. Which the solar panels wont work once I get out to Jool and the 2 RTG's wont provide nearly enough power.

But with a decent battery bank and the supplemental power from the RTG's and the small amount of power I will get from the solar panels I can reduces my liquid fuel and oxidizer consumption considerably, but he fuel cells automatically burn fuel when activated so I would have to watch the electic charge all the time. which does not use power I have built up with the RTG's and solar panels which would give me 2m 37s of thrust or 310m/s deltaV from the batteries and RTG's, not including solar because I can't relay on it.

If you can read the status of the electrical power it should be pretty easy to do, if you set your fuel cells with an action group. You could either go by the total amount left, or do a little math to figure out the percentage. Then a couple of if statements, or when statements to toggle the chosen action group. Or...maybe the name tag thing, I haven't looked into that. If I understand correctly, you can give your fuel cells names, and then reference them with their on/off state, whatever it may be.

I'm in the process of learning KOS at the moment, and I find Notepad++ to be extremely convenient. Just save the [programname].ks file in your ...KSP/Ships/Scripts folder, and from the KOS console type "Copy [program name] from 0." whenever you make a change and save. Afterwards, run as normal. Not really as complicated as it would seem.

This works especially well when you have dual monitors. :D I'm just getting back into kOS, haven't used it since apparently KSP 0.23, as I finally found my old programs I wrote lol. Working on writing a new one for launch/circularizing, it works up until the circularizing part, gotta remember/piece together what I used last time to make it work.

Edited by Sma
Link to comment
Share on other sites

u may try Atom with k-os syntax

care to share the config? :)

edit:

nevermind - found it was a package! :)

Cool - been using NP++ so far as I use that normally but this is a great way to get into Atom, another great editor.

- - - Updated - - -

'LIST ENGINES FROM SHIP.' is returning a syntax error on the F. Likewise, using copy pasta from the kOS docs "LIST RESOURCES FROM TARGET." (http://ksp-kos.github.io/KOS_DOC/commands/list.html?highlight=list) is also not happy.

How do I get a list from an object (a ship in this case) that isn't the default?

sorry for a self-bump, but I am stumped. I am trying to learn lists. How do I get a list from an object (a ship in this case) that isn't the default? 'LIST ENGINES FROM SHIP.' (or another ship object variable) is returning an error on the first F for FROM, while the same but without specifying a FROM clause is fine.

Edited by CorBlimey
Link to comment
Share on other sites

After some discussion on the subreddit I decided to make some new sensor modules that introduce small errors. There's no direct dependency or special interface to kOS, but the purpose is to enable the use of kOS to experiment with tools for guidance from uncertain readings (such as least-squares, Kalman filtering, and Byzantine fault tolerance.) Here's a beta/preview/proof-of-concept: https://www.dropbox.com/s/11tov1wvslpdwsp/ErrorBars-0.zip

What's done so far:

External air temperature thermometer with hysteresis and influence from the part's temperature. (Part temperature influence is higher when the thermometer is aerodynamically shielded.) Added as a PartModule on the 2HOT.

Linear accelerometer and rate gyro with white noise and red noise. Added to the seismometer, any command part with SAS, and any reaction wheel without command. (Reaction wheels have the highest accuracy.)

Barometer with small white noise and a strict 2 Pa - 200kPa range. More accurate when aerodynamically shielded. Added to the Pres-Mat.

Pitot tube with a 10 kPa - 1MPa range, dampened readings under 25 m/s, and large fluctuations above Mach .7 - must not be aerodynamically shielded. New part in the control tab, using the "Small Hardpoint" model.

Still to come:

Radar altimeter

Radio time-of-flight transponder

Fluctuations in actual state rather than just measurements (wind gusts, micrometeorites)

Link to comment
Share on other sites

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