[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Users] orekit-7.0 called from matlab



Hi Ryan,

You might find it easier to transliterate your Matlab code to Python and go from there.  The Python wrapper includes easier use of the event handling.   

Here is a nice IPython notebook example of using events to change the attitude law:
http://nbviewer.ipython.org/urls/www.orekit.org/forge/projects/orekit-python-wrapper/repository/revisions/master/raw/examples/Example%20EarthObservation%20-%20Attitude%20Sequence.ipynb?create=1

If you haven't used Python yet, there is a learning curve but in many ways its can be just as fluid and 'fun' to use as Matlab.   If I were doing GN&C and flight algorithm design and need code generation I'd stick with Matlab/Simulink, but for orbit stuff Python/Orekit is looking pretty potent.  And you can still leverage the older, battle proven NAIF SPICE stuff (Fortan and/or C).

Being an old Matlab jedi, I've used Orekit in Matlab until recently.  I am transitioning to Python for running Orekit for several reasons including what you're running into.  The other reasons include the far better data structures and method dispatch performance in Python than in Matlab, not to mention going to an entirely open-source ecosystem.   

While I like using well-architected Java libraries (like Orekit!), I dislike writing Java myself compared to more fluid (dynamic!) languages including Matlab, Python, and most recently, Julia.

- MikeC

This e-mail and message, including all attachments, is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, or the employee, or agent responsible to the intended recipient, you are hereby notified that any disclosure, distribution, dissemination, downloading, copying, or taking of action based on the contents of this message is prohibited. If you have received this e-mail in error, please notify the sender of the e-mail, and delete the e-mail immediately from your computer.


On Feb 5, 2015, at 9:03 PM, Ryan Shepperd <ryan_shepperd@yahoo.com>
 wrote:

If I want to use the propagator in MasterMode or any of the event detections such as eclipse detection, I am wondering if it is possible from within Matlab.  I have not had a lot of success figuring out how to handle the event handlers from within Matlab and I note that the examples avoid such.  I am using the TLE propagator.  I am thinking it will be necessary for me to learn some more java and write a wrapper program in java to pass the results back to Matlab.  Any thoughts to the contrary?

Cheers,
Ryan


From: Ryan Shepperd <ryan_shepperd@yahoo.com>
To: "orekit-users@orekit.org" <orekit-users@orekit.org>
Sent: Wednesday, February 4, 2015 8:41 PM
Subject: Re: [Orekit Users] orekit-7.0 called from matlab

Christophe, thanks.  In hindsight, I should have clued in to the fact that a previous getInstance error had gone away.  Orekit 7 seems to be working fine from Matlab.  Along with Rami's ISSTracker example, the following was a good resource for learning what some of Matlab's cryptic errors could really mean: http://undocumentedmatlab.com/blog/java-class-access-pitfalls 

Ryan




From: Christophe LE BRIS <chris.lebris@gmail.com>
To: Ryan Shepperd <ryan_shepperd@yahoo.com>
Cc: "orekit-users@orekit.org" <orekit-users@orekit.org>
Sent: Monday, February 2, 2015 1:54 AM
Subject: Re: [Orekit Users] orekit-7.0 called from matlab

Hello,

The method getITRF2005 is no more available in Orekit 7 API (was deprecated in 6.1). The new method is "getITRF".

Christophe



----- Original Message -----
From: Ryan Shepperd <ryan_shepperd@yahoo.com>
Sent: 02/02/2015 - 04:04
To: Rami Houdroge <rami.houdroge@hotmail.com>
Subject: Re: [Orekit Users] orekit-7.0 called from matlab

> Rami,
> Thank you for checking.  Yes, I had made the change on line 142 and placed orekit-7.0.jar in the expected lib directory, and restarted matlab (to be sure the orekit-6.0 instance was gone).  I have the error pasted below, but I am running matlab R2014b on a slightly older version of MacOS (Darwin Kernel Version 11.4.2).  I do have access to the current version of matlab on Windows and the current and earlier versions on Linux, so I will check those out tomorrow and see if my inability to use orekit-7.0 within matlab is limited to an OS or matlab version as it sounds like it must.
> Cheers,Ryan
>
>    Retrieving ISS Orbital Data...
> The class org.orekit.frames.FramesFactory has no property or method named 'getITRF2005'.
>
> Error in getPropagator (line 68)
> orekitData.frames.ITRF2005 = FramesFactory.getITRF2005(false);
>
>
> Error in ISSTracker>main (line 203)
>         propagator = getPropagator(p, v, iD);
>
> Error in ISSTracker>ISSTracker_OpeningFcn (line 163)
> main(hObject, handles)
>
> Error in gui_mainfcn (line 220)
>     feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
>
> Error in ISSTracker (line 110)
>         gui_mainfcn(gui_State, varargin{:});
>
> Error in ISSTracker>warndlgCallback (line 119)
> ISSTracker;
>  
> Error while evaluating DestroyedObject Callback
>
>
>      From: Rami Houdroge <rami.houdroge@hotmail.com>
>  To: "ryan_shepperd@yahoo.com" <ryan_shepperd@yahoo.com>
> Cc: "orekit-users@orekit.org" <orekit-users@orekit.org>
>  Sent: Sunday, February 1, 2015 4:05 PM
>  Subject: RE: [Orekit Users] orekit-7.0 called from matlab
>
> <!--#yiv6245305787 .yiv6245305787hmmessage P{margin:0px;padding:0px;}#yiv6245305787 body.yiv6245305787hmmessage{font-size:12pt;font-family:Calibri;}-->Hi Ryan,



>
> For ISSTracker, loading Orekit 7.0 instead of 6.1 works well for me. The errors you mentioned don't occur. I'm using R2013a.
>
> Question : when you replaced the jar file, did you also change the ISSTracker.m script (line 142) ? You should tell it to load the new jar file.
>
> Note : You can also load Orekit into Matlab at startup. This means you won't have to tell Matlab to load the jar manually (javaaddpath). This is done by :
> - adding the jar file to the jarext folder 'Matlab root'/java/jarext
> - adding the jar path to the classpath located at 'Matlab root'/toolbox/local/classpath.txt
>
> Cheers,
>
> Rami
>
>
> From: chris.lebris@gmail.com
> Date: Wed, 28 Jan 2015 12:24:23 +0100
> To: orekit-users@orekit.org
> Subject: Re: [Orekit Users] orekit-7.0 called from matlab
>
> Hello,
> I don't have R2014b but calling Orekit 7.0 from Matlab 2013a works well for me.
> Christophe
>
> 2015-01-28 9:59 GMT+01:00 Houdroge Rami (THALES SERVICES) <Rami.Houdroge@cnes.fr>:
>
> Hi Ryan,
>
> I will look into upgrading ISSTracker to orekit 7.0 and will get back to you.
>
> Cheers,
>
> Rami Houdroge
>
>
> -----Original Message-----
> From: orekit-users-request@orekit.org [mailto:orekit-users-request@orekit.org] On Behalf Of ryan_shepperd@yahoo.com
> Sent: mercredi 28 janvier 2015 05:00
> To: orekit-users@orekit.org
> Subject: [Orekit Users] orekit-7.0 called from matlab
>
> I was trying to explore possible uses of orekit from within matlab but ran into problems trying to use the advice at https://www.orekit.org/forge/projects/orekit/wiki/Integration_in_Matlab with orekit-7.0.jar and Matlab R2014b.  I get errors like
>
> Undefined variable "DataProvidersManager" or class "DataProvidersManager.getInstance".
>
> I am able to load and use orekit-6.0.jar using or following the example of "http://www.mathworks.com/matlabcentral/fileexchange/42733-isstracker-v1-0-0",
> which uses orekit-6.0.   Replacing orekit-6.0 with orekit-7.0 in isstracker
> resulted in the same error I have been encountering, so there seems to be something different that one must do to successfully load orekit-7.0 classes into matlab.
>
> I am happy I at least gained access to orekit-6.0 from within matlab.  I can at least take a look at the possibilities and maybe start to learn why my
> orekit-7.0 efforts failed.  However, I am very curious if anyone out there has been able to use orekit-7.0 from within a recent version of matlab.
>
>
>
>