Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


erendrake

Recommended Posts

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 - - -

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.

we have a known issue for the LIST..FROM..IN syntax. https://github.com/KSP-KOS/KOS/issues/620

but i think what you are looking for is "LIST ENGINES IN elist" that will give you the list of engines for the current craft.

Link to comment
Share on other sites

It seems to break once another mod that uses KSPAPIExtensions loads (right-click UI of kOS parts doesn't show), such as Infernal Robotics. I just copied the dll from Infernal Robotics and it's both working again and not giving that warning.

Link to comment
Share on other sites

Minor question about how craft control works with Cooked Controls.

I've been using the following code to steer my craft toward a maneuver node:

LOCK STEERING to NEXTNODE:BURNVECTOR:NORMALIZED.

Nothing special. It smoothly swings to the desired direction, but once on the node it begins to roll slightly back and forth. This is behavior I would prefer to avoid as on craft without reaction wheels which only have RCS this will burn through an absurd amount of their RCS fuel.

Is there a way to get rid of the roll oscillations I've been experiencing?

Link to comment
Share on other sites

For symmetrical craft, roll is not needed. I've not found a way to tell the steering system to ignore roll completely, but I have had success with:

local bd to NEXTNODE:BURNVECTOR:DIRECTION.
set s to R(bd:pitch,bd:yaw,FACING:roll).

(with steering locked to s). It's not perfect, since manual roll control still fights with it, but it's better than nothing. My actual use for this is allowing the player to rotate the ship to align solar panels with the sun manually.

Link to comment
Share on other sites

For symmetrical craft, roll is not needed. I've not found a way to tell the steering system to ignore roll completely, but I have had success with:

local bd to NEXTNODE:BURNVECTOR:DIRECTION.
set s to R(bd:pitch,bd:yaw,FACING:roll).

(with steering locked to s). It's not perfect, since manual roll control still fights with it, but it's better than nothing. My actual use for this is allowing the player to rotate the ship to align solar panels with the sun manually.

Your way of doing things gave me an idea. Should something like this work as well?


SET SteerVect to NEXTNODE:BURNVECTOR:NORMALIZED.
LOCK STEERING to LOOKDIRUP( SteerVect, SHIP:FACING:TOPVECTOR).

EDIT: In case anyone else has a similar question: Ended up using the code just above and it works perfectly fine.

Edited by Blu_C
Update on the code.
Link to comment
Share on other sites

Minor question about how craft control works with Cooked Controls.

I've been using the following code to steer my craft toward a maneuver node:

LOCK STEERING to NEXTNODE:BURNVECTOR:NORMALIZED.

Nothing special. It smoothly swings to the desired direction, but once on the node it begins to roll slightly back and forth. This is behavior I would prefer to avoid as on craft without reaction wheels which only have RCS this will burn through an absurd amount of their RCS fuel.

Is there a way to get rid of the roll oscillations I've been experiencing?

for the record, I usually turn sas and mechjeb SmartAss off since they don't play well with "LOCK STEERING". Are you using any of both?

Link to comment
Share on other sites

It seems to break once another mod that uses KSPAPIExtensions loads (right-click UI of kOS parts doesn't show), such as Infernal Robotics. I just copied the dll from Infernal Robotics and it's both working again and not giving that warning.

That seems to have worked - thank you!

Link to comment
Share on other sites

Hello. I've been working on a kOS project for the last couple of weeks. I'm proud to present to you the akrOS - as far as I know, the first kOS window-based operating system.

Main features:

  • windows
  • processes - yes, you may run multiple programs at the same time, and they'll all update at the same time!
  • action group controls
  • focus mechanics
  • automatic screen resizing (when you resize terminal)
  • user tutorials (first steps in akrOS)
  • developer tutorials (how to make your own widget)

Everything is made in a modular way - every process/widget is contained in a separate file, so a fellow developer will be able to quite easily add his own contribution to this project.

Link to a reddit post containing images and download: http://www.reddit.com/r/Kos/comments/35ufj1/akros_the_window_operating_system/

Link to comment
Share on other sites

we have a known issue for the LIST..FROM..IN syntax. https://github.com/KSP-KOS/KOS/issues/620

but i think what you are looking for is "LIST ENGINES IN elist" that will give you the list of engines for the current craft.

thanks.

I was looking for the FROM because I was planning on writing a solid staging function for use in a library. In the meantime until the issue is fixed, I can parameterise the engine list instead of passing in the ship object.

Link to comment
Share on other sites

question regarding this image:

n0f1jNt.png

You can see on the right-click menu I have three science experiments - "Collect Data", "Collect Samples" and "Telemetry Report". When I query the Avionics Package for modules I get three "ModuleScienceExperiment" modules. So far so good, but when I go and try to check out the events for the 3 modules they all come back with "Collect Data". Activating them all individually with doAction() just runs the same experiment three times.

So I can only assume that the same module is being returned. How do I differentiate between modules of the same name? It mentions in the docs that modules can have the same name but I couldn't find anything on what to do about accessing different modules with the same name

Edited by Gaiiden
Link to comment
Share on other sites

Mod works great! Found that Asperagus staging takes a bit of setup, but I had success with checking the engine's status for "Flame-Out!" which works great.

On another note, I can't get the stock panel to show up. I tried updating the KSPAPIExtensions.dll, which fixed the out of date error, but didn't make the panel button show up. I just bound the Action to the breaks, for the time being, but a button would be nice!

Link to comment
Share on other sites

Couldn't find anything on the wiki, so I thought I'd ask here: is there a way to check the current type of a variable? I'm trying to calculate the dV of each individual stage of a rocket. My first thought was to iterate over all the parts and collect the necessary information that way, but there doesn't seem to be a way to differentiate which parts are engines and which aren't.

Edited by Parametric
Link to comment
Share on other sites

list engines in engineList.

Knowing the "type" wouldn't be helpful anyway, the "type" for engines is "Part". The way to figure out if they're engines (if the preceding handy command didn't already exist) would be to check if the part's modules included ModuleEngines.

Edited by Galatea
Link to comment
Share on other sites

Couldn't find anything on the wiki, so I thought I'd ask here: is there a way to check the current type of a variable? I'm trying to calculate the dV of each individual stage of a rocket. My first thought was to iterate over all the parts and collect the necessary information that way, but there doesn't seem to be a way to differentiate which parts are engines and which aren't.

The official documentation (http://ksp-kos.github.io/KOS_DOC/) should be your first stop always, not wiki. There is also plenty of example code and libraries here https://github.com/KSP-KOS/KSLib

Link to comment
Share on other sites

Hi,

I'm trying to launch a rocket into an inclined orbit. The idea was to use this simple P-controller:

set inclinationSetpoint to 55.

lock directionSetpoint to MOD(90 - inclinationSetpoint, 360).
lock currentDirection to MOD(90 - SHIP:OBT:INCLINATION, 360).
lock directionError to currentDirection - directionSetpoint.

set Kp to 1.

lock directionCorrection to Kp*directionError.

Using the result like this:

lock STEERING to heading(directionSetpoint - directionCorrection, pitch).

I do however fail at reaching the set inclination (regardless of which inclination has been chosen) within the ascent phase. Larger desired inclinations lead to larger errors. I'm fairly certain I know why it doesn't work: While the orbit's inclination approaches the target inclination, the error and therefor the correction term shrink until the correction doesn't matter anymore. My question is simply whether I did something wrong in terms of my understanding of P-control and whether there is an easy fix.

Link to comment
Share on other sites

How do I turn off the nametag feature?

Also, which mod can I use KSPAPI from since the one for this isn't updated?

1. Delete the corresponding MM config in kos folder

2. You can download it separately or use IR for example

Link to comment
Share on other sites

Just checking...but the still isn't a way to set an rt target with kOS yet is there? I looked through the last 15 or 20 pages. Not a big deal, I did manage to get it to pop up the target selection guide at least.

Link to comment
Share on other sites

How does this interact with comsat? I'd like to be able to tell my satellites to do something while out of LOS, but only by telling them ahead of time.

Edit: Er, remotetech.

Edited by Requia
Link to comment
Share on other sites

Question: how can I get how fast my vessel is currently rotating? As in, if I'm out in space and the vessel is spinning on its centreline, is there a variable I can call that will tell me what my speed of rotation is?

How does this interact with comsat? I'd like to be able to tell my satellites to do something while out of LOS, but only by telling them ahead of time.

Edit: Er, remotetech.

Yes, it works with RemoteTech. I think there's an option in the config you have to set though (but that might just be in older versions).

Link to comment
Share on other sites

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