JuliaSpace / GMAT.jl

Run NASA's General Mission Analysis Tool (GMAT) from Julia
MIT License
10 stars 0 forks source link

Loading gmat script fails #1

Closed loicspace closed 7 years ago

loicspace commented 7 years ago

Hi!

First of all, thanks for the package! I'm also going to start using the JPLephemeris one and likely Astrodynamics.jl as well. I do run into an error, I think I must be missing something silly:

julia> file = joinpath(GMAT.BASE, "samples", "Ex_HohmannTransfer.script") "/home/loic/.julia/v0.5/GMAT/src/../deps/GMAT/R2016a/samples/Ex_HohmannTransfer.script"

julia> GMAT.load(file) 0

julia> file = joinpath(GMAT.BASE, "Ex_HohmannTransfer.script") "/home/loic/.julia/v0.5/GMAT/src/../deps/GMAT/R2016a/Ex_HohmannTransfer.script"

julia> GMAT.load(file) ERROR: GMAT Error: The script Ex_HohmannTransfer.script failed to load. in (::GMAT.##3#4{String})() at /home/loic/.julia/v0.5/GMAT/src/GMAT.jl:53 in cd(::GMAT.##3#4{String}, ::String) at ./file.jl:59 in load(::String, ::String) at /home/loic/.julia/v0.5/GMAT/src/GMAT.jl:51 in load(::String) at /home/loic/.julia/v0.5/GMAT/src/GMAT.jl:63

I of course copied the gmat script from the samples folder one level up. I seem to be getting the same error if the gmat script is not in that particular folder, which does not seem right.

Thanks, Loic

helgee commented 7 years ago

Hi Loic, thanks for your interest in the package! It is still very experimental and does not do much, yet.

Regarding your problem: I just found out that GMAT refuses to load scripts which are not located in a folder with the same parent as GMAT's bin folder, e.g.

I think I will modify the load function to copy the script to a temporary directory in the GMAT folder. The GMAT C API is generally quite finicky and barely documented, for exampe I have not been able to query the simulation state from Julia, yet.

Would you be interested to tell me what your use cases are? This would give me some hints in which direction I should take the further development of my libraries.

helgee commented 7 years ago

This should work now!

loicspace commented 7 years ago

Thanks! It does work fine! Good catch -- I didn't know that either about GMAT.

As for my use of it, the immediate project I'm working on is earth many-satellite constellation performance analysis. I'm using your package to essentially use GMAT as a high-fidelity propagator (sph. harmonics + srp + drag + other bodies) within Julia (I'm coding a Julia function that generates the GMAT script for each sat in the constellation) rather than developing my own from scratch. And so, I plan on using the JPLepehemeris package to read into Julia the spice kernels I have GMAT create for each satellite in the constellation.

As for Astrodynamics.jl, I am also involved in other interplanetary mission design projects and these may be helpful there. I am actually using your Dopri package to do three-body problem trajectory design in the martian system. I'd be happy to keep in touch, I plan on using Julia for astrodynamics more and more, and chart more about these topics