Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


erendrake

Recommended Posts

59 minutes ago, MrabEzreb said:

(I use remote tech) If I have crew on the vessel, giving the vessel local control, kOS tells me I have no signal, and I can't do anything! Why is this happening!

kOS+RT requires a probe core (and a connection?) to do anything. Bear in mind the kOS CPU is a computer that tells the probe core what to do, it isn't able to order around (or be ordered around by) Kerbals.

In reply to stargateat77:

Can't get the referencing to work on my phone, but is it possible you ran out of electric charge? That would cause the CPU to die, then reboot on power being restored. This would be unusual during a launch, but not impossible.

@stargateat77

Link to comment
Share on other sites

2 minutes ago, MrabEzreb said:

so I need a probe core no matter what, and I must have a connection even if there are kerbals on board?

My first guess is that you're missing the part needed for kOS to run:

Quote

Make the vessel contain any unmanned command core, a few hundred units of battery power, a means of recharging the battery such as a solar panel array, and the “Comptronix CX-4181 Scriptable Control System”. (From this point onward the CX-4181 Scriptable Control System part will be referred to by the acronym “SCS”.) The SCS part is located in the parts bin under the “Control” tab (the same place where RCS thrusters and Torque Wheels are found.)

I don't play with kOS in stock, so I don't know if you need that part on your rocket every time you want to use kOS.  In RSS/RO, every command pod and probe core has a kOS module installed, so I never need to add this part.

Link to comment
Share on other sites

Just now, Nittany Tiger said:

My first guess is that you're missing the part needed for kOS to run:

I don't play with kOS in stock, so I don't know if you need that part on your rocket every time you want to use kOS.  In RSS/RO, every command pod and probe core has a kOS module installed, so I never need to add this part.

I have a kOS CPU yes, but I never realized I needed a probe core even if there are kerbals on board

Link to comment
Share on other sites

Hmm.  That's interesting.  It doesn't mention you need that for kOS with Remote Tech.

Quote

If you launch a manned craft while using RemoteTech, you are still able to input commands from the terminal even if you do not have a connection to the KSC. The archive will still be inaccessible without a connection to the KSC. Under the current implementation, there is no delay when accessing the archive with a local terminal. This implementation may change in the future to account for delays in reading and writing data over the connection.

I guess it depends on if you're running from archive or not.  I dunno.  I haven't played with kOS with Remote Tech either.

Quote

how do i find/calc the lift force of wings in an aircraft?

Sounds like a fluid dynamics problem, or maybe you can pull that from KSP's aerodynamics model.  I'm sure it calculates lift, but I wouldn't know what model it uses or if you can get those values.

Point is, a direct answer to your question would involve a discussion of things I'm not familiar with, which is the aerodynamics of a wing surface.  I'm sure you can make some assumptions, go on Wikipedia, and if you're clever enough, figure out how to find that in KSP.

Edited by Nittany Tiger
Link to comment
Share on other sites

1 hour ago, MrabEzreb said:

so I need a probe core no matter what, and I must have a connection even if there are kerbals on board?

I don't use remote tech, but this seems to come up a lot: you need either a probe core or a part modded to contain the probe core module (e.g. combining the kOS CPU and probe core into one part).

I don't think you need the connection unless trying to access the archive, or to enter commands without local control. I don't use remote tech and may be wrong.

Link to comment
Share on other sites

23 hours ago, MrabEzreb said:

so I need a probe core no matter what, and I must have a connection even if there are kerbals on board?

The KOS cpu tells the core what to do, otherwise the core is a dumb thing.

 

If you have a radio link (that upper left flag is green) you can control the core directly from mission control.

if you don't have a link (Red Flag = out of range) you have no control.

 BUT you can control it autonomously (link or no link) with a program running on a KOS cpu which you install on the craft.

 

If you're in radio range and have no link, check to see if your aerials are enabled, or you're in the cone angle of transmission/reception.

The cone angle is described in the objects extra information window (VAB) - Right click on object and scroll through info.

 

Edited by ColKlonk2
Link to comment
Share on other sites

9 hours ago, danielboro said:

@Nittany Tiger yes

edited my post to indicate it

I think you're not getting a bug, but possibly something that's supposed to happen.

From what I gather, this is how kOS works with RT:

  • No connection - no crew: Can't use terminal.  Scripts that were running prior to comms loss keep running.  Command lag.
  • No connection - crewed: No access to archive (volume 0).  Unsure of command lag.
  • Connection - no crew: Full access.  Command lag.
  • Connection - crewed: Full access.  Unsure of command lag.
Quote

can i get deflectionLiftCoeff value of MODULE ModuleLiftingSurface using KOS?

I dunno.

I assume you're trying to get your lift from this equation.

L={\tfrac  12}\rho v^{2}SC_{L}

 

Edited by Nittany Tiger
Link to comment
Share on other sites

5 hours ago, Nittany Tiger said:

No connection - no crew: Can't use terminal.  Scripts that were running prior to comms loss keep running.  Command lag.

this is the bug part

it works like this 

  • No connection - no crew: Can't use terminal.  Scripts that were running prior to comms loss STOP running.  Command lag.
Link to comment
Share on other sites

5 minutes ago, danielboro said:

this is the bug part

it works like this 

  • No connection - no crew: Can't use terminal.  Scripts that were running prior to comms loss STOP running.  Command lag.

Do you have those script set to run trough autoboot ? If not then it is not bug. If you have them set to autorun as soon as you have vessel inside physic range it should run, although you can only read stuff from terminal, not being able to set anything.

If you have those in autorun and script is not executed then it is a bug.

Link to comment
Share on other sites

i have a scrip running, then if i turn off the antenna it will stop steering

if i turn on the antenna it will start steering 

this problem was mention in this tread after the update to 1.03/1.2.2

but i didnt see any solution of work around posted

all my scrips start running using autoboot

edit: i just run on pages 186(pre 1.02) to page 195 and didnt find a post abut this lost steering wen not connected
i do remember reading it ?!

 

Edited by danielboro
Link to comment
Share on other sites

1 hour ago, danielboro said:

i have a scrip running, then if i turn off the antenna it will stop steering

if i turn on the antenna it will start steering 

this problem was mention in this tread after the update to 1.03/1.2.2

but i didnt see any solution of work around posted

all my scrips start running using autoboot

edit: i just run on pages 186(pre 1.02) to page 195 and didnt find a post abut this lost steering wen not connected
i do remember reading it ?!

 

I remember reading something similar, but it wasn't about Remote Tech.

With KSP's CommNet and the difficulty option that disables all control if there is no connection aactive, KSP won't let kOS control a vessel if there is no connection. That wasn't meant to happen (KSP was meant to allow autopilot mods to control vessels even when there is no signal) but appears to be a KSP bug/oversight. As to Remote Tech, I would've thought it would be completely independent of the CommNet behaviour. I don't remember hearing of a similar issue.

Link to comment
Share on other sites

On 3/2/2017 at 11:36 AM, MrabEzreb said:

I have a kOS CPU yes, but I never realized I needed a probe core even if there are kerbals on board

Did something change to make this the case?  I swear I've used kOS on manned capsules with no robotic probe core (just a "probe core" made of meat).  I realize this makes no sense (is the Kerbal being commanded by a chip in its head that kOS is talking to?) but it had always been how it worked, as far as I remembered.


 

 

Edited by Steven Mading
Link to comment
Share on other sites

@Steven Mading you culd have used an MM that give a KOS CPU to all command parts (i use it instead of adding more parts)

@ElWanderer i have CommNet off (RT auto off it on install) do you know of a way to solve this (kos losing control wen no connection)?

@Nittany Tiger i was more thinking of doing sum( deflectionLiftCoeff )/ship:mass but using that EQ culd be better (if i can get deflectionLiftCoeff )

so far i tried

set t to ship:MODULESNAMED("ModuleLiftingSurface").
set i to #.
print t.
print t:part.
print "filds "+t:allfields.
print "event "+t:allevents.
print "action "+t:action.
print t:part:modules.
print t:part:modules:deflectionLiftCoeff.

at best i get noting

Edited by danielboro
Link to comment
Share on other sites

5 hours ago, Steven Mading said:

Did something change to make this the case?  I swear I've used kOS on manned capsules with no robotic probe core (just a "probe core" made of meat).  I realize this makes no sense (is the Kerbal being commanded by a chip in its head that kOS is talking to?) but it had always been how it worked, as far as I remembered.

Rereading old threads, it seems to be the case that this is required for Remote Tech+kOS, because RemoteTech only allows remote control of those parts with a certain control module (that RT adds to most probe cores). I guess stock+kOS probably doesn't have this requirement.

https://www.reddit.com/r/Kos/comments/5q1yuj/kos_no_signal_when_remote_tech_signal_mode_is/

https://github.com/KSP-KOS/KOS/issues/1538

Edited by ElWanderer
Added links
Link to comment
Share on other sites

Man.. this can be Frustrating to no end...

So to maybe help with this staging/no-control thing in KOS.. which incidentally has nothing to do with KOS (as I've found out :))

After reading some other posts wrt Procedural Parts/Fairings, I've have a workable solution, albeit a little extra weight onto thine rocket.

Here's  the Picture

iNGkUwI.jpg

Here's the code (the UPPER CASE COMMENTS AT THE SHIP_ALT > 500 SECTION)

//============================================================================
//								STAGE-1 FLIGHT
//============================================================================
Function Stage1
{
Local b_Busy1 is TRUE.
Local mThrust1 is 0.
Local NewThrust1 is 0.

	Screen_Stage1().
	UNTIL b_Busy1 = FALSE
	{
		Stg123_APOTime().						// Aposapsis average times and alarms.
		Stg12_DeterminePitch().					// Crude pitch control method.
		Stg12_PitchAngleControl().				// Finer pitch control.
		Set NewThrust1 to Stg1_Eng1:THRUST.		// Keep track of engine thrust.
		If mThrust1 > NewThrust1				// Fuel runs out when previous thrust
		{										// is greater than current thrust.
			IF Ship_Alt > 500					// Delay to prevent false staging.
			{
				Stg2_Eng:activate.				// ACTIVATE ENGINE PRIOR TO STAGING
				Lock THROTTLE to 1.				// MAX THROTTLE TO KEEP ENGINE ON.
				Stage.							// NOW STAGE !! 
				Set b_Busy1 to FALSE.			// FLAG TO EXIT FUNCTION TO NEXT STAGE.
			}
		}
		ELSE
		{
			Set mThrust1 to NewThrust1/2.
			Print Ship_Alt AT (22,4).
			Print ShipPitch AT (22,6).
			Print ALT:APOAPSIS AT (22,8).
			Print ApoT_AVG AT (22,10).
			Print ShipHeading AT (22,13).
		}
	}
}

Le Video of that stuff..

This is of course just an adjusted Stage-1 and Stage-2 of a working Ascent profile. Adjusted to the new KSP = headaches.

But that leetle thingy on top is going to Phobos all on it's own :o

 

Edited by ColKlonk2
Link to comment
Share on other sites

  • 2 weeks later...
4 hours ago, Nittany Tiger said:

Dunno if this has been asked before, but is Kerboscript compatible with an IDE?  It would make debugging scripts a lot easier if I could run this in an IDE.

There is no full IDE compatible with kOS, at not least one that I'm aware of. However there is some tools for various editors that help with keywords highlights and such: https://github.com/KSP-KOS/EditorTools

It does not give you list of available object properties when you write "." after object name like modern IDE do, but above are some help at least.

Link to comment
Share on other sites

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