API and LUA documents

ghrasko

New member
Joined
May 27, 2008
Messages
18
Reaction score
0
Points
1
Hi, could you please recommend me some good Orbiter API and LUA documents? I specifically would like to access the MDF of the Delta Glider. I have found some ad-hoc examples that works, but not a complete documentation.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
688
Points
203
The API documentation can found in Orbitersdk\Doc\.
 

ghrasko

New member
Joined
May 27, 2008
Messages
18
Reaction score
0
Points
1
The API documentation can found in Orbitersdk\Doc\.
Thanks, this is good, but only if I plan to program in C++. I am looking for the API description for LUA programming. This type:

orion = vessel.get_interface('orion')
el,op = orion:get_elementsex()
TimeToPeriapsis=op.PeT
 

kalral

New member
Joined
Nov 22, 2020
Messages
27
Reaction score
14
Points
3
Location
Germany
There is some documentation when we go through
Orbiter.exe or Orbiter_ng.exe -> Help(in bottom) -> Orbiter Scripting
1670949062780.png
Hope its helpful
 

ghrasko

New member
Joined
May 27, 2008
Messages
18
Reaction score
0
Points
1
There is some documentation when we go through
Orbiter.exe or Orbiter_ng.exe -> Help(in bottom) -> Orbiter Scripting
...
Hope its helpful

Yes, thanks. However, I cannot find info about <vessel>:get_elementsex() function. I found it in the Lua script interpreter code on GutHub. That writes that it returns info regarding the main gravity source. I would like to read the orbit data from one of the MFD-s in the DeltaGlider that is set to a specific planet as reference. Are those MFDs are DG specific and thus can't be reached from LUA?
 

ghrasko

New member
Joined
May 27, 2008
Messages
18
Reaction score
0
Points
1
My problem that I try to solve:
I am trying to set up a Distance Retrograde orbit (DRO) cca. 70 000 km around the Moon as the Orion capsule did it recently. It is a multiple body situation, where both the Moon and the Earth is effecting the capsule. I try to monitor the distance to the Moon (RaD) as the capsule passing the Earth - Moon line both in front and behind the Moon. This is not a closed orbit, a bit chaotic, so I have to check the RaD values continuously. Unfortunatelly the <vessel>:get_element() function seems to return the parameters relative to the Sun in this case. If I try an orbit near to the Moon, it passes the Moon related values. At the RDO, if I set REF=Moon on one of the MFDs in the DG, that shows me the RaD correctly on the screen. But I can't acces that from the LUA script.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Documentation is always the part that does not get enough love ;) I wrote some of the Lua wrappers for vessel class and some others back when we had "Orbiter BETA".
If you have a ZIP with Orbiter BETA, you can also find some documentation here: \Orbitersdk\doc\orbiter_lua.chm
The current OpenOrbiter might not build this file at the moment, but I might be wrong and it's in the artifacts.

EDIT: Just checked. The current builds of OpenOrbiter do not include that :(
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
EDIT: Just checked. The current builds of OpenOrbiter do not include that :(
That is true, but only because the github continuous integration scripts skip the documentation build (not all required tools are available on the CI servers, and it would take too long without providing much benefit for build-testing). However, anybody sufficiently interested in the documentation can still download the sources and build it for themselves. Just set the ORBITER_MAKE_DOC flag to True in CMake and make sure you have all required tools (OpenOffice, LaTeX, Doxygen). Htmlhelp (for generating chm) and LDoc (for generating Lua documentation) are already included in the repository.
 

ghrasko

New member
Joined
May 27, 2008
Messages
18
Reaction score
0
Points
1
Thanks @kuddel. The existing docs and the present LUA interpreter code on GitHub provides enough information as I see now. My main proble is what I had detailed a bit above, that it seems only a kind of "general" orbit data are available, not the ones displayed in the MFDs, where one could define the exact REF object. In my situation (DRO around Moon) the API returms Sun orbital parameters and not Moon based ones, though those can be seen on the MFD.
 
Top