Steven Mading

[1.8.1] kOS v1.2.1.0 : kOS Scriptable Autopilot System

Recommended Posts


Sounds like your code is completing without going through the bit you want it to do.  A couple of common issues I've messed myself up with a few times is to define the function but not actually call it, or have a bit of script to do a task but forget to put it in a loop so it just runs once and then stops.

Best thing I can advise to try and debug your problem is to put in plenty of print statements to try and work out where it's going in the code.

In general I have a common boot script that copies various other files to the KOS module and runs them, so that I don't have to modify the boot script and revert back to VAB to reload it, which sounds like what you're trying to do.

Share this post


Link to post
Share on other sites

Hi, i'm a fanatic to this game and specially to this mod, I would like this mod a bit more realistic regarding as how some telemetry is handled. Currently, you can access all information without restriction, but for instance, in real life, is impossible to know exactly where the position is or speed has, or some other telemetry reading without a direct communication to a ground station or GPS connection. Also the device must be very precise at longer distances. I would like the mod take into account this rule as option. Other realism options like precision of this reading depending of the epoch could be added, but i think it's a bit more complex.

Is it a right place to make this request?

 

Share this post


Link to post
Share on other sites
On 12/9/2019 at 8:10 AM, Albert7df said:

Hi, i'm a fanatic to this game and specially to this mod, I would like this mod a bit more realistic regarding as how some telemetry is handled. Currently, you can access all information without restriction, but for instance, in real life, is impossible to know exactly where the position is or speed has, or some other telemetry reading without a direct communication to a ground station or GPS connection. Also the device must be very precise at longer distances. I would like the mod take into account this rule as option. Other realism options like precision of this reading depending of the epoch could be added, but i think it's a bit more complex.

Is it a right place to make this request?

 

Well, noone forces you to use all the build-in accessible flight variables like altitude, airspeed etc. You are free to code your very own IMU and so on by using the data you can get from the stock in game sensor parts, would actually be quite interesting to try that.

Share this post


Link to post
Share on other sites

Are you saing to create like a wrapper around KOS in kerboscript? Many times i had think to donwload the code and make tiny modifiations to have some of this features, but the debug process is a hell, and more when it's not my code.

What IMU is?

4 minutes ago, Albert7df said:
58 minutes ago, Kartoffelkuchen said:

Well, noone forces you to use all the build-in accessible flight variables like altitude, airspeed etc. You are free to code your very own IMU and so on by using the data you can get from the stock in game sensor parts, would actually be quite interesting to try that.

Are you saing to create like a wrapper around KOS in kerboscript? Many times i had think to donwload the code and make tiny modifiations to have some of this features, but the debug process is a hell, and more when it's not my code.

What IMU is?

 

Share this post


Link to post
Share on other sites

Inertial Measurement Unit.  Basically a set of gyroscopes that can be used to measure acceleration in different directions.

https://airandspace.si.edu/collection-objects/inertial-measurement-unit-space-shuttle

kOS can access the output of science instruments you put on your vessel, so you can use the accelerometer to work out your ships acceleration.  I've done this before to estimate drag by comparing thrust, mass and acceleration, but you could use the acceleration to calculate your speed and some fancy maths to then work out your location.  

You could also use the inbuilt vector system to imitate direction radio navigation, put in some ground stations and then measure the angle between them.  Apollo also used a telescope and sextant as a backup method to update the INS, but that would be a bit trickier in KSP as you only have the planets to take bearings on rather than stars.

I personally see kOS as a higher level system and accept that other instruments/systems have already worked out my velocity and location and I'm just putting the control layer over the top, but it's a powerful system so you should be able to work out things like ship:velocity:orbit by other means.

 

Share this post


Link to post
Share on other sites
On 12/16/2019 at 4:41 AM, RizzoTheRat said:

Inertial Measurement Unit.  Basically a set of gyroscopes that can be used to measure acceleration in different directions.

https://airandspace.si.edu/collection-objects/inertial-measurement-unit-space-shuttle

kOS can access the output of science instruments you put on your vessel, so you can use the accelerometer to work out your ships acceleration.  I've done this before to estimate drag by comparing thrust, mass and acceleration, but you could use the acceleration to calculate your speed and some fancy maths to then work out your location.  

You could also use the inbuilt vector system to imitate direction radio navigation, put in some ground stations and then measure the angle between them.  Apollo also used a telescope and sextant as a backup method to update the INS, but that would be a bit trickier in KSP as you only have the planets to take bearings on rather than stars.

I personally see kOS as a higher level system and accept that other instruments/systems have already worked out my velocity and location and I'm just putting the control layer over the top, but it's a powerful system so you should be able to work out things like ship:velocity:orbit by other means.

 

The inercial system could give you acceleration and orientation of the ship (Also by some image processing of the the starts), but "following" the position and speed by integrating of those parameter is very inaccuratelly in real life, once you have the information from ground, and with no rocket propulsion also you could predict position and speed, but frecuently you need updates because the little variations of all the solar system. 

So.. i thinks for more realism a very easy patch rule could be like this: If no connetion (or not sight view) with some ground station then no position and speed are available. Also the position and speed should be given with a delay. I'm assuming the position and speed is gathered by the doopler effect on radio wave emited by the ship and  usual radars detection.  This patch is very simple to do. I'm waiting also the feature to emulate a KSC main program running on the ground and a vessel program running. I have read it's going to include in next releases. With this feature, this realism would be almost natural.

 

Edited by Albert7df
adding

Share this post


Link to post
Share on other sites

Finally flying a ship that contains two separate CPUs, one for the lifter rocket and another for the payload to be deployed. I have the naming priority setup so the probe is properly named once it is deployed, but I can't seem to access that name until the payload becomes its own ship. Is there any way a future kOS version could get at this information?

Share this post


Link to post
Share on other sites
12 hours ago, Drew Kerman said:

Finally flying a ship that contains two separate CPUs, one for the lifter rocket and another for the payload to be deployed. I have the naming priority setup so the probe is properly named once it is deployed, but I can't seem to access that name until the payload becomes its own ship. Is there any way a future kOS version could get at this information?

Have you tried to play arond with craft naming feature under command module PAW ? For each probe is possible to set specific ship name that should be preserved even after undocking. IIRC, it is stock feature and it should prevent creating random craft names after separation. It is being a while, but I think it is possible to create script in a way that use exact vessel name instead generic "SHIP".
Hope that it helps.

Share this post


Link to post
Share on other sites
3 hours ago, kcs123 said:

For each probe is possible to set specific ship name that should be preserved even after undocking. IIRC, it is stock feature and it should prevent creating random craft names after separation.

That is the naming priority that I set up. I can’t seem to reference it tho in flight

Share this post


Link to post
Share on other sites

Just a question:

How can i do the following?

Wait until surface prograde is heading 90, pitch 87, then follow pitch 3 lower than surface prograde.

 

Share this post


Link to post
Share on other sites
On 2/9/2020 at 5:50 PM, KnedlikMCPE said:

Just a question:

How can i do the following?

Wait until surface prograde is heading 90, pitch 87, then follow pitch 3 lower than surface prograde.

It'll be hard for prograde to be EXACTLY (90, 87), but heading shouldn't matter that much for 87 degrees, so I'd suggest this:

wait until vang(ship:up:vector, ship:velocity:surface) > 3.
lock steering to heading(90, 90 - vang(ship:up:vector, ship:velocity:surface) - 3).

 

Share this post


Link to post
Share on other sites
On 2/23/2020 at 5:33 PM, Kerbal007 said:

Just curious if KOS integrates with probe control room at all ?

Cheers

Yep, use this

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.