Jump to content

[1.9-1.10] Throttle Controlled Avionics


allista

Recommended Posts

Huh, I didn't know you added a 'follow the leader' thing in there. Will have to check that out.

Also, I fixed a small typo in the spreadsheet for you.

Thanks)

Yep, forgot to mention it. It is simply the 'old' Go To Target, but without end phase where target is canceled and the Stop program is engaged.

Link to comment
Share on other sites

Okay, I ran into some wierd I-don't-know-what. Honestly I don't know what happened and basically what happened is that my test drone ship lost most of itself somehow and then the game started spewing errors. Going to test on the stripped down bugtesting branchoff KSP to look into it further.

I MAY have left TCA on when I went back to KSC after moving the test drone ship off of the runway.

Here's the output log from my main save, maybe you can make sense of it, I don't know.

Output log: http://sta.sh/0whd4btqwpa

Edit: Or maybe I had simply left the craft too close to the runway, which made things wierd out, I honestly don't know. It's not reproducing in the branchoff KSP. Maybe I'll continue testing in the branchoff KSP though.

EDIT: Reproduced! Going to strip of mods further to see if any mods are responsible.

Edited by smjjames
actually post the link, durr
Link to comment
Share on other sites

Okay, output log: http://sta.sh/028w9hmydoa0 and steps that I THINK are leading to it.

Edit: Found simpler steps:

1. create a simple ship of a pod, tank, and engine (I just grabbed whatever parts), launch it.

2. go to KSC

3. Return to craft.

screenshot205_zps4ojxl2pw.png

When I tried to return to the ship, it was like this:

screenshot206_zpsj9knc6pu.png

Edited by smjjames
Link to comment
Share on other sites

Okay, output log: http://sta.sh/028w9hmydoa0 and steps that I THINK are leading to it.

1. Create some sort of basic VTOL, launch into the runway.

2. Open TCA UI, toggle it on and then off. Leave the UI up.

3. Make a quick craft in VAB (I did a one part craft consisting of the MK1 pod).

4. Launch that, and observe the spam in exception detector.

http://img.photobucket.com/albums/v214/smjjames/screenshot205_zps4ojxl2pw.png

When I tried to return to the ship, it was like this:

http://img.photobucket.com/albums/v214/smjjames/screenshot206_zpsj9knc6pu.png

I've encountered this bug, but have no idea what causes it. The error (the first exception; others are just the echo) occurs, when the ModuleCommand of the probe core (the only part visible) tries to load and requests the resource it needs (Electric Charge, I presume). Doing this it passes a null ref. I don't even know if it's linked with TCA... Can you reproduce it without TCA installed?

Link to comment
Share on other sites

I've encountered this bug, but have no idea what causes it. The error (the first exception; others are just the echo) occurs, when the ModuleCommand of the probe core (the only part visible) tries to load and requests the resource it needs (Electric Charge, I presume). Doing this it passes a null ref. I don't even know if it's linked with TCA... Can you reproduce it without TCA installed?

Going to further reduce the mods on there first though. I did a cache check on my main KSP and am copying everything in there over to the branchoff folder to make sure there isn't anything else screwed up.

I'll let you know on that.

Edit: This is strange, I decided to try it without Module Manager (the current version, 2.6.8 ) and the problem didn't happen. The only other things in gamedata are stock, exception detector, and TCA.

When I put MM back in, boom, it triggers.

Edit2: Checking it out with older versions of MM.

Edit3: Version 2.6.7 does it. 2.6.3 does it. There must be something essential that is causing a problem with MM.

Edited by smjjames
Link to comment
Share on other sites

I have found a clue, and possibly the underlying cause. Without module manager, TCA does this when I try to place an engine:

screenshot1_zpsekmtavri.png

Placing an engine as the root part also works (apparently):

screenshot2_zpspwnhwgap.png

Output log: http://sta.sh/0utg1m23pbu So, basically, Module Manager was being a 'canary in the coal mine' here, seeing that something is wrong/missing and then completely flips out.

Edit: You know, with the configs and stuff, looks like you DO need Module Manager. Not sure why it isn't included in your download. Anyways, going to revert back to 2.3.0.4 for now, which is what I've been using all this time, lol.

Edited by smjjames
Link to comment
Share on other sites

I have found a clue, and possibly the underlying cause. Without module manager, TCA does this when I try to place an engine:

http://img.photobucket.com/albums/v214/smjjames/screenshot1_zpsekmtavri.png

Placing an engine as the root part also works (apparently):

http://img.photobucket.com/albums/v214/smjjames/screenshot2_zpspwnhwgap.png

Output log: http://sta.sh/0utg1m23pbu So, basically, Module Manager was being a 'canary in the coal mine' here, seeing that something is wrong/missing and then completely flips out.

Edit: You know, with the configs and stuff, looks like you DO need Module Manager. Not sure why it isn't included in your download. Anyways, going to revert back to 2.3.0.4 for now, which is what I've been using all this time, lol.

It does indeed need MM, which is stated in the OP) Anyway, with MM, but without TCA does the problem exist?

Link to comment
Share on other sites

It does indeed need MM, which is stated in the OP) Anyway, with MM, but without TCA does the problem exist?

Nope, without TCA, the problem doesn't exist.

Edit: I decided to try something, going by the notion of it not finding some resource, I put every resource available in the stock game on the craft.

Edit2: I should note that all this has been in sandbox mode.

screenshot4_zpsijaj6yhg.png

Which achieved nothing....

screenshot5_zpszqteojqr.png

It also does the error when I try at the start of a science save.

Back to sandbox though, tried something further.

Before going to KSC and reloading craft:

screenshot7_zpstg2q9x1p.png

After:

screenshot8_zps8ciarslr.png

Edit: Currently looking at older betas to see if it's possible to pinpoint where the errors started. This is all done with just stock and exception detector.

Beta 2.3.0.6: Works fine, no errors like those above generated.

2.3.0.7: I saw someone mention it, but I didn't see a link for it.

2.3.0.8 from this post. This may actually be 2.3.0.7: No errors.

2.3.0.8 from this post: No errors.

Fresh download of 2.3.0.9: Same exceptions as reported.

Edited by smjjames
Link to comment
Share on other sites

Nope, without TCA, the problem doesn't exist.

Edit: I decided to try something, going by the notion of it not finding some resource, I put every resource available in the stock game on the craft.

Edit2: I should note that all this has been in sandbox mode.

http://img.photobucket.com/albums/v214/smjjames/screenshot4_zpsijaj6yhg.png

Which achieved nothing....

http://img.photobucket.com/albums/v214/smjjames/screenshot5_zpszqteojqr.png

It also does the error when I try at the start of a science save.

Back to sandbox though, tried something further.

Before going to KSC and reloading craft:

http://img.photobucket.com/albums/v214/smjjames/screenshot7_zpstg2q9x1p.png

After:

http://img.photobucket.com/albums/v214/smjjames/screenshot8_zps8ciarslr.png

Edit: Currently looking at older betas to see if it's possible to pinpoint where the errors started. This is all done with just stock and exception detector.

Beta 2.3.0.6: Works fine, no errors like those above generated.

2.3.0.7: I saw someone mention it, but I didn't see a link for it.

2.3.0.8 from this post. This may actually be 2.3.0.7: No errors.

2.3.0.8 from this post: No errors.

Fresh download of 2.3.0.9: Same exceptions as reported.

Thanks for thorough investigation! I'll dive into it right away...

UPD: I was wrong about what is the first exception in that case. It is not about resources, it is this:


FieldAccessException: Cannot set a constant field
at System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
at System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) [0x00000] in <filename unknown>:0
at ProtoPartSnapshot.Load (.Vessel vesselRef, Boolean loadAsRootPart) [0x00000] in <filename unknown>:0
at ProtoVessel.LoadObjects () [0x00000] in <filename unknown>:0
at Vessel.Load () [0x00000] in <filename unknown>:0
at Vessel.MakeActive () [0x00000] in <filename unknown>:0
at FlightGlobals.setActiveVessel (.Vessel v, Boolean force) [0x00000] in <filename unknown>:0
at FlightGlobals.SetActiveVessel (.Vessel v) [0x00000] in <filename unknown>:0
at FlightDriver.Start () [0x00000] in <filename unknown>:0

The Part itself is failed to load from ProtoPrtSnapshot. Because, apparently, it tries to set some constant field through reflection. But how could it be connected to any part module, and thus to TCA, I have no idea... O_o

UPD: Nailed it! In the end, it was so bloody simple, but TOTALLY counterintuitive. As is always with Sqad's programming techniques :huh:

It turns out that in a class derived from the PartModule you cannot use public const fileds. At all! :confused: One of the basic language features is unavailable because of a bad design of one of the most important classes in the whole KSP API. But it only manifests itself if the part with such module is the root part.

Oh, well... Luckily, the workaround is much shorter than my explanations here :cool:

Edited by allista
Link to comment
Share on other sites

Many welcomes! :D

Anyways, I had a thought, since MechJebs rover waypoint plotting system lets you put down the waypoints without having to go to the map, so, maybe allow it to place waypoints without having to go to the map? Would be useful for when you want to navigate more precisely in a local area.

testity_screenshot_2015-09-20--08-39-20_zpsysfnnwyz.png

Also, I was trying out the path navigation on the mun with a rocket based VTOL, but while the VTOL part works fine, it wouldn't follow the path, I have an idea of what one cause might be, but I'll investigate further after these tests I want to do.

When I tried to click stop while it was doing the landing proccess (was trying to abort it), it started spamming an exception:

testity_screenshot_2015-09-20--09-33-49_zps2runenit.png



NullReferenceException: Object reference not set to an instance of an object
at ThrottleControlledAvionics.AutoLander.get_moved_to_next_node () [0x00000] in <filename unknown>:0

at ThrottleControlledAvionics.AutoLander.Update () [0x00000] in <filename unknown>:0

at ThrottleControlledAvionics.ModuleTCA.OnFixedUpdate () [0x00000] in <filename unknown>:0

at Part.ModulesOnFixedUpdate () [0x00000] in <filename unknown>:0

at Part.FixedUpdate () [0x00000] in <filename unknown>:0

I can't get the follow target thing to work. I can't switch from a craft that is already airborne and when I try to do it on the ground, it just retracts landing gear and shuts down the engines. It just sits there even if I move the target craft around.

Edit: Okay, got it to work, the follower has to be very still and possibly really close to the other craft in order for the transfer to work.

Edited by smjjames
Link to comment
Share on other sites

I did some testing with a midweight ship on the Mun and while one design did well, another was having some problems. The second one, I'm not sure if I did it correctly, also ran into a bug where the waypoints refused to be placed for some reason.

Javascript is disabled. View full album

Note: Imgurs album settings are borked right now for some reason, so while it would be better in horizontial format, I can't change that right now.

Also, testing with the earlier heavy rig.

Javascript is disabled. View full album
Edited by smjjames
Link to comment
Share on other sites

Thanks, also pulling your earlier post forward so that the link doesn't get lost behind a few pages if any other people want to help out with the testing.

I also would like to know how to get it to use that second craft in my previous post correctly though.

Edit: Is there a number I can tweak for the near target buffer zone? I'm just wondering if I can get them to keep up faster. I mean they are keeping up, but just barely at the low speeds I'm going, around 70m/s

Edit2: NRE fix confirmed fixed.

Also, it is the last beta with new functionality, as I'm out of the ideas and the summer is over (meaning the hard work begins in my institute).

I'm still reluctant to release it as stable due to the great amount of new features and scarce testing. So, as usual, I'm asking you for help:

I've created a google spreadsheet with the tests that came to mind. You are free to add other tests, comment and mark existing tests as done (with some screenshots, maybe).

I'm hoping that all tests will be done until the next weekend, so I could release all this at last :blush:

Edited by smjjames
Link to comment
Share on other sites

Thanks, also pulling your earlier post forward so that the link doesn't get lost behind a few pages if any other people want to help out with the testing.

I also would like to know how to get it to use that second craft in my previous post correctly though.

Edit: Is there a number I can tweak for the near target buffer zone? I'm just wondering if I can get them to keep up faster. I mean they are keeping up, but just barely at the low speeds I'm going, around 70m/s

Buffer zone is 50m (it is set by a property MinDistance (or something like it, don't remember and cannot look right now) in PN node of TCA.glob). And it does not affect the distance that followers try to keep with the leader.

I'll try to do some specific tuning for the Follow program, but currently the leader is just a (moving) waypoint, so all the rules for waypoints apply. E.g. distance of ~<500m is considered already small enough to reduce relative velocity to ~20m/s (the figures are not thresholds, just the reference).

- - - Updated - - -

I also would like to know how to get it to use that second craft in my previous post correctly though.

And what is the problem with that second craft? I'm sorry, I haven't caught it from the post.

Edit: I think I see. You mean the tilted landing? It's because Horizontal Speed Control system uses total thrust vector to control horizontal speed, not throttle limits. So your aft engine shifts total thrust back, and the craft, to stay still while landing, has to pitch accordingly.

Edited by allista
Link to comment
Share on other sites

And what is the problem with that second craft? I'm sorry, I haven't caught it from the post.

Edit: I think I see. You mean the tilted landing? It's because Horizontal Speed Control system uses total thrust vector to control horizontal speed, not throttle limits. So your aft engine shifts total thrust back, and the craft, to stay still while landing, has to pitch accordingly.

I was trying to get it to use that aft engine for horizontial thrust only, I was trying to speed up it's rate of travel while following a route.

Link to comment
Share on other sites

I cannot for the life of me believe that I missed this mod in my years of playing KSP... This is something that really, REALLY peeved me off about asymmetrical landers and spaceships and being unable to balance RCS to keep control. Now all in one and the things fly true finally.

I am one happy bunny.

I did have one really funny glitch (my own fault though) due to not adding two fuel lines... So the craft would go up, the two small tanks that I used to attach the main engines would drain and not fill up from the main tank and then the craft would just flip over heh. Had me scratching my head for a bit until I spotted it. I tend to hide fuel lines in the creases between tanks as the yellow lines look horrible... and I just missed that I hadn't had symmetry turned on.

Landing on the VAB hasn't been this easy in full grav in AGES.... (turning off the grav doesn't count).

Link to comment
Share on other sites

I was trying to get it to use that aft engine for horizontial thrust only, I was trying to speed up it's rate of travel while following a route.

Same thing: any autopilot program (follow, goto, path) constantly controls speed using HSC system (which I've described above); you turn on the aft engine, total thrust vector shifts and HSC tries to compensate. Because it does not "want" to move as fast as possible, it "wants" to move at the "right" speed.

- - - Updated - - -

I cannot for the life of me believe that I missed this mod in my years of playing KSP... This is something that really, REALLY peeved me off about asymmetrical landers and spaceships and being unable to balance RCS to keep control. Now all in one and the things fly true finally.

I am one happy bunny.

I did have one really funny glitch (my own fault though) due to not adding two fuel lines... So the craft would go up, the two small tanks that I used to attach the main engines would drain and not fill up from the main tank and then the craft would just flip over heh. Had me scratching my head for a bit until I spotted it. I tend to hide fuel lines in the creases between tanks as the yellow lines look horrible... and I just missed that I hadn't had symmetry turned on.

Landing on the VAB hasn't been this easy in full grav in AGES.... (turning off the grav doesn't count).

Glad to hear! :D

Link to comment
Share on other sites

Here's the

next version.

  • Tried to fix auto-landing from high altitude problem.
  • Added Collision Prevention System. Still WIP, but mainly works and needs testing.
  • Please, pay attention to auto-landing in the general, as some raycasting code was changed.

As usual, I'm asking you for help:

I've created a google spreadsheet with the tests that came to mind. You are free to add other tests, comment and mark existing tests as done (with some screenshots, maybe).

I'm hoping that all tests will be done until the next weekend, so I could release all this at last :blush:

Edited by allista
Link to comment
Share on other sites

Cool. Also, I have a request, could you make the set point altitude an editable text box? If you're at a really high elevation and want to move the hover down to a low elevation, it takes a while to get there with the throttle controls, also quicker than holding down shift or ctrl for a minute or so to change the altitude to several thousand feet, even at 5% sensitivity.

Edited by smjjames
Link to comment
Share on other sites

Cool. Also, I have a request, could you make the set point altitude an editable text box? If you're at a really high elevation and want to move the hover down to a low elevation, it takes a while to get there with the throttle controls, also quicker than holding down shift or ctrl for a minute or so to change the altitude to several thousand feet, even at 5% sensitivity.

X and Z give you +/-10m, but anyway, you're right) Will be done.

Link to comment
Share on other sites

Here's the

next version.

  • Fixed automatic targeting problem.
  • Improved collision prevention at high relative velocity; added PID to soften oscillations.
  • Added text edit for altitude setpoint.
  • Added Manual Translation subsystem to HSC; autopilots may now use manual engines to control horizontal speed. Needs to be tested.
  • Tuned Follow Target program so that followers don't fall behind. Needs to be tested at low gravity.

As usual, I'm asking you for help:

I've created a google spreadsheet with the tests that came to mind. You are free to add other tests, comment and mark existing tests as done (with some screenshots, maybe).

I'm hoping that all tests will be done until the next weekend, so I could release all this at last :blush:

Link to comment
Share on other sites

As usual, I'm asking you for help:

I've created a google spreadsheet with the tests that came to mind. You are free to add other tests, comment and mark existing tests as done (with some screenshots, maybe).

I'm hoping that all tests will be done until the next weekend, so I could release all this at last :blush:

Especially planes since I don't usually make planes, so I wouldn't be the best to test that, and I don't know how good Allista is at it (maybe he is, maybe he isn't I don't know. Not questioning your ability allista, just saying that I don't know).

It's just me and allista testing it atm.

Also, for the testing in low gravity, I actually did test that in v12, but it was basically the same, just at a much slower velocity. There was one casuality though, but I don't know how it happened because I didn't see it, looked like the craft had crashed into terrain rather than crashing into another craft.

While having some separation between craft does make sense, I would still like them to be able to keep up at speed.

Edit: What was the automatic targeting problem that was fixed? I did notice that if a craft takes damage (as in a part gets destroyed), the follow autopilot gets set to default and it just heads in a straight line.

Edited by smjjames
Link to comment
Share on other sites

Especially planes since I don't usually make planes, so I wouldn't be the best to test that, and I don't know how good Allista is at it (maybe he is, maybe he isn't I don't know. Not questioning your ability allista, just saying that I don't know).

It's just me and allista testing it atm.

Also, for the testing in low gravity, I actually did test that in v12, but it was basically the same, just at a much slower velocity. There was one casuality though, but I don't know how it happened because I didn't see it, looked like the craft had crashed into terrain rather than crashing into another craft.

While having some separation between craft does make sense, I would still like them to be able to keep up at speed.

I would say that I'm at moderate level of building planes for FAR (never played planes without it), but right now (and in days to come) I'm mostly "testing" this :cool:

Ot7iNs5.jpg

EhMmBZ0.jpg

- - - Updated - - -

Also, for the testing in low gravity, I actually did test that in v12, but it was basically the same, just at a much slower velocity. There was one casuality though, but I don't know how it happened because I didn't see it, looked like the craft had crashed into terrain rather than crashing into another craft.

Edit: What was the automatic targeting problem that was fixed? I did notice that if a craft takes damage (as in a part gets destroyed), the follow autopilot gets set to default and it just heads in a straight line.

Test it in v13 -- should make difference :)

The problem was as follows: leader craft follows path and in the process automatically switches targets (wp1, wp2...); in the meantime the camera is focused on one of the followers which should be targeting the leader. But when the leader switched from wp1 to wp2, so did the active vessel (follower).

Link to comment
Share on other sites

Oh yeah, while doing testing, I've noticed that they tend to pair up, which is cool emergent behavior, the pairs aren't constant though, but the general pairing up is.

Also, flying in formation in low-grav, so far, so good.

testity_screenshot_2015-09-24--08-28-25_zpsztyqhrmt.png

Edit: In excess of 110m/s and still holding formation. They did fall back a little when I sped up quickly, but the followers quickly kept pace.

Edit2: Making a sudden stop did throw them off momentarily when I got to a waypoint, but didn't take long for them to catch up. Going to test this with the two atmosphere craft because they were having a real problem keeping up there.

Edited by smjjames
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

×
×
  • Create New...