# Position query based on defined reference body

##### New member
I am trying to continuously record (and use) the position relative to the Moon in a scenario, where the gravity effect of the Earth and the Sun is not negligible (Distant Retrograde Orbit - DRO). In this situation I can still follow the orbit parameters relative to the Moon and to the Earth on the MDFs if I set the REF accordingly. Of course their predictions of the orbit are not accurate as both bodies will effect the orbit finally, but as a minimum the distance to the defined body (RaD) is always correct. However, if I ask the orbit parameters via LUA as...

orion = vessel.get_interface('orion') el,op = orion:get_elementsex() term.out(op)

... I will get back the orbit data as REF=Sun - probably because it is not only the Moon that effects the spaceship.

Is it possible somehow to query these data via LUA for a defined reference object? If not, can I get that data by programming a module or similar object in C++?

Last edited:

##### New member
I find useful information here in the help doc:
orbiter/Html/Main/Script/mtd_vessel.htm

Based on that I can ask for relative position:

orion = vessel.get_interface('orion') href=oapi.get_objhandle('moon') glob = orion:get_globalpos(href) equ = oapi.global_to_equ(moon,glob) term.out(equ.rad) )

I think, this is OK.

Last edited:

Replies
4
Views
375
Replies
4
Views
311
Replies
6
Views
409
Replies
13
Views
985
Replies
3
Views
481