Drew Kerman Posted July 17, 2018 Share Posted July 17, 2018 @Arrowstar new possible issue - I'm either using the Ground Stations wrong or something is awry. Here is the MAT file. Repo steps: open Graphical Analysis tool select Start UT from event 3 and paste into Start Time select End UT from event 3 and paste into End Time select Ockr from Ground Stations select Line of Sight to Ref. Station as dependent variable generate plot visibility should always be 1 Here's the problem with that - it shouldn't always be visible during this event. Here's a look at the Mission Animator: By the time the craft is at the end of coast event 3 it's clearly well below the horizon, I have to pan and tilt to look around the planet and see the ground station. More conclusively here's an in-game shot using kOS to draw a vector to the Ockr ground station, which is clearly going through the planet. This is before the end of the coast event as well: Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted July 18, 2018 Author Share Posted July 18, 2018 9 hours ago, Drew Kerman said: @Arrowstar new possible issue - I'm either using the Ground Stations wrong or something is awry. Here is the MAT file. Repo steps: open Graphical Analysis tool select Start UT from event 3 and paste into Start Time select End UT from event 3 and paste into End Time select Ockr from Ground Stations select Line of Sight to Ref. Station as dependent variable generate plot visibility should always be 1 Here's the problem with that - it shouldn't always be visible during this event. Here's a look at the Mission Animator: By the time the craft is at the end of coast event 3 it's clearly well below the horizon, I have to pan and tilt to look around the planet and see the ground station. More conclusively here's an in-game shot using kOS to draw a vector to the Ockr ground station, which is clearly going through the planet. This is before the end of the coast event as well: Thanks! I'll take a look! Quote Link to comment Share on other sites More sharing options...
Thomas, a Kerbonaut Posted July 18, 2018 Share Posted July 18, 2018 On 7/17/2018 at 2:18 PM, Arrowstar said: @Thomas, a Kerbonaut if you need help using KSPTOT or getting it installed, please let me know. Thanks! Thanks for helping me. The only problem I have is that my computer runs on windows XP 32bit, so the newest version of the Matlab software I can use is the R2015b, which is quite older than the one you recommended. Do you think it might be a problem ? Quote Link to comment Share on other sites More sharing options...
whitespacekilla Posted July 25, 2018 Share Posted July 25, 2018 (edited) I am encountering an error when attempting to use KSPTOTConnect to generate a new `bodies.ini`. It looks similar to another user's error. I'm playing 1.4.4 with OPM and The World Beyond. I know Kopernicus is version locked to 1.4.3 but I'm a C# dev so that wasn't much of an obstacle (and there were no breaking changes for Kopernicus in 1.4.4). The error message has no advice besides to ensure KSP is running in the flight scene with KSPTOT loaded which I can verify is true. The KSP.log file even reveals that the 2 programs are talking. I can also upload maneuvers fine and use other KSPTOTConnect features. The KSPTOT.log is here: https://pastebin.com/iJHaTMiZ The relevant KSP.log statements are here: https://pastebin.com/W8Rg7xUe Based on the log output and the other user's problem, I'm guessing that setups with multiple stars aren't working but I didn't see any concrete advice on this. I've got the KSPTOT source open and building on my computer so I'm willing to take additional troubleshooting/debug steps. It seems like `Utilities.getAllCelestialBodyDataAndPrepForTransmission` does all of the heavy lifting here, is this correct? Are there other ways to generate a bodies.ini? Seems like a pretty simple reformatting of orbital information. Is there anything else going on? Edited July 25, 2018 by whitespacekilla Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted August 6, 2018 Share Posted August 6, 2018 hey @Arrowstar, got another possible bug for you. MAT File. Repro steps: Script -> Execution Settings -> Set SOI Search Revs = 100 Create coast to Next SOI Edit coast to Next SOI and change it to UT Copy the UT and exit without saving Select event #1 Insert coast to UT, change the time back by 4 hours Edit coast to Next SOI (event #3) and change the color to green Note portion of the orbit turns green (I wanted to quickly see whether the SOI entry was at the ascending or descending node. Here it is at the descending node) With event #3 still selected, add two additional coasts to Next SOI - this takes us past Mun and back around Kerbin to the next intercept Advance script to the last event. We are now in the same situation as Step 2 Repeat steps 3-7 Note the entire orbit is now green For some reason this time when you insert the UT coast event the SOI entry point changes. Originally, at Step 10 if you selected to copy the end UT time of the Next SOI state it would be 62271872.6811. After you insert the coast event, the new end UT time for the Next SOI event has advanced to 64908150.0574 Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted August 6, 2018 Author Share Posted August 6, 2018 On 7/24/2018 at 7:41 PM, whitespacekilla said: I am encountering an error when attempting to use KSPTOTConnect to generate a new `bodies.ini`. It looks similar to another user's error. I'm playing 1.4.4 with OPM and The World Beyond. I know Kopernicus is version locked to 1.4.3 but I'm a C# dev so that wasn't much of an obstacle (and there were no breaking changes for Kopernicus in 1.4.4). The error message has no advice besides to ensure KSP is running in the flight scene with KSPTOT loaded which I can verify is true. The KSP.log file even reveals that the 2 programs are talking. I can also upload maneuvers fine and use other KSPTOTConnect features. The KSPTOT.log is here: https://pastebin.com/iJHaTMiZ The relevant KSP.log statements are here: https://pastebin.com/W8Rg7xUe Based on the log output and the other user's problem, I'm guessing that setups with multiple stars aren't working but I didn't see any concrete advice on this. I've got the KSPTOT source open and building on my computer so I'm willing to take additional troubleshooting/debug steps. It seems like `Utilities.getAllCelestialBodyDataAndPrepForTransmission` does all of the heavy lifting here, is this correct? Are there other ways to generate a bodies.ini? Seems like a pretty simple reformatting of orbital information. Is there anything else going on? Thanks for letting me know! 15 hours ago, Drew Kerman said: hey @Arrowstar, got another possible bug for you. MAT File. Repro steps: Script -> Execution Settings -> Set SOI Search Revs = 100 Create coast to Next SOI Edit coast to Next SOI and change it to UT Copy the UT and exit without saving Select event #1 Insert coast to UT, change the time back by 4 hours Edit coast to Next SOI (event #3) and change the color to green Note portion of the orbit turns green (I wanted to quickly see whether the SOI entry was at the ascending or descending node. Here it is at the descending node) With event #3 still selected, add two additional coasts to Next SOI - this takes us past Mun and back around Kerbin to the next intercept Advance script to the last event. We are now in the same situation as Step 2 Repeat steps 3-7 Note the entire orbit is now green For some reason this time when you insert the UT coast event the SOI entry point changes. Originally, at Step 10 if you selected to copy the end UT time of the Next SOI state it would be 62271872.6811. After you insert the coast event, the new end UT time for the Next SOI event has advanced to 64908150.0574 Thanks for the report! Sorry I haven't been around much the past 3-4 weeks. I am seeing the reports here, but I've been busy with another project that is consuming my free time. I'm hoping to be able to get to some of these things here in the next few weeks. Sorry for the delay. :) Quote Link to comment Share on other sites More sharing options...
whitespacekilla Posted August 6, 2018 Share Posted August 6, 2018 @Arrowstar seems likely it's more specific than just multiple stars. GPP + GEP works fine but stock + OPM + TWB doesn't work. Would it be that playing with "The World Beyond" results in a setup with no common/root orbit? I changed my setup so won't be adding TWB back in to debug for awhile (there's a couple multiple star/non-kerbin setups I'd like to patch first) but if you don't beat me to it, I might contribute some source code back to KSPTOTconnect. I love using this tool, keep up the good work! Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted August 6, 2018 Author Share Posted August 6, 2018 3 minutes ago, whitespacekilla said: but if you don't beat me to it, I might contribute some source code back to KSPTOTconnect. Please, by all means! Start with the source code in the download package, whatever is online is out of date. If you can improve KSPTOTCONNECT, go for it. I'm not much of a C# dev so I'm happy for the help. If you do any work on the plugin, send me a PM with the source code and I'll check it out. Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted August 6, 2018 Share Posted August 6, 2018 6 hours ago, Arrowstar said: Sorry I haven't been around much the past 3-4 weeks. I am seeing the reports here, but I've been busy with another project that is consuming my free time. I'm hoping to be able to get to some of these things here in the next few weeks. Sorry for the delay. no worries - whenever you get around to it is good enough for me. Thanks for the update Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted August 10, 2018 Author Share Posted August 10, 2018 On 8/5/2018 at 7:54 PM, Drew Kerman said: hey @Arrowstar, got another possible bug for you. MAT File. Repro steps: Script -> Execution Settings -> Set SOI Search Revs = 100 Create coast to Next SOI Edit coast to Next SOI and change it to UT Copy the UT and exit without saving Select event #1 Insert coast to UT, change the time back by 4 hours Edit coast to Next SOI (event #3) and change the color to green Note portion of the orbit turns green (I wanted to quickly see whether the SOI entry was at the ascending or descending node. Here it is at the descending node) With event #3 still selected, add two additional coasts to Next SOI - this takes us past Mun and back around Kerbin to the next intercept Advance script to the last event. We are now in the same situation as Step 2 Repeat steps 3-7 Note the entire orbit is now green For some reason this time when you insert the UT coast event the SOI entry point changes. Originally, at Step 10 if you selected to copy the end UT time of the Next SOI state it would be 62271872.6811. After you insert the coast event, the new end UT time for the Next SOI event has advanced to 64908150.0574 I had trouble reproducing this one. The final event, Event 5, which is a coast to SoI transition, was not able to find an SoI transition. Judging by what you're describing though, I suspect it's yet again another thing with the numerical precision of the SoI transition finder algorithm. Do you have a more straight forward way of demonstrating the issue? Oh, you'll be happy to know I believe I've corrected the line of sight bug you reported before. When I get it posted if you could look and see if it corrects your issue that would be great. Thanks! Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted August 10, 2018 Author Share Posted August 10, 2018 Oh, also, for those interested, I finally figured out how to actually use git and updated the repo tonight for the first time in 3 years lol. New source code is here: https://github.com/Arrowstar/ksptot This is just KSPTOT. KSPTOTConnect is not included there yet. Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted August 10, 2018 Share Posted August 10, 2018 7 hours ago, Arrowstar said: I had trouble reproducing this one. The final event, Event 5, which is a coast to SoI transition, was not able to find an SoI transition. So you're saying you get to Step #9 and the fifth event can't find an SOI transition? Not sure what to say. I just went through the steps again myself and here's the result: As you can see I'm back in Mun's SOI for event 5 Just to make double sure, I also downloaded and used the file I linked you to and was able to get it to work. My only guess is that maybe you messed up the steps on your first try, did a second try but forgot that when you load a new MAT file the SOI rev count gets reset to 3? I know that if the rev count is not increased it won't hit an SOI for event 5 7 hours ago, Arrowstar said: Do you have a more straight forward way of demonstrating the issue? This is currently the only situation in which I know it occurs 7 hours ago, Arrowstar said: When I get it posted if you could look and see if it corrects your issue that would be great Sure thingy! *sits and starts pressing F5* Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted August 10, 2018 Author Share Posted August 10, 2018 7 hours ago, Drew Kerman said: So you're saying you get to Step #9 and the fifth event can't find an SOI transition? Not sure what to say. I just went through the steps again myself and here's the result: As you can see I'm back in Mun's SOI for event 5 Just to make double sure, I also downloaded and used the file I linked you to and was able to get it to work. My only guess is that maybe you messed up the steps on your first try, did a second try but forgot that when you load a new MAT file the SOI rev count gets reset to 3? I know that if the rev count is not increased it won't hit an SOI for event 5 This is currently the only situation in which I know it occurs Sure thingy! *sits and starts pressing F5* Okay, maybe I just need some clarification as to when you're restarting MA or creating a new mission plan or reloading the mission plan file or whatnot. That was not clear to me when going through the instructions. Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted August 10, 2018 Share Posted August 10, 2018 (edited) 59 minutes ago, Arrowstar said: ... when you're restarting MA or creating a new mission plan or reloading the mission plan file or whatnot I am doing none of these things Well, okay technically Step 0 would be load the mission plan file I linked to you. But after that there is no restarting/reloading/redoing anything. I'm just suggesting that maybe you did that if you thought you messed up partway through. Interesting debacle. You can't recreate it and I can't not recreate it Let me know if there's anything else about the repro steps you think needs clarifying Edited August 10, 2018 by Drew Kerman Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted August 10, 2018 Author Share Posted August 10, 2018 5 hours ago, Drew Kerman said: I am doing none of these things Well, okay technically Step 0 would be load the mission plan file I linked to you. But after that there is no restarting/reloading/redoing anything. I'm just suggesting that maybe you did that if you thought you messed up partway through. Interesting debacle. You can't recreate it and I can't not recreate it Let me know if there's anything else about the repro steps you think needs clarifying So... I did what you instructed and here's what I ended up with: Here's a link to the MAT file shown above so you can take a look and tell me what I did wrong lol. Once we get this sorted I'll compile the next pre-release and you can test out the fix(es). Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted August 11, 2018 Share Posted August 11, 2018 (edited) 10 hours ago, Arrowstar said: take a look and tell me what I did wrong lol. Well, for one thing the last event is supposed to be a coast to SOI - you even named it coast to SOI but it's just a coast to TA. If I change it to a coast to SOI then I get a complete green orbit like I would expect However the UT for the end of the state is wrong so you didn't complete the last step or two. Here, have a video! EDIT: wait - see next post first Spoiler Ok now, when you get to the end with the complete green circle, here's how to look at what is wrong. Click the last event and get the end UT time. It should be 64908150.0574172. Now undo two steps which will remove the second event. Click again on the last event, the SOI coast, and get the end UT time. It should have changed to 62271872.6810975 So sticking that coast to UT event 4 hours prior to the original SOI intercept causes MA to skip it and find another, later one Edited August 11, 2018 by Drew Kerman Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted August 11, 2018 Share Posted August 11, 2018 (edited) Okay, looks like it's not the Advance Coast that is the problem, since I've reached the next encounter in the game and I have the new orbit state that you would have gotten to after Step 10. So download this MAT file and do the following: Set SOI Search revs to 100 Add coast to next SOI Get UT time for end of event 2 - it should be 62271885.4086678 Select event 1 and insert a coast to UT Paste the end UT (62271885.4086678) and set it back 4 hours Get UT time for end of event 2 - it should now be 64908176.2437179 Ok, that's the problem right there - creating that intermediate coast event to a point 4 hours prior to the original SOI intercept time produces a different SOI intercept time Were you up watching Parker launch? Of course the one launch I remember to watch after missing like the last 3 or 4 SpaceX/Ariane launches gets scrubbed. Of course Edited August 11, 2018 by Drew Kerman Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted August 11, 2018 Share Posted August 11, 2018 Another issue to look at, this time with the MA mission animator. Use this MAT file, which is the same as the one in the last post but in this one I'm just hopping ahead a few times in and out of Mun's SOI. Open the animator and use the >> event jump button. You'll see the orbit for the Mun SOI pass appear around Kerbin but the Kerbin orbit never appears even after you start the animation. In fact it never seems to really transition to Mun frame of reference Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted August 11, 2018 Author Share Posted August 11, 2018 10 hours ago, Drew Kerman said: Okay, looks like it's not the Advance Coast that is the problem, since I've reached the next encounter in the game and I have the new orbit state that you would have gotten to after Step 10. So download this MAT file and do the following: Set SOI Search revs to 100 Add coast to next SOI Get UT time for end of event 2 - it should be 62271885.4086678 Select event 1 and insert a coast to UT Paste the end UT (62271885.4086678) and set it back 4 hours Get UT time for end of event 2 - it should now be 64908176.2437179 Ok, that's the problem right there - creating that intermediate coast event to a point 4 hours prior to the original SOI intercept time produces a different SOI intercept time Were you up watching Parker launch? Of course the one launch I remember to watch after missing like the last 3 or 4 SpaceX/Ariane launches gets scrubbed. Of course Alright, want to know what the problem was? This is a plot of the distance of your spacecraft to the Mun SoI over time (horizontal axis is universal time, vertical is distance to SoI). See all those local minima (the bottoms of the valleys)? The SoI transition code was getting stuck in one of them, namely the middle valley. Because that valley is nowhere near the SoI, it was rejecting the whole solution. Luckily, I have a solution. I have added an option to the Mission Architect script execution settings called "Number of SoI Transition Search Attempts" (Settings -> Execution Settings -> Set Num. SoI Search Attempts). Here's what this does. See the plot above? That's a portion of one rev that the code pre-computes in such a way that, if the Mun was going to be intersecting your spacecraft orbit, it would be somewhere in there. We see that it is, in fact. There's margin on those bounds, though, so that nothing gets missed, and for fast periods, like the Mun and your spacecraft here, you will probably get a few local minima. The new setting divides that plot up into a number of equally-sized slices and then attempts to find an SoI transition in each slice, from left to right. The number you provide dictates the number of slices. So, if you say 1 (which is the default), the behavior is unchanged from before. If you say 2, then the first half of that plot gets searched, and then the second half gets searched (so long as an SoI transition was not found in the first half). If you say 10, then the first tenth gets searched, and then so on... Now, one caveat. This will definitely improve search functionality in cases where the solver was running into bad local minima. However, it also involves calling that solver more times, which means that setting this new setting to a number greater than 1 will slow down execution speed. Setting it to the maximum of 100 will probably slow down run time by a factor of at least 10x-20x. Anyway, this new function solves the issue you were seeing. It, as well as the fix for the line of sight issue you reported, are in a new pre-release: KSPTOT v1.5.11 pre-release 2. Please test these fixes out and see if they help! Thanks. (I will take a look at the mission animator stuff you mentioned later!) Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted August 11, 2018 Author Share Posted August 11, 2018 10 hours ago, Drew Kerman said: Another issue to look at, this time with the MA mission animator. Use this MAT file, which is the same as the one in the last post but in this one I'm just hopping ahead a few times in and out of Mun's SOI. Open the animator and use the >> event jump button. You'll see the orbit for the Mun SOI pass appear around Kerbin but the Kerbin orbit never appears even after you start the animation. In fact it never seems to really transition to Mun frame of reference Can you take a few pictures of what you mean? Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted August 11, 2018 Share Posted August 11, 2018 (edited) 4 minutes ago, Arrowstar said: Can you take a few pictures of what you mean? Ok here's one that shows the gist of it - you can match the settings shown on the left and then just click the >> button once and it will end up like this But I mean, regardless even if you just load the Mission Animator straight up and start paging forward events things get messed up straight away it seems Edited August 11, 2018 by Drew Kerman Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted August 11, 2018 Share Posted August 11, 2018 Both fixes look good, however it seems the default for the SOI search option is 2 not 1 Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted August 11, 2018 Author Share Posted August 11, 2018 26 minutes ago, Drew Kerman said: Both fixes look good, however it seems the default for the SOI search option is 2 not 1 Oh, so I just forgot to update the post about that. At the last second, after doing some more testing, I decided that 2 was better because it really seemed to improve the odds of finding the SoI transition, but didn't cost that much more time. So I left it at 2 instead of 1. Anyway, I believe I found the bug in mission animator it was plotting the orbit from one part of the state log, but at the boundary between two SoIs, grabbing the wrong spacecraft position. I have adjusted the code to correct this. I updated the v1.5.11 pre-release 2 ZIP file with the build that has the fix in it. Please test at your convenience. Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted August 11, 2018 Share Posted August 11, 2018 8 minutes ago, Arrowstar said: Please test at your convenience Looks good here! Quote Link to comment Share on other sites More sharing options...
Arrowstar Posted August 11, 2018 Author Share Posted August 11, 2018 37 minutes ago, Drew Kerman said: Looks good here! Hey, you still need/want that atmospheric orbital decay model, right, @Drew Kerman? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.