Jump to content

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


Recommended Posts

8 hours ago, brooklyn666 said:

Is there a currently up-to-date way to install this on mac? Both the mac install and the wine install are out of date

Unfortunately, I don't think this is possible (until/unless someone with a macOS Matlab license can do a native macOS build).

I've just tried this in the last couple of days, using the brand-new Wine 3.0 builds on both macOS and Linux. For me, the MCR R2017b installer fails hard and immediately under Wine. TBH I wouldn't be shocked if MathWorks have gone out of their way to make Matlab incompatible with Wine - I mean, that's potential lost license sales! :rolleyes:

If someone manages to get this working, I'd love to hear about it :)

Link to comment
Share on other sites

Is there a fork/variant of this I can use for Realism Overhaul or with real-world planet, distance, and epoch values?

I'm in need of software with remarkably similar functionality to this for a university project (without a software budget), GMAT is being non-cooperative, and the Orbiter forums don't look like they have anything at this level. :)  

Link to comment
Share on other sites

11 hours ago, russm said:

Unfortunately, I don't think this is possible (until/unless someone with a macOS Matlab license can do a native macOS build).

I've just tried this in the last couple of days, using the brand-new Wine 3.0 builds on both macOS and Linux. For me, the MCR R2017b installer fails hard and immediately under Wine. TBH I wouldn't be shocked if MathWorks have gone out of their way to make Matlab incompatible with Wine - I mean, that's potential lost license sales! :rolleyes:

If someone manages to get this working, I'd love to hear about it :)

I honestly think someone would have to have a copy of MacOS and MATLAB on it to compile for Mac.  I had a guy helping me with that a while ago but I have not heard from him in a long time.  WINE and KSPTOT have never really cooperated in my experience, sadly.

5 minutes ago, ILikeIke said:

Is there a fork/variant of this I can use for Realism Overhaul or with real-world planet, distance, and epoch values?

I'm in need of software with remarkably similar functionality to this for a university project (without a software budget), GMAT is being non-cooperative, and the Orbiter forums don't look like they have anything at this level. :)  

No need to get a "variant!"  It is possible.  From the Q&A on the first post of the thread:

Quote

Q: I use Real Solar System / Kopernicus / Outer Planets Mod /etc. Can I use KSP TOT with it?

A: Yes! To do so, you'll need to create a bodies.ini file with the information of the new planets included. Simply install the KSPTOTConnect plugin into your KSP / Gamedata folder, start KSP, get into the flight scene (where you can see your spacecraft in space, for example), and then open KSP TOT. Use the File -> Create New Bodies File From KSP and follow the instructions. Then load the file you create with File -> Load Bodies From File. All done! While you'll only need to create the bodies file once, you have to load it each time KSP TOT starts to use it.

Let me know if you need any help with this, I'm happy to try. :)
EDIT: Btw, if you do use KSPTOT for your work, please A) credit me for the software, b) share the results of your work on this thread so others can see what neat things people are doing with KSPTOT (if you are able)!

Edited by Arrowstar
Link to comment
Share on other sites

54 minutes ago, Arrowstar said:

I honestly think someone would have to have a copy of MacOS and MATLAB on it to compile for Mac.  I had a guy helping me with that a while ago but I have not heard from him in a long time.  WINE and KSPTOT have never really cooperated in my experience, sadly.

I've fished around the various engineering/science people I know but found a 0% overlap between mac users and Matlab licensees. :(

How difficult is the build process? Is it just load the project and click "compile for MCR", or is there more fiddlyness? Is it part of the standard Matlab install, or is the compiler an unbundled extra? I'm half tempted to put out a general request on the twitters, but would be reluctant to ask strangers to sign up for more than 10 minutes of low effort.

Link to comment
Share on other sites

On 1/23/2018 at 7:14 PM, russm said:

I've fished around the various engineering/science people I know but found a 0% overlap between mac users and Matlab licensees. :(

How difficult is the build process? Is it just load the project and click "compile for MCR", or is there more fiddlyness? Is it part of the standard Matlab install, or is the compiler an unbundled extra? I'm half tempted to put out a general request on the twitters, but would be reluctant to ask strangers to sign up for more than 10 minutes of low effort.

The build process is pretty easy.  You just load up the project file and tap "build."  It spins for 5-10 minutes and then it's done.  Couldn't be easier.

Just a note, I would prefer (and my license requires) that any 3rd party compiling for distribution be done in coordination with me.  If you want to go ahead with something like this, please PM me or whatnot so we can discuss specifics.  Thanks! :)

I'm also pleased to announce tonight the release of KSPTOT v1.5.9!  This release has lots of good changes to it, most notably the update to the most recent version of the MATLAB MCR, R2017b.  You will need this new MCR to run the software.  (See the OP for a link.)  Here are the changes:

  • Update KSPTOT to use MATLAB Compiler Runtime version R2017b.
  • Resolved issue with KSPTOT RTS.
  • Added minimum periapsis radius constraint for MFMS.
  • Fixed issue with KSPTOT Mission Architech drag calculations.
  • The Mission Architect optimization algorithm is now select-able from the Script -> Execution Options menu.
  • Mission Architect aerobraking events can now select a color to use for drawing on the UI.
  • Added the MATLAB version the application is running on to various splash screens and informational texts.
  • Mission Architect orbit display clipping parameter updated to "rectangle"; should help with some funny clipping issues that existed previously.
  • "Central Body ID" constraint should now be smooth instead of discrete.  This should help with using this constraint during optimization.
  • New "Eve Aerobraking" MA example
  • Added a total mission duration constraint in MFMS.
  • Increased the fidelity of the Mission Architect SoI search routine with the addition of another algorithm.
  • Added an error message to MA when the optimizer hits a NaN for a control variable.
  • Messages are written to MA output when you change optimizer algorithm.

As always, please let me know what bugs you find and happy orbiting!

Link to comment
Share on other sites

installed new Matlab and tot but unable to load program get the following error message.

"unable to read file spalshscreengui.fig. no such file or directory.

error in=>projectMain.m at line 21

uninstalled both programs and then reinstalled but same error.

Edited by robm
Link to comment
Share on other sites

2 hours ago, robm said:

installed new Matlab and tot but unable to load program get the following error message.

"unable to read file spalshscreengui.fig. no such file or directory.

error in=>projectMain.m at line 21

uninstalled both programs and then reinstalled but same error.

Thanks for the report.  Anyone getting this?

Link to comment
Share on other sites

On 26/01/2018 at 10:40 AM, Arrowstar said:

The build process is pretty easy.  You just load up the project file and tap "build."  It spins for 5-10 minutes and then it's done.  Couldn't be easier.

Just a note, I would prefer (and my license requires) that any 3rd party compiling for distribution be done in coordination with me.  If you want to go ahead with something like this, please PM me or whatnot so we can discuss specifics.  Thanks! :)

No luck on macOS but I do have an acquaintance who can do Linux builds (which is even better for me). Can you check your PMs?

Link to comment
Share on other sites

Hi, I thought I would give this mod/program a whirl. But I have a bit of a problem. I am getting the "There was an error pulling data from KSPTOTConnect." message. Yes I in orbit, looking at my craft floating above Kerbin, not in say map mode or tracking station etc, guess that is what you mean by flight mode? ALT+F12 shows an entry for "KSPTOTConnet, Version=1.0.0.0, Culture=neutral, PublicKetToken=null". Yes KSP is running in a window, not full screen. I see this in my log:

Spoiler

[KSPTOT Connect] [CONNECTION][1][READING] SOCKET ERROR 10004 A blocking operation was interrupted by a call to WSACancelBlockingCall.

Log: https://www.dropbox.com/s/ezunnebwlu6zvgi/saves for KSPTOTConnect.1.output_log.txt?dl=0

Yes I have avast installed: Program version: 17.9.2322 (build 17.9.3761.278). I went to settings - general - exclusions and added the folder that KSPTOT is in. I also went to settings - components - web shield - exclusions and added the process KSPTrajectoryOptimizationTool.exe.

No joy. I even temporarily disabled all avast shields. Still get the same error message.

I KSS + OPM. I searched my GameData folder with explorer for bodie.ini and got no result.

Can anyone help me?

Link to comment
Share on other sites

9 minutes ago, dlrk said:

I'm not having any trouble creating a bodies file or getting my active vessel's orbit,  but when I try to "get orbit from KSP" or "get orbit from SFS file", I just a chord sound

check the log file in the folder where you installed KSPTOT

Link to comment
Share on other sites

Error using char
Cell elements must be character arrays.

Error in importOrbitGUI>importOrbitGUI_OpeningFcn (line 141)


Error in gui_mainfcn (line 220)


Error in importOrbitGUI (line 40)


Error in orbitPanelGetOrbitFromKSPTOTConnectCallBack (line 6)


Error in rendezvousGUI>getFinalOrbitFromKSPTOTConnect_Callback (line 846)


Error in gui_mainfcn (line 95)


Error in rendezvousGUI (line 42)


Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)rendezvousGUI('getFinalOrbitFromKSPTOTConnect_Callback',hObject,eventdata,guidata(hObject))

Error using waitforallfiguresclosed (line 9)
Error while evaluating Menu Callback.

Error using char
Cell elements must be character arrays.

Error in importOrbitGUI>importOrbitGUI_OpeningFcn (line 141)


Error in gui_mainfcn (line 220)


Error in importOrbitGUI (line 40)


Error in orbitPanelGetOrbitFromKSPTOTConnectCallBack (line 6)


Error in rendezvousGUI>getFinalOrbitFromKSPTOTConnect_Callback (line 846)


Error in gui_mainfcn (line 95)


Error in rendezvousGUI (line 42)


Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)rendezvousGUI('getFinalOrbitFromKSPTOTConnect_Callback',hObject,eventdata,guidata(hObject))

Error using uiwait (line 81)
Error while evaluating Menu Callback.

Error using char
Cell elements must be character arrays.

Error in importOrbitGUI>importOrbitGUI_OpeningFcn (line 141)


Error in gui_mainfcn (line 220)


Error in importOrbitGUI (line 40)


Error in orbitPanelGetOrbitFromKSPTOTConnectCallBack (line 6)


Error in rendezvousGUI>getFinalOrbitFromKSPTOTConnect_Callback (line 846)


Error in gui_mainfcn (line 95)


Error in rendezvousGUI (line 42)


Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)rendezvousGUI('getFinalOrbitFromKSPTOTConnect_Callback',hObject,eventdata,guidata(hObject))

Error using pause (line 20)
Error while evaluating Menu Callback.

Warning: The BytesAvailableFcn is being disabled. To enable the callback property
either connect to the hardware with FOPEN or set the BytesAvailableFcn property.

> In pause (line 20)
  In rts_waitForData (line 10)
  In readDoublesFromKSPTOTConnect (line 49)
  In getSingularOrbitFromKSPTOTConnect (line 7)
  In importOrbitGUI>importOrbitGUI_OpeningFcn (line 84)
  In gui_mainfcn (line 220)
  In importOrbitGUI (line 40)
  In orbitPanelGetOrbitFromKSPTOTConnectCallBack (line 6)
  In rendezvousGUI>getFinalOrbitFromKSPTOTConnect_Callback (line 846)
  In gui_mainfcn (line 95)
  In rendezvousGUI (line 42)
  In matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)rendezvousGUI('getFinalOrbitFromKSPTOTConnect_Callback',hObject,eventdata,guidata(hObject))
  In waitforallfiguresclosed (line 9)
Read doubles from KSPTOT Connect failed: SIZE must be greater than 0.
    file: 'C:\Program Files\MATLAB\MATLAB Runtime\v93\mcr\toolbox\shared\instrument\@icinterface\fread.m'
    name: 'fread'
    line: 164

    file: 'C:\Users\AK\AppData\Local\Temp\AK\mcrCache9.3\KSPTra0\helper_methods\ksptot_connect\readDoublesFromKSPTOTConnect.m'
    name: 'readDoublesFromKSPTOTConnect'
    line: 53

    file: 'C:\Users\AK\AppData\Local\Temp\AK\mcrCache9.3\KSPTra0\helper_methods\gui_setup\getSingularOrbitFromKSPTOTConnect.m'
    name: 'getSingularOrbitFromKSPTOTConnect'
    line: 7

    file: 'C:\Users\AK\AppData\Local\Temp\AK\mcrCache9.3\KSPTra0\KSPTrajector\importOrbitGUI.m'
    name: 'importOrbitGUI_OpeningFcn'
    line: 84

    file: 'C:\Program Files\MATLAB\MATLAB Runtime\v93\mcr\toolbox\matlab\guide\gui_mainfcn.m'
    name: 'gui_mainfcn'
    line: 220

    file: 'C:\Users\AK\AppData\Local\Temp\AK\mcrCache9.3\KSPTra0\KSPTrajector\importOrbitGUI.m'
    name: 'importOrbitGUI'
    line: 40

    file: 'C:\Users\AK\AppData\Local\Temp\AK\mcrCache9.3\KSPTra0\helper_methods\gui_setup\orbitPanelGetOrbitFromKSPTOTConnectCallBack.m'
    name: 'orbitPanelGetOrbitFromKSPTOTConnectCallBack'
    line: 6

    file: 'C:\Users\AK\AppData\Local\Temp\AK\mcrCache9.3\KSPTra0\KSPTrajector\rendezvousGUI.m'
    name: 'getFinalOrbitFromKSPTOTConnect_Callback'
    line: 846

    file: 'C:\Program Files\MATLAB\MATLAB Runtime\v93\mcr\toolbox\matlab\guide\gui_mainfcn.m'
    name: 'gui_mainfcn'
    line: 95

    file: 'C:\Users\AK\AppData\Local\Temp\AK\mcrCache9.3\KSPTra0\KSPTrajector\rendezvousGUI.m'
    name: 'rendezvousGUI'
    line: 42

    file: 'C:\Program Files\MATLAB\MATLAB Runtime\v93\mcr\toolbox\matlab\graphics\+matlab\+graphics\+internal\+figfile\@FigFile\read.m'
    name: '@(hObject,eventdata)rendezvousGUI('getFinalOrbitFromKSPTOTConnect_Callback',hObject,eventdata,guidata(hObject))'
    line: 0

Index exceeds matrix dimensions.

Error in getSingularOrbitFromKSPTOTConnect (line 16)


Error in importOrbitGUI>importOrbitGUI_OpeningFcn (line 84)


Error in gui_mainfcn (line 220)


Error in importOrbitGUI (line 40)


Error in orbitPanelGetOrbitFromKSPTOTConnectCallBack (line 6)


Error in rendezvousGUI>getFinalOrbitFromKSPTOTConnect_Callback (line 846)


Error in gui_mainfcn (line 95)


Error in rendezvousGUI (line 42)


Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)rendezvousGUI('getFinalOrbitFromKSPTOTConnect_Callback',hObject,eventdata,guidata(hObject))

Error using waitforallfiguresclosed (line 9)
Error while evaluating Menu Callback.

 

Link to comment
Share on other sites

On 1/24/2018 at 11:07 AM, ILikeIke said:

Is there a fork/variant of this I can use for Realism Overhaul or with real-world planet, distance, and epoch values?

I'm in need of software with remarkably similar functionality to this for a university project (without a software budget), GMAT is being non-cooperative, and the Orbiter forums don't look like they have anything at this level. :)  

Drop this bodies.ini into your KSPTOT folder. Created using KSP 1.2.2 and Real Solar System by Nathan Kell (see link).

 

https://drive.google.com/open?id=1S-Jetz0kMHiP2YQG_JdOjOA3tqqw9GRe

Link to comment
Share on other sites

16 hours ago, TheSpacePotato said:

There's your problem. KSS isn't compatible with OPM until the next update :P

To which mod do you refer? Do you mean KSS will be bringing out an update that will make it compatible with OPM? Or that OPM will be bringing out an update that will make it compatible with KSS? Or even a KSP update?

BTW I can play the game just fine, the error message from KSPTOTConnect appears to be a network connection error. The provided log file clearly shows that KSPTOTConnect is trying to send useful information but fails with a socket error. Thus I am under the belief that KSP works, KSPTOTConnect is trying to work and there is something stopping the connection. A solution to which I sought here and still wish for.

Link to comment
Share on other sites

On 2/2/2018 at 2:54 PM, Apaseall said:

Hi, I thought I would give this mod/program a whirl. But I have a bit of a problem. I am getting the "There was an error pulling data from KSPTOTConnect." message. Yes I in orbit, looking at my craft floating above Kerbin, not in say map mode or tracking station etc, guess that is what you mean by flight mode? ALT+F12 shows an entry for "KSPTOTConnet, Version=1.0.0.0, Culture=neutral, PublicKetToken=null". Yes KSP is running in a window, not full screen. I see this in my log:

  Reveal hidden contents

[KSPTOT Connect] [CONNECTION][1][READING] SOCKET ERROR 10004 A blocking operation was interrupted by a call to WSACancelBlockingCall.

Log: https://www.dropbox.com/s/ezunnebwlu6zvgi/saves for KSPTOTConnect.1.output_log.txt?dl=0

Yes I have avast installed: Program version: 17.9.2322 (build 17.9.3761.278). I went to settings - general - exclusions and added the folder that KSPTOT is in. I also went to settings - components - web shield - exclusions and added the process KSPTrajectoryOptimizationTool.exe.

No joy. I even temporarily disabled all avast shields. Still get the same error message.

I KSS + OPM. I searched my GameData folder with explorer for bodie.ini and got no result.

Can anyone help me?

Whoops, never even thought to look for a KSPTOTConnect log: https://www.dropbox.com/s/vskjo7e4lpdhdqk/saves for KSPTOTConnect.1.ksptot.log?dl=0

Does this help?

Link to comment
Share on other sites

On 2/3/2018 at 9:25 PM, adamcullen said:

Is there any way to get KSPTOT 1.5.9 as a MATLAB source?  I have Matlab R2017b and don't really want to have to install the runtime alongside it.

OK, now that I've found the source code and have it running in Matlab, I'm getting an error when trying to plot a porkchop plot.

Quote

Undefined function or variable 'CustomStartPointSet'.

Error in findOptimalDepartArrivalFromPorkChop (line 32)
    tpoints = CustomStartPointSet(ptmatrix);

Error in generatePorkChopPlot (line 80)
            [arrivalUT, departUT, dv] =
            findOptimalDepartArrivalFromPorkChop(ypos*(secInDay),
            xpos*(secInDay), departBodyInfo, arrivalBodyInfo, gmu,
            options.quant2opt, departTimeArr, arrivalTimeArr);

Error in mainGUI>testPorkChopper_Callback (line 376)
        generatePorkChopPlot(handles.mainGUIFigure);

Error in gui_mainfcn (line 95)
        feval(varargin{:});

Error in mainGUI (line 42)
    gui_mainfcn(gui_State, varargin{:});

Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)mainGUI('testPorkChopper_Callback',hObject,eventdata,guidata(hObject)) 
Error while evaluating UIControl Callback.

Does anyone know why the CustomStartPointSet variable doesn't want to play nicely?

Thanks

Adam

Link to comment
Share on other sites

I somehow have trouble with the n-body coast not detecting SOI transitions. I do an escape burn and an n-body coast and i keep "orbiting earth". Replace n-body coast with normal coast and everything works, eg orbiting sun or orbiting venus after i optimize the plan to find a venus encounter.

Also, the selective SoI search dialog behaves weirdly, when i select something, close the dialog, open it again, everything is reset to everything selected, in the case of n-body coast it is reset to everything but the gravitational bodies selected.

Link to comment
Share on other sites

When I try to load an orbit from SFS, I get a chord sound and this error in the log:

 

Expected one output from a curly brace or dot indexing expression, but there were 10 results.

Error in parseSFSForOrbits (line 40)


Error in importOrbitGUI>importOrbitGUI_OpeningFcn (line 126)


Error in gui_mainfcn (line 220)


Error in importOrbitGUI (line 40)


Error in orbitPanelGetOrbitFromSFSContextCallBack (line 8)


Error in rendezvousGUI>getINIOrbitFromSFSFile_Callback (line 855)


Error in gui_mainfcn (line 95)


Error in rendezvousGUI (line 42)


Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)rendezvousGUI('getINIOrbitFromSFSFile_Callback',hObject,eventdata,guidata(hObject))

Error using waitforallfiguresclosed (line 9)
Error while evaluating Menu Callback.

 

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...