Jump to content

[WIN/MAC/LINUX] KSP Trajectory Optimization Tool v1.6.9 [New MATLAB Version!]


Recommended Posts

this bugged me before but I just realized a good way to fix it. Opening the Other Spacecraft menu my first instinct is still to edit all the values and then hit Add Spacecraft. Which I then remember is actually backwards and erases all my data. So if no spacecraft are present could the edit fields be disabled until you click Add Spacecraft?

This is mostly me used to doing it the old way, but in general it does make it perfectly clear even for new users what should be done first

Link to comment
Share on other sites

this bugged me before but I just realized a good way to fix it. Opening the Other Spacecraft menu my first instinct is still to edit all the values and then hit Add Spacecraft. Which I then remember is actually backwards and erases all my data. So if no spacecraft are present could the edit fields be disabled until you click Add Spacecraft?

This is mostly me used to doing it the old way, but in general it does make it perfectly clear even for new users what should be done first

Yeah, I can do this. Good suggestion, thanks. Will be in the next pre-release.

Is this app better than the calculator here?: http://alexmoon.github.io/ksp/#/Kerbin/777/Moho/500/false/ballistic/false/17/68

I've been having trouble getting transfers to high-inclination bodies right, and I'm looking for a better tool than the online calcs/mechjeb.

Thanks!

Gaiiden, you want to handle this one? I'm sure he'd appreciate a response from someone who also doesn't develop the application. :P

Link to comment
Share on other sites

Gaiiden, you want to handle this one? I'm sure he'd appreciate a response from someone who also doesn't develop the application. :P

I didn't answer before because I was waiting for you to do it haha. Of course you're biased, but that doesn't change the facts.

To attempt an answer though, I wouldn't say that KSPTOT is better, but Alex Moon's calculator is constrained in many ways by its own narrowly-defined purpose - which is to be easy and accessible. KSPTOT is more complex because it offers a much more diverse suite of tools that can tackle a very wide range of problems. If you were to use KSPTOT and Alex Moon's calculator for the same basic plotting, you'd get usable results from either of them. KSPTOT definitely lets you take things further however into more complicated interplanetary transfers

Link to comment
Share on other sites

also Arrowstar been meaning to ask what the bare-minimum SFS file is needed to allow Mission Architect to load vessels from it. I track my mission trajectories very closely since the game will change things whenever I load craft and if I don't touch the craft again for a while the propagation of those changes over a long enough time depending on the orbit can make a difference. So every time I head back to the tracking station or perform a maneuver or SOI change I save the SFS file. This means I have 80 saved up for one mission so far (my Duna one that's been going for almost a real year now) and they total 398MB. So I'd like to cut down the individual size of the SFS files. I tried


GAME
{
FLIGHTSTATE
{
version = 1.0.4
UT = 51622146.9340251
activeVessel = 1
mapViewFiltering = 12
VESSEL
{
...all properties...
...all the parts...
...all the other nodes...
}
}
}

But that just loaded up an empty vessel import dialog box. What is your SFS parser expecting?

Link to comment
Share on other sites

here's another thought - is the prompt at the end of the optimizer run to accept/reject the results really necessary anymore? I'm sure it was good to have before there was a robust Undo/Redo system but now it really serves no purpose. If you don't like what the optimizer did you can just Undo it.

Link to comment
Share on other sites

I'm trying to upload a maneuver node from Mission Architect, but it doesn't appear correct in KSP. The vectors are all right, but it looks like the node is being placed at the wrong part of the orbit. Using precise node, it seems to be going right where it 'should' be, so it looks like the maneuver that KSPTOT says is good doesn't actually work

Edited by dlrk
Link to comment
Share on other sites

I have MATLAB for Linux, and would very much like a Linux-compatible build of this amazing app. I searched through this thread, and the main obstacle seemed to be a lack of people with Linux MATLAB willing to help. Is it merely a matter of compiling the code on a Linux platform, or is there more to it than that?

Link to comment
Share on other sites

I'm trying to upload a maneuver node from Mission Architect, but it doesn't appear correct in KSP. The vectors are all right, but it looks like the node is being placed at the wrong part of the orbit. Using precise node, it seems to be going right where it 'should' be, so it looks like the maneuver that KSPTOT says is good doesn't actually work

Arrowstar might understand the problem you're describing better than me, but I still don't think he'd be able to recreate it from that information. Send over a MAT or define the exact situation so he can do it and see it for himself

Link to comment
Share on other sites

I'm using KSPTOT with 64k. If I use the RMS to calculate a maneuver to rendezvous with Mun from Kerbin orbit, the maneuver node is uploaded properly, but it doesn't result in an encounter unless a drag it around a bit.

Ignore my previous posts, I didn't fully understand the problem I was having when I wrote them

Link to comment
Share on other sites

Got a weird issue here with one of my Minmus probes. Once I put it into an 85 degree orbit I can no longer coast to AN/DN, instead coasting to DN takes me to Ap and coasting to AN takes me to Pe - to the exact same times. I have a Mun probe at 87 degrees, a Kerbin probe at 80 degrees and three probes combined around Kerbin & Duna at 90 degrees and all of them coast to AN/DN just fine ending up right over the equator. I have some debris at Minmus at 45 degrees and that coasts to the equator, and the probe with the issue was at 45 then 60 before I went to 85 and it was coasting to AN/DN fine until 85 degrees (I made the plane change to 85 from 60 at the AN).

Here's the SFS file. The probe is Mi-SCAN up at the top of the list, and it includes a file for the 60 and then 85 degree orbits

Link to comment
Share on other sites

I'm trying to get this mod to work on my Mac. I've installed the latest version of the Matlab runtimes in the default directory (/Applications/MATLAB). When I go to run_KSPTOT.command it spits back:

Setting up environment variables

---

DYLD_LIBRARY_PATH is .:/Users/michaelquinn/.Trash/MATLAB 2.39.27 PM/MATLAB_Runtime/v90/runtime/maci64:/Users/michaelquinn/.Trash/MATLAB 2.39.27 PM/MATLAB_Runtime/v90/bin/maci64:/Users/michaelquinn/.Trash/MATLAB 2.39.27 PM/MATLAB_Runtime/v90/sys/os/maci64:/System/Library/Frameworks/JavaVM.framework/JavaVM:/System/Library/Frameworks/JavaVM.framework/Libraries

dyld: Library not loaded: @rpath/libmwmclmcrrt.8.1.dylib

Referenced from: /Users/michaelquinn/Downloads/KSPTOT/KSPTOT.app/Contents/MacOS/KSPTOT

Reason: no suitable image found. Did find:

/System/Library/Frameworks/JavaVM.framework/JavaVM/libmwmclmcrrt.8.1.dylib: stat() failed with errno=20

/Users/michaelquinn/Downloads/KSPTOT/run_KSPTOT.command: line 34: 1335 Trace/BPT trap: 5 "/Users/michaelquinn/Downloads/KSPTOT/KSPTOT.app/Contents/MacOS/KSPTOT"

Then if I try to runs KSPTOT.app it just gives me an error message about "Cannot locate a valid install area". I think it doesn't know where to look for my Matlab runtimes but I don't know how to tell it where to look.

Link to comment
Share on other sites

But that just loaded up an empty vessel import dialog box. What is your SFS parser expecting?

Here's the MATLAB code. Basically I just look for the FlightState portion (might need a ROSTER section?), and then I look for all the places where I get the vessel definitions: "VESSEL"

    
text = fileread(filePath);
text = text(strfind(text,'FLIGHTSTATE') : strfind(text, 'ROSTER') ); % trim to just the FLIGHTSTATE portion
genNum = '[\d\.E\-]*';
regex = {};
regex{end+1} = ['[^\w]VESSEL.*?name \= [ ^\S]*'];
regex{end+1} = ['sit \= [ \w]*'];
regex{end+1} = ['SMA \= ', genNum];
regex{end+1} = ['ECC \= ', genNum];
regex{end+1} = ['INC \= ', genNum];
regex{end+1} = ['LAN \= ', genNum];
regex{end+1} = ['LPE \= ', genNum];
regex{end+1} = ['MNA \= ', genNum];
regex{end+1} = ['EPH \= ', genNum];
regex{end+1} = ['REF \= ', genNum];
out = regexp(text, regex, 'match');

here's another thought - is the prompt at the end of the optimizer run to accept/reject the results really necessary anymore? I'm sure it was good to have before there was a robust Undo/Redo system but now it really serves no purpose. If you don't like what the optimizer did you can just Undo it.

Would rather keep it, but thanks for the suggestion. :)

I have MATLAB for Linux, and would very much like a Linux-compatible build of this amazing app. I searched through this thread, and the main obstacle seemed to be a lack of people with Linux MATLAB willing to help. Is it merely a matter of compiling the code on a Linux platform, or is there more to it than that?

Yes, basically it's just a matter of compiling it to Linux. There are a few (maybe just one) MEX files, though. You would have to compile those, as well. I think it's just down to lambert.m -> lambert.mex64 at this point.

If this is something you're interested in doing, please consult with me privately before doing so. I'm willing to talk about it, as I did with the Mac version, but the KSP TOT license does not allow you to do it independently.

I'm using KSPTOT with 64k. If I use the RMS to calculate a maneuver to rendezvous with Mun from Kerbin orbit, the maneuver node is uploaded properly, but it doesn't result in an encounter unless a drag it around a bit.

How much do you have to drag it around? I'm going to need some more information.

Got a weird issue here with one of my Minmus probes. Once I put it into an 85 degree orbit I can no longer coast to AN/DN, instead coasting to DN takes me to Ap and coasting to AN takes me to Pe - to the exact same times. I have a Mun probe at 87 degrees, a Kerbin probe at 80 degrees and three probes combined around Kerbin & Duna at 90 degrees and all of them coast to AN/DN just fine ending up right over the equator. I have some debris at Minmus at 45 degrees and that coasts to the equator, and the probe with the issue was at 45 then 60 before I went to 85 and it was coasting to AN/DN fine until 85 degrees (I made the plane change to 85 from 60 at the AN).

Here's the SFS file. The probe is Mi-SCAN up at the top of the list, and it includes a file for the 60 and then 85 degree orbits

Issue resolved. You found a case which broke my search algorithm! :sticktongue: I switched to a more robust but slightly slower sub-routine to handle this. Fix will be in the next pre-release.

I'm trying to get this mod to work on my Mac. I've installed the latest version of the Matlab runtimes in the default directory (/Applications/MATLAB). When I go to run_KSPTOT.command it spits back:

Setting up environment variables

---

DYLD_LIBRARY_PATH is .:/Users/michaelquinn/.Trash/MATLAB 2.39.27 PM/MATLAB_Runtime/v90/runtime/maci64:/Users/michaelquinn/.Trash/MATLAB 2.39.27 PM/MATLAB_Runtime/v90/bin/maci64:/Users/michaelquinn/.Trash/MATLAB 2.39.27 PM/MATLAB_Runtime/v90/sys/os/maci64:/System/Library/Frameworks/JavaVM.framework/JavaVM:/System/Library/Frameworks/JavaVM.framework/Libraries

dyld: Library not loaded: @rpath/libmwmclmcrrt.8.1.dylib

Referenced from: /Users/michaelquinn/Downloads/KSPTOT/KSPTOT.app/Contents/MacOS/KSPTOT

Reason: no suitable image found. Did find:

/System/Library/Frameworks/JavaVM.framework/JavaVM/libmwmclmcrrt.8.1.dylib: stat() failed with errno=20

/Users/michaelquinn/Downloads/KSPTOT/run_KSPTOT.command: line 34: 1335 Trace/BPT trap: 5 "/Users/michaelquinn/Downloads/KSPTOT/KSPTOT.app/Contents/MacOS/KSPTOT"

Then if I try to runs KSPTOT.app it just gives me an error message about "Cannot locate a valid install area". I think it doesn't know where to look for my Matlab runtimes but I don't know how to tell it where to look.

As I note in the install instructions, I didn't actually build the Mac version. You'll need to talk with bk2w for technical support as I'm not able to help you directly. Also, please be aware that the Mac version is very old as bk2w has not updated it in some time.

9. Bk2w is building and maintaining the Mac versions. If you have technical issues with installing or running the application, please see him for questions.
Link to comment
Share on other sites

Here's the MATLAB code. Basically I just look for the FlightState portion (might need a ROSTER section?)

Yes I see you're using the ROSTER{} node to terminate the search. Ok I got it to work now where I can edit the SFS down to just the one craft I'm saving updated data for, awesome. 4MB file down to 440KB haha

Issue resolved. You found a case which broke my search algorithm! :sticktongue:

Of course I did :P

Link to comment
Share on other sites

Hopefully these screenshots clarify the problem a bit.

http://imgur.com/a/FbZMa

The orbit is downlinked from KSP, the first maneuver node is uploaded from KSPTOT, and the second one is the first one dragged around the orbit to result in an encounter. This result occured with 1.5 and prerelease 4 of 1.5.1. I did not test pre release 5

Link to comment
Share on other sites

Major addition is the fix to the bug Gaiiden found with the "go to node" algorithm.

Unfortunately the issue seems a bit worse now. Yes, my minmus probe does go to the node now, but it's the wrong one. If I'm above the equator and I tell it to take me to the AN the plot stops at the equator, or wraps all the way around for DN:

1uHGih6m.png

and now all the other craft that were fine of course can no longer coast to AN/DN properly :P One ends at 1 degree above/below the equator (Kerbin) and another ends 10 degrees above/below the equator (Duna). But they do coast to the proper node... wait no I see one of my Duna probes at 90 degrees inc is also coasting to the wrong node. It's early, and I need to go to bed. Let me know if you want a more extensive analysis

Link to comment
Share on other sites

Unfortunately the issue seems a bit worse now. Yes, my minmus probe does go to the node now, but it's the wrong one. If I'm above the equator and I tell it to take me to the AN the plot stops at the equator, or wraps all the way around for DN:

http://i.imgur.com/1uHGih6m.png

and now all the other craft that were fine of course can no longer coast to AN/DN properly :P One ends at 1 degree above/below the equator (Kerbin) and another ends 10 degrees above/below the equator (Duna). But they do coast to the proper node... wait no I see one of my Duna probes at 90 degrees inc is also coasting to the wrong node. It's early, and I need to go to bed. Let me know if you want a more extensive analysis

Thanks. I think I've got it fixed. Take a look, please: KSP TOT v1.5.1 pre-release 6

Hopefully these screenshots clarify the problem a bit.

http://imgur.com/a/FbZMa

The orbit is downlinked from KSP, the first maneuver node is uploaded from KSPTOT, and the second one is the first one dragged around the orbit to result in an encounter. This result occured with 1.5 and prerelease 4 of 1.5.1. I did not test pre release 5

Thanks, I'll take a look.

EDIT: Can you please provide screenshots which reproduce the problem and aren't so cluttered? It's really hard to see. Also, can I get screenshots of the upload dialog boxes too, please?

Edited by Arrowstar
Link to comment
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.

×
×
  • Create New...