Celestia integration with MATLAB

Have a question about using Celestia? Check here first for FAQs and helpful advice.
Forum rules
Please help to make this forum more useful by checking the FAQs before posting! Keep it clean, keep it civil, keep it truthful, stay on topic, be responsible, share your knowledge.
Topic author
Dan80
Posts: 3
Joined: 21.09.2016
With us: 8 years 2 months

Celestia integration with MATLAB

Post #1by Dan80 » 21.09.2016, 08:51

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!

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

Post #2by Fenerit » 21.09.2016, 17:39

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
Never at rest.
Massimo

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #3by John Van Vliet » 21.09.2016, 18:21

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

Topic author
Dan80
Posts: 3
Joined: 21.09.2016
With us: 8 years 2 months

Post #4by Dan80 » 22.09.2016, 06:25

Thank you guys! Really appreciated!

Topic author
Dan80
Posts: 3
Joined: 21.09.2016
With us: 8 years 2 months

Post #5by Dan80 » 22.09.2016, 06:31

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

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #6by selden » 22.09.2016, 11:28

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
Selden


Return to “Help Central”