SDK Question Matlab and Orbiter

MeeexC

Member
Joined
Nov 19, 2011
Messages
37
Reaction score
21
Points
8
Location
Ulm
Hi,

at the moment i'm working a lot with Matlab/Simulink building control systems for different scientific tasks. So I would like to build an autopilot system in Matlab for Orbiter. From launch to orbit over transfer to landing on moon.

How would you connect Matlab and Oribiter? Later it should be possible to build some sort of MFD or external program for the ship control.

So first I have 2 problems, how can I get the spacecrafts stateparameters online in matlab. Because I would like to code in matlab live, so i dont have to compile a working matlab function and integrate it in orbiter first for testing. And second how can I influence Orbiter from Matlab.

Best wishes
Max
 
Last edited:

Quick_Nick

Passed the Turing Test
Donator
Joined
Oct 20, 2007
Messages
4,088
Reaction score
204
Points
103
Location
Tucson, AZ
Hi,

at the moment i'm working a lot with Matlab/Simulink building control systems for different scientific tasks. So I would like to build an autopilot system in Matlab for Orbiter. From launch to orbit over transfer to landing on moon.

How would you connect Matlab and Oribiter? Later it should be possible to build some sort of MFD or external program for the ship control.

So first I have 2 problems, how can I get the spacecrafts stateparameters online in matlab. Because I would like to code in matlab live, so i dont have to compile a working matlab function and integrate it in orbiter first for testing. And second how can I influence Orbiter from Matlab.

Best wishes
Max
If you get the add-on "Orb:Connect" as well as some MATLAB/Simulink module for TCP communication, you might be able to work something out.

Orb:Connect is open source as well and there are a few forum threads of various ways people have utilized it.
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
I did a proof of concept connection between Orbiter and Matlab a long time ago. This consisted of an Orbiter plugin using the DDE (direct data exchange) protocol to transfer data to a running Matlab session in real time. I used this to send data from Orbiter to Matlab to plot telemetry data, but there is no reason why the link wouldn't work the other way as well.

DDE is obsolete these days, but may still be supported by Matlab. I don't have the code anymore, but it was just a quick hack written two hours before a presentation. It should be quite easy to write.

Orb:Connect is probably using a better supported network protocol, so this is definitely worth a look.
 

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
If you get the add-on "Orb:Connect" as well as some MATLAB/Simulink module for TCP communication, you might be able to work something out.

Orb:Connect is open source as well and there are a few forum threads of various ways people have utilized it.

NB remember to use this version: [ame="http://www.orbithangar.com/searchid.php?ID=6435"]Orb::Connect::Web 3.19[/ame]

it is backwards-compatible with 2.1 but has some bugs fixed.
 

lucianh

New member
Joined
Sep 1, 2016
Messages
1
Reaction score
0
Points
0
Hi guys ,
i have a problem with orb:connect and i would like to know if someone can help me with it.
I've build an autopilot for a moon lander in matlab/simulink and i would like to use orbiter for visual respersentation of the attitude. I want to send the euler angles to the ORBITER by orb:connect so fine so good. I manage to send the first euler angles and after that the Orbiter won't change the euler angles any more so i would like to know what's the posible reason for not being able to send more than one change to the euler angles.
Thank you.
with Respect Lucian H.
 

LoserSVK

New member
Joined
Apr 26, 2008
Messages
17
Reaction score
0
Points
0
Hello, Orbconnect looks great as you are able to control the orbiters simulation through TCP ip

Wondering if it is possible to switch physics off and use orbiter only for animations?

What about the real-time aspect when it comes to lets say ADCS. What delays we can see typically? Is it plausible to use matlab+orbiter for this simulation?

Thank You
 

Keithth G

New member
Joined
Nov 20, 2014
Messages
272
Reaction score
0
Points
0
Although I'm not trying to connect Matlab to Orbiter, I am trying to connect Mathematica to Orbiter. I have the web version of Orb::Connect installed and it works just fine in a browser.

But I am trying to connect via lower level HTTP PUSH requests as per the Orb::Connect documentation. This says that "if the client sends a POST request to /cgi with Orb::Connect
commands, these commands are passed to Orb::Connect core, and the result
is returned to the client".

OK, that all sounds fine and fairly straightforward. So, as a test, I have tried to construct an HTTP POST request to return the number of gravitating bodies in Orbiter. In Mathematica terms, this POST looks something like:


HTTPRequest[
"http://127.0.0.1:38888/cgi",
<|Method -> "POST",
"Body" -> "ORB:GBodyCount"
|>
]

Here, the URL is "http://127.0.0.1:38888/cgi"; the method is "POST" and the message body is "ORB:GBodyCount".

However, although the Orb::Connect HTTP server doesn't object to the form of this method (returning code 200 - Status OK), the HTTP server doesn't appear to respond with anything. Clearly, there is something wrong with my understanding of how to push this request through the server's mongoose CGI interface.

Does anyone know the proper syntax for the HTTP POST request?
 
Last edited:
Top