Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


Recommended Posts

1 hour ago, pellinor said:

You can set a boot file which auto-starts on load. If there is a file boot.ks, you can set it as boot file in the editor (the kos parts have a tweakable for this).

Can you make that work on a craft that is already flying but will loose contact in the future?

Link to post
Share on other sites
28 minutes ago, Warp11 said:

Can you make that work on a craft that is already flying but will loose contact in the future?

copy the file onto the core and then set BOOTFILENAME to the name of this file. It will run next time the craft loads (or the processor is restarted any other way)

Link to post
Share on other sites

hi,

I am very new to kOS... I have some rather simple questions:

Is it possible to get information about an engine that is not active? I would lilke to get the maximum thrust of an engine that is not active. I tried putting them into a list and iterating through them but for an inactive engine I always get 0. I would like to set a specific TWR in my launch BEFORE actually firing the engine... not mission critical but nice to have in my opinion.

 

Second is it possible to make a script that will wait for a user input of some kind? For example one that will wait for you to start the countdown before launch... or specify the TWR that you want for your launch (yes... I am still mostly trying to get things into space... but that in a fancy way :P).

Sorry if this has been asked before... a pointer would probably be enough for me... Thanks in advance!

Link to post
Share on other sites
20 hours ago, Steven Mading said:

Looking at your code the only thing I can think of is that maybe you left the thrust limiter on for the engine?  I can't see any explanation for the behaviour inside the script.

I did not touch a trust limiter for engines, seem kOS trying to turn itself limits the Trust limiter automatically.

Link to post
Share on other sites

Here's the ISS core been put into orbit at an exact Inclination and LAN, with an accuracy of 0.001 degrees (+- 120m at 400Km)

It's recorded at 1x FPS, and compressed to 3000x for playback... so it moves fast (don't blink )

https://www.dropbox.com/s/ynpara6c9av2ebq/ISS_Core.mp4?dl=0 (64MB = 03:45)

The core part launches from South America, goes north and performs all it maneuvers at the Poles and Equator.

The code can easily be adjusted for lower inclinations - I just used an inclination of 90, just to be difficult

The idea was to align the Apsides on the poles, but they're slightly off.. this is not a problem for the upcoming ships that will work on the 'target' apsides after reaching 'polar' parking orbit. The code can be further refined to make allowances for these offsets, but I don't want to waste too much time on KSP - have other things to do. Maybe much later... when I'm bored.

I've had to redo the code for Stage-4, and have placed each stage code in modular format.

Launch to first circular orbit involves Stages 1-3.

Stage-4 the Core module boosts to 400km and aligns at the same time. The following docking modules will raise their orbits to 220km parking orbit and align.

Stage-5 (nearly finished), The core module 'sits tight', while the joining modules will execute Rendezvous routes.

Stage-6 (the plan.. is to make a plan), The core module activates to prograde, and the joining module will be within 5 km, travel to 200m off the target docking port, align, then approach for docking.

I'll post the code once I've dolly'ed it up..

 

 

 

 

 

Edited by ColKlonk
have no idea
Link to post
Share on other sites

Added notes:

Besides RCS thrusters, the ship has all those 'generic' thrusters dotted around on the frame.

Each thruster has an Action Group assigned to it, enabling better control of the thrust forces - We're shunting 50 tons of metal around !!.

One doesn't see it much in the above video but these thrusters are switching on/off to keep the ship aligned on prograde, when doing LAN/INC alignments.

It's a primitive version of the Throttle Controlled Avionic mod (IIRC), as it has to perform under KOS.. but it works sufficiently well for this purpose.

 

For the KOS Devs... I'm not sure whether it's KOS or Action Groups, but sometimes some of the engines do not switch off.

I've implemented different switching off sequences (ie: Throttle=1, AG(xx) engine off, Throttle=0  OR , Throttle=0, AG(xx) engine off ).

It happens intermittently... so it's a bugger to track ? I always put a Wait 0.001 delay after every Action Group

I'll try some direct switching from KOS next, instead of using AGs.

Link to post
Share on other sites
16 hours ago, Tortoise said:

FYI, the modulemanager that comes with this release partially breaks some of my other mods. (2.6.20)

I think the current release (2.6.18) is better suited.

Version 2.6.20 is the current release for KSP 1.0.5.  For KSP 1.1, MM has been updated to 2.6.21.  What kind of things break for your other mods?  Do they package an older version of MM which might conflict?

Link to post
Share on other sites

 

On 4/3/2016 at 8:09 AM, surge said:

Understood. Although after combing through your buglist several times, there seems to be someone in your midst that doesn't understand how rcs works, and keeps committing changes without updating their version first - you seem to have alot of problems with lost code. Or is that just a natural thing with git? I don't know, I've always used non-distributed rcs stuff like cvs, svn, etc. Seems pretty annoying. Your choice, I guess...

I'm happily using 0.18.1 for now though, so no worries until KSP 1.1. And frankly you made the old releases as they were. Warts and all. I was simply trying to suggest that in future you put the correct version checking info in. I advise against trying to change previous versions - it can cause alot of problems.

I'm not sure I understand what you mean by lost code.  Git uses a distributed source history system and all contributions can be added from any point in the history, though they almost always originate at the "current" point in the develop branch.  There is no system for locking out access to files if a user is modifying it.  If you are referring to the commits that merge "develop" back into the pull request branch, that is necessary because we are not forced to follow an order when merging and what once was the "current" point in the develop branch may not "current" when accepted.  I'd kindly appreciate it if you didn't imply we don't know what we're doing in the future though, we have put a lot of time and effort into this mod.

On 4/7/2016 at 10:54 AM, Wuwuk said:

Why engines sometimes do not work at full capacity, while the throttle stick to the maximum?

This occurs during the rotation .
This is a bug?

On 4/9/2016 at 9:19 AM, Wuwuk said:
Why engines are beginning to run rough at full throttle while turning like this: LOCK STEERING TO HEADING(0,90) + R(0,-20,0)?
On 4/11/2016 at 8:41 AM, Wuwuk said:

I did not touch a trust limiter for engines, seem kOS trying to turn itself limits the Trust limiter automatically.

The only time that kOS touches the thrust limiter is if it is adjusted using the engine's "THRUSTLIMIT" suffix, or is the underlying field is adjusted.  I noticed in your screenshot that there are a number of other mods installed.  We have had reports in the past of other mods adjusting the thrust limiter (if I recall correctly, it was a mod that adjusted the limiters based on center of mass, or maybe based on TWR).  Can you replicated it without the additional mods?

Link to post
Share on other sites

Pre-release KSP1.1 compatible development release

for KSP v1.1.0 Downloads this release

This should be functionally identical to v0.19.3. The only changes made were those required to compile and run with KSP v1.1.

This release will only be available from Github and will not be listed on CKAN.
Link: https://github.com/KSP-KOS/KOS/releases/tag/v0.20.0-pre-1

If you have access to the KSP pre-release, please test as many of your existing scripts with this release as possible. Just like Squad is using the pre-release to track down some outstanding bugs, we need your help in tracking down hard to find things that may have broken with the move to 1.1.

PLEASE SUBMIT AN ISSUE FOR ANY BUGS YOU FIND. Add the prefix [KSP1.1] in the bug title.

For the time being, our focus is on things that broke specifically with KSP 1.1. If you have old bugs, or if you want to see a new feature from 1.1 used, please don't tag it with the above prefix.

Link to post
Share on other sites

Good afternoon rocket jockeys!

I wanted to point out and ask for some help on the subject of iterating through strings. The currently described method on the github wiki could use some updating as it no longer works as far as i can tell. when following the steps exactly in the wiki. 
https://ksp-kos.github.io/KOS_DOC/structures/misc/string.html

SET str TO "abcde".

FOR c IN str {
  PRINT c.
}

the following error is thrown.
GET suffix ITERATOR not found on object [--string contents--] .

Raelon.

Edited by RaelonMasters
Link to post
Share on other sites

Someone asked for my rocket ascent profile renderer and since my last post didn't completely explain how to go about getting the data you need, I whipped up a quick logging script and cleaned up the path renderer code. You can get them on my gist:

logger.ks
path.ks

So you run logger.ks from before you launch (starts logging when your velocity goes past 1) up until you exit the program with Ctrl+C. Then you just revert to launch and run path.ks.

Logger contains examples of updating the phase variable, which when read back in path.ks tells it to change the color of the path so you can see exactly where along the way you dropped boosters or started orbital burn, etc.

Not tested, but this could be applied just the same to a rover moving along the ground

Edited by Gaiiden
Link to post
Share on other sites
9 hours ago, Gaiiden said:

Someone asked for my rocket ascent profile renderer and since my last post didn't completely explain how to go about getting the data you need, I whipped up a quick logging script and cleaned up the path renderer code. You can get them on my gist:

logger.ks
path.ks

Thanks very much, Gaiiden!  I’m already excited to use these (and variants thereon) as I work on my atmospheric autopilot script.  And seeing how to use a lexicon to create one’s own data structures was an eye-opening lesson for me.

Link to post
Share on other sites

Is there a way to directly read roll rate? The angularvelocity funtion only works for pitch and yaw. Of course you could measure it indirectly (dR/dt) but that always has a delay on it. Thank you!

Link to post
Share on other sites
30 minutes ago, Warp11 said:

Is there a way to directly read roll rate? The angularvelocity funtion only works for pitch and yaw.

Are you sure about that? Vdot(AngularVelocity, Facing:ForeVector) should return the roll rate. More general, Vdot(AngularVelocity, axis) is the turn rate around an arbitrary axis.

Link to post
Share on other sites
7 minutes ago, pellinor said:

Are you sure about that? Vdot(AngularVelocity, Facing:ForeVector) should return the roll rate. More general, Vdot(AngularVelocity, axis) is the turn rate around an arbitrary axis.

Ah, great! Thats exactly the kind of answer I needed. I just started learning about all the powers of vector products when writing the current script, thank you.

Link to post
Share on other sites

Just a pre-emptive notice before anyone complains:  The latest KSP 1.1 build that appeared on Steam today, build 1209, broke the kOS prerelease DLL that hvacengi posted about up above.  We know what's wrong and it's easy to fix, but we only just became aware of it this evening when I fired up Steam and therefore got the new update on my computer and tried using it.

 

 

Link to post
Share on other sites

Hi folks,

I am trying my first steps in kOS and I am trying to do something like in this gravity turn tutorial here.

So to set my throttle not to a certain % of thrust but a certain TWR, I think I need my maxTWR(t), which equals THROTTLE=1 and the TWR(t)=1.5 for which I have to calculate the actual THROTTLE value. For doing this, I am wondering about the definitions about MASS and WETMASS. Is MASS the actual mass of my rocket at a given time? If so, i assume, WETMASS is the total mass before igniting the candle?

Link to post
Share on other sites
10 hours ago, Horman said:

Hi folks,

I am trying my first steps in kOS and I am trying to do something like in this gravity turn tutorial here.

So to set my throttle not to a certain % of thrust but a certain TWR, I think I need my maxTWR(t), which equals THROTTLE=1 and the TWR(t)=1.5 for which I have to calculate the actual THROTTLE value. For doing this, I am wondering about the definitions about MASS and WETMASS. Is MASS the actual mass of my rocket at a given time? If so, i assume, WETMASS is the total mass before igniting the candle?

Mass is the current mass of your ship, wetmass the mass when every tank is fully loaded and drymass when all tanks are empty. :)

Link to post
Share on other sites
1 hour ago, Kartoffelkuchen said:

Mass is the current mass of your ship, wetmass the mass when every tank is fully loaded and drymass when all tanks are empty. :)

Thx Kartoffelkuchen!

Another maybe dumb question: How can I calculate my possible TWR before igniting the rocket? I tried using MAXTHRUST, but that value is 0 before launch so that doesen't worked for me.

Link to post
Share on other sites

Hi everybody,

I'm trying to move an Infernal Robotics servo using kOS using this code and I get an error (Object reference not set to instance of an object).

SET ABC TO ADDONS:IR:GROUPS[0]:SERVOS[0].
ABC:MOVETO(10,1).

The error message points to the speedMult as the problem.

KSP Version 1.1.0.1215(x64)

kOS Version built from Develop branch on GitHub.

 

Many Thanks.

 

Link to post
Share on other sites
10 hours ago, Horman said:

Thx Kartoffelkuchen!

Another maybe dumb question: How can I calculate my possible TWR before igniting the rocket? I tried using MAXTHRUST, but that value is 0 before launch so that doesen't worked for me.

That's a problem that needs working on.  Right now everything is geared toward giving live information about the current state, not the future state.  I think we need additional suffixes for the max thrust hypothetically if the engine was on.

Link to post
Share on other sites
1 hour ago, Steven Mading said:

That's a problem that needs working on.  Right now everything is geared toward giving live information about the current state, not the future state.  I think we need additional suffixes for the max thrust hypothetically if the engine was on.

If I understand this right, I should try starting setting my THROTTLE TO MAXTHRUST and as soon as I have used this, I should be able to use a calculated lower value?

BTW: Is there a way to "unlock" a STEERING? For example, at launch I give my rocket a slight push for the gravity turn, but from that moment on, I want it to let the gravity do the rest of the turn?!

Edited by Horman
Link to post
Share on other sites
Guest
This topic is now closed to further replies.
×
×
  • Create New...