KSP-KOS / KOS

Fully programmable autopilot mod for KSP. Originally By Nivekk
Other
692 stars 229 forks source link

locked steering doesn't work with no signal #1639

Closed QuakeIV closed 7 years ago

QuakeIV commented 8 years ago

For reference I am using the latest RemoteTech build as of this post. Scripts seem to work except when you lose signal. At this point attitude control fails.

I have a test pod I am trying to safely land without a signal. I have tried locking steering to prograde immediately, it deactivates after signal is lost. I have also tried instructing the script to only lock steering right before contact with the atmosphere (at 75km altitude, to control heat shield angling). This also does nothing. The system seems to otherwise work, it will stage parachutes and such.

Dunbaratu commented 8 years ago

With this sort of problem from RT integration, it's always good to perform the following test along with it, and report what happens with it:

Once the script loses the ability to control the vessel, does forcing the game to save and reload the scene (i.e. go to the space center, then use the tracking center to go back to flying the vessel) magically fix the problem?

Granted, because you're trying to test the craft's ability to steer without a signal, the only real way you can test this is to have the vessel's boot script attempt to do a lock steering, because the boot script is the only thing that's going to run when you're out of contact and thus don't have the ability to issue a human-caused command at the terminal.

This test often helps narrow down where to look for the problem. If reloading the scene magically fixes the problem, then it's usually kOS's state-keeping code missing something. If it doesn't, then it's usually a more complex problem.

hvacengi commented 8 years ago

I will have to test with the kOS release version, but I have been testing the development branch with RemoteTech's pre-release and have had no such issue. I was able to launch my geosynchronous network without complications. But again, that was a development copy, and I've made changes to how steering is handled.

When you say "doesn't work" what exactly do you mean? Do the controls appear to move, but no ship control? Is there an error thrown if you look at the [Alt]+[F2] debug log? Does the ship just kind of spin with whatever rotation it had initially?

Is the kOS config setting for Remote Tech enabled?

Please also post you log file (output_log.txt from the KSP_Data or KSP_x64_Data folder).

QuakeIV commented 8 years ago

Update, I did the requested tests. The remote-tech integration is set to 1 in the config file. I assume that means its turned on.

The boot script did nothing, even when in communication with the KSC. I put print statements on either side of the lock steering command and they were showing up properly so I'm pretty sure the commands are getting executed. This is while it was in communication with the KSC. When I switched to the space center and back to the vehicle outside of comm range, I couldn't open the terminal because there was 'no connection to send the command on'. I have no idea if the script ran at that point.

The controls do not appear to be moving in any of these cases, if you mean the little pointer thingies in the bottom left hand side of the screen that indicate attitude control. They do move when I issue commands directly.

There were no particularly informative debug log entries (from the alt-f2 screen).

Log file attached.

output_log.txt

hvacengi commented 8 years ago

The boot script did nothing, even when in communication with the KSC. I put print statements on either side of the lock steering command and they were showing up properly so I'm pretty sure the commands are getting executed.

Could you please post the craft file? This sounds very similar to an issue that pops up when there is no RT "Signal Processing Unit" on the vessel. Do you have a probe core installed?

QuakeIV commented 8 years ago

Here is the craft file.

Autopilot Test.zip

There is a probe core installed.

hvacengi commented 8 years ago

I finally was able to take a little time to install KW Rocketry and look at your craft. The first thing I noticed is that your solid booster is the root part. Which makes me wonder if you're actually running into a disassociation issue (detailed in #1492). I can't actually make the ship do what you're describing (even by deleting the dipole antenna). So perhaps it has already been fixed. Or maybe I just can't replicate it. Try changing the root part to be the LF-OX tank and see it things improve.

On a secondary note, if you're attempting to do things with the archive volume selected, you may run in to issues since we have an issue handling out of range volumes: #1363

QuakeIV commented 8 years ago

Just got the chance to test. I changed the core part to the reaction wheel, it still doesn't seem to work. Notably, the kOS terminal was complaining that the STAGE command doesn't work on an inactive vessel. This occurred after signal was lost while it was descending into the atmosphere, it was trying to deploy nonexistant chutes, there was no attitude control) I had forgotten to mention but I think that was happening beforehand as well. I would have grabbed a screenshot, but it smacked into the ground before I thought to do so.

If its working on your end then I suspect it is fixed somehow or another. Perhaps close for now, pending the next kOS release?

hvacengi commented 8 years ago

Can you post a log with the stage command throwing the error you mentioned? That's a new development and may lead us down the right path.

GER-Space commented 8 years ago

I started a new Career yesterday with [1.0.0-pre1]

I got the same behavior a few times. --> but only after I reverted back to the launchpad.

When I started a "fresh" rocket from the VAB, everything was fine and the desired Orbit was reached.

Settings when it is working:

kOS config setting for Remote Tech : TRUE RT: Thottle to 0.0 on no Connection: FALSE

I'll test some launches later today, to see If there is a problem with reverting the rocket and RT.

hvacengi commented 8 years ago

I got the same behavior a few times.

Which behavior did you get, the lack of steering control or the inability to stage?

When testing later today, please be sure to include a (full) log file so that I can see if there are any helpful messages.

I'm working on merging a pull request to update kOS's reference the the remote tech API, but none of those changes should have an effect on the use of steering. It mostly deals with antennae targeting and ground stations. But I'll probably want to test again with that merged just to make sure it didn't somehow randomly fix the issue.

GER-Space commented 8 years ago

The behavior for me is, that "lock steering to ... " stopped working, but throttle control within the running script works. The lock steering is to my nextnode. Then I warp outside the range and the steering manager stops adjusting.

BUT: When I set CONFIG:RT to true AND reload the ship by either revert to launch or leave to KSC and return. Then the steering manager continues to work.

my logfile: KSP-log.txt

Dunbaratu commented 8 years ago

KSP-Log.txt is almost entirely useless to modders. It's just SQUAD's own log for their own stuff. The log we need is the one that Unity itself spits out, which goes by different names on different OS's for some infuriating reason you'd have to ask Unity about. If it's Windows, it's called "output_log.txt" and it's under the KSP_Data or KSP_x64_Data, depending on which version of the game you are running. I don't remember where Unity puts it on other platforms but I know it's called "Player.log" instead of "outpug_log.txt".

As to the actual problem, I can confirm that I have had the problem too, but didn't realize it was connected to running RT. And yes, a reload of the scene does usually make it start working again. Also, using time warp seems to invoke the problem, but that could just be because it lost connection and I didn't notice.

Here's something really weird. Once the throttle kicks on, the steering starts working again too aand it rotates to the right orientation. (Almost as if the only form of rotational authority that exists is the engine gimbals, but that's not true and the ship does have torque wheels.)

So when I have the problem, its like this:

Script is approaching a maneuver node. It executes the lock steering to yadda_yadda. 60 seconds before the time the burn is going to start. But the ship refuses to move and the control indicators in the lower-left of the screen are still centered. Then it hits the point where the script goes lock throttle to 1. and THEN the ship starts rotating as well as thrusting, and settles in on the right direction after having burned the wrong way for a bit at first. Something about the throttle command "kicked" kOS into waking up the steering that had already been locked earlier.

GER-Space commented 8 years ago

yes I do also warp to the buring point after I locked the steering.

also:

print config:rt. true print addons:rt:available. true

set config:rt to false. print addons:rt:available. false ^^^^ is that right?

output_log.txt

hvacengi commented 8 years ago

I wouldn't go so far as to say that KSP.log is useless. I frequently use it as my first debugging step since I don't need to replace all of the \r\n\r\n, \r\n\n instances to make it readable, and it doesn't have all of the references to the same unity file over and over again.

On topic: So you're all saying that steering could be working one minute, then you unlock the steering, then time passes (either it's sitting there waiting or it's warping) then it fails to lock steering on the next command? And some times locking throttle subsequently fixes it? Does it ever stop steering properly while steering is still locked?

@GER-Space you make multiple references to the kOS RemoteTech config setting. Are you toggling that during operation somehow, or are you just meaning that for the sake of ensuring that the setting stays set to true?

hvacengi commented 8 years ago

set config:rt to false. print addons:rt:available. false ^^^^ is that right?

Yes, that's correct. The code that determines if RT is available checks the config setting at the same time.

GER-Space commented 8 years ago

The steering stops working (after the connection loss) only when the config:rt setting is set to false during the initialization of the KOS computer. setting config:rt to true without a scene-switch has no effect.

hvacengi commented 8 years ago

Turning off config:rt will break RemoteTech integration. kOS is unable to steer with RemoteTech installed and the flag set to false.

The event handlers that control steering are only initialized when the vessel loads. So if RemoteTech integration is disabled at that point, steering will not work without "local control" on the vessel.

hvacengi commented 8 years ago

There is a chance that this long standing issue may have gotten fixed by #1809, I'm not going to close this issue yet though, just because I've though I had this bug fixed multiple times already and want to make sure that some every one tests this thoroughly in the next release.

@GER-Space part of my fix above is a brute force method of continually checking to see if RT is enabled for the vessel and refreshing the RT control once every 25 ticks. Your above use case (while not exactly what I'd prefer) of toggling the RT config setting may now work as well.

zegkljan commented 7 years ago

I just experienced similar bug - I can't lock throttle (maybe steering too but I was aware of throttle). The moment the vessel loses connection to KSC (I'm doing some auto launching), the throttle control just stops working. Even if I manually interrupt the program and lock the throttle from the terminal, nothing happens.

I'm not sure if it should create a new issue for it but it sounds almost identical to this one, except it's throttle.

I can post craft files, logs, etc. if needed (and if I find some time to create a minimal exmaple).

For the record: KSP 1.2.2.1622 (LinuxPlayer), RemoteTech 1.8.6, kOS 1.0.3 and a load of other mods but none of them interfering with communication.

hvacengi commented 7 years ago

@zegkljan After more recent releases, have you continued to have these issues? Also, does your vessel have a probe core installed? If there is no signal processing unit (probe core) on the vessel, that is probably the issue and matches #2107. Otherwise it may be a continuation of the original issue.

I'm prepared to close this issue for the originally reported problem due to the complete overhaul of how KSP manages the event subscription and because the config values used to select RemoteTech are non existent anymore. I'll leave it open for the time being to see if zegkljan can confirm that their issues are fixed.

zegkljan commented 7 years ago

@hvacengi Just tested it and the throttle works as expected (I have probe core). What is weird is that I still have the same setup, i.e. kOS 1.0.3, RT 1.8.6., etc. Maybe my original problem was actually me doing something wrong but I don't remember that well (effectively didn't start up KSP since then as I was quite busy).

Long story short, it works for me. Sorry for possible false alarm.

hvacengi commented 7 years ago

No worries. I just didn't want to close the issue if it wasn't addressed.