Page 1 of 1

Celestia integration with MATLAB

Posted: 21.09.2016, 08:51
by Dan80
Hi everybody,

I'm new to Celstia and I am trying to figure it out if it is possible to interface MATLAB (used for attitude and orbit simulations) with Celestia (for visualization purposes). I found this guy actually made it (https://www.youtube.com/watch?v=kLJmx2JcyXE) but I was not able to find any details on how to load data computed in MATLAB in Celestia.

Any suggestion and/or references?

Thanks!

Posted: 21.09.2016, 17:39
by Fenerit
Hi! You can find an useful help here: https://en.wikibooks.org/wiki/Celestia

below you can see how Celestia does load trajectories files, they are simple text files and can be producted by MATLAB.
https://en.wikibooks.org/wiki/Celestia/Trajectories#SampledTrajectory

Posted: 21.09.2016, 18:21
by John Van Vliet
Celestia also uses the SPICE data for orbital data
-- i use this for almost everything

and there is a Matlab API
http://naif.jpl.nasa.gov/naif/toolkit_MATLAB.html

now i do not know if this also runs in Octave ( a gpl'ed clone of matlab)
so you might have to already have a paid for and valid license for matlab

but using matlab to calculate orbits looks like adding a extra unneeded level of complexity

for the NAIF spice instructions in celestia see:
http://forum.celestialmatters.org/viewforum.php?f ... 849c53323c93faaa999a77df23614d

-- i am a bit over do for updates on that forum




that video is using the Juno xyzv files created from the spice kernels
( there is a program in the src folder of the celestia source code to convert the spice bsp files to a xyzv text file
and just using a *.m file to pass options to celestia -- like using a cel: url
---- this is where juno is now using the whole solar system spice

Code: Select all

cel://Follow/Sol:JunoSpaceCraft/2016-09-21T18:34:07.25765?x=AMCh20+eMOY&y=ANMIxDrImh0&z=ACisdkU5PzT//////////w&ow=0.586084&ox=-0.0296566&oy=-0.808194&oz=-0.0494896&select=Sol:JunoSpaceCraft&fov=34.1133&ts=1&ltd=0&p=0&rf=4069303&lm=10468&tsrc=0&ver=3

Image


i added Juno to the spice forum
http://forum.celestialmatters.org/viewtopic.php?f=18&t=846

Posted: 22.09.2016, 06:25
by Dan80
Thank you guys! Really appreciated!

Posted: 22.09.2016, 06:31
by Dan80
but using matlab to calculate orbits looks like adding a extra unneeded level of complexity

We use MATLAB to write our own GNC code for AOCS, I'd like to use Celestia only to show the results of my algorithms in a more graphical way than simple plots, which speaks more than 1000 words to engineers but do not impress non technical people.

One last questions: besides trajectories, can Celestia get attitude data as input as well in a similar way?

Thank you very much

Posted: 22.09.2016, 11:28
by selden
You might want to consider adapting OpenSimKit instead of recreating the features you want from scratch.

While Celestia does include a "planetographic" coordinate system which makes use of altitude, you'd probably have to write a "scripted orbit" in order to use it with arbitrary, changing values. A scripted orbit can use whatever positioning algorithm is appropriate. For example, one could be written to read positions in realtime so Celestia wouldn't have to be restarted each time a new trajectory file was created.

These features have been implemented for Celestia's use in OpenSimKit. See http://opensimkit.org/ and http://opensimkit.org/resources/FCXNL-10A08-1864803-1-1864803witt.pdf