Board index FlightGear Development Aircraft Autopilot and route manager

Aircraft coordinate information

Designing a stable autopilot is one of the hardest things. Need help?

Aircraft coordinate information

Postby emrcnort » Fri Oct 18, 2019 11:11 pm

Hi I'm new to FG yet. I need the coordinate information at the moment of move (not the latitude and longitude, but the x-y-z coordinates).
In this way, I can transfer the information I have acquired to a simulation game I wrote (with Unity3D). How do I get the x-y-z coordinates of the plane?
emrcnort
 
Posts: 5
Joined: Thu Oct 17, 2019 11:19 pm

Re: Aircraft coordinate information

Postby wkitty42 » Sat Oct 19, 2019 1:19 am

you can use several different protocols to query FG's property tree... everything accessible is in there...

for example, i wrote a python script that reads the AI craft and reports numerous items to me on the screen... it would be easy to add another section to it to read the x-y-z coords... the real question is how do you need to feed the data to your other simulation? my current method grabs JSON output and parses that... it could act as a proxy, i suppose, or it could just write the data to a file for your simulation to read... it really depends on what you want/need to do...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5695
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Aircraft coordinate information

Postby Thorsten » Sat Oct 19, 2019 8:12 am

I need the coordinate information at the moment of move (not the latitude and longitude, but the x-y-z coordinates).


In JSBSim they're exposed as (from memory) /fdm/jsbsim/position/ecef-x-ft (y,z) (assuming you mean earth-relative coordinates, inertial coordinates are /fdm/jsbsim/position/eci-x-ft (y,z).

In YaSim I don't really know.

But you can easily compute Kartesian coordinates from lat/lon/alt by some trigonometry.
Thorsten
 
Posts: 11065
Joined: Mon Nov 02, 2009 8:33 am

Re: Aircraft coordinate information

Postby emrcnort » Sat Oct 19, 2019 10:41 am

Thanks for your answers. I wiIl read the latitude / longitude data via UDP packets and convert it with trigonometry. I think i need to do some math research on this.
emrcnort
 
Posts: 5
Joined: Thu Oct 17, 2019 11:19 pm


Return to Autopilot and route manager

Who is online

Users browsing this forum: No registered users and 1 guest