Board index FlightGear Support Interfacing

Ground track from properties tree

Connecting two computers, using generic protocol, connecting with Matlab?

Ground track from properties tree

Postby superlou » Tue Jan 31, 2017 1:19 am

I'm working on prototyping an app that needs the ground track of the aircraft. I've had a lot of luck getting FlightGear output over UDP thanks to some helpful posts here. In the properties tree, I found an entry for /orientation[0]/heading-deg, but I can't find something for ground track. Is that heading the direction the nose is pointing or the path the aircraft body is traversing?

I'm currently trying to use /velocities[0]/speed-north-fps and /velocities[0]/speed-east-fps and arctan to calculate the ground track. Is this a valid approach? Is there a more direct way to do this?

Thanks,
Louis
superlou
 
Posts: 20
Joined: Wed Sep 16, 2015 9:33 pm

Re: Ground track from properties tree

Postby yanes » Tue Jan 31, 2017 2:40 am

"The heading direction the nose is pointing to " is the magnetic heading (what you read directly from a Compass ).

"/orientation/heading-deg" indicates the True heading , this heading indication has all other factors included (such as wind , yaw ...etc.)
It indicates what you can read on GPS device ,
so may be this can fits for your app's inputs (depending on the case )
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 2:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: Ground track from properties tree

Postby superlou » Tue Jan 31, 2017 2:42 am

Ok, it's the direction you are moving relative to the ground? That sounds exactly like what I'm looking for. So the magnetic heading has both the errors for magnetic North vs. true North as well as crabbing/wind effects?
superlou
 
Posts: 20
Joined: Wed Sep 16, 2015 9:33 pm

Re: Ground track from properties tree

Postby AndersG » Tue Jan 31, 2017 6:18 am

Heading is the direction the aircraft is pointing - not necessarily the direction it is moving.
I know JSBSim has flight path properties in its subtree but I don't know if there are FDM independent ones. Look in /orientation/.
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Ground track from properties tree

Postby Torsten » Tue Jan 31, 2017 8:56 am

Simply collect /position/latitude-deg and /position/longitude-deg, connect those points and you have your ground track.

Torsten
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 648
Joined: Fri Feb 01, 2008 10:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux

Re: Ground track from properties tree

Postby Thorsten » Tue Jan 31, 2017 10:21 am

I've got the feeling there's different uses of 'groundtrack' here. Usually I'd understand that as 'the path the aircraft describes over the ground', and that's what Torsten's suggestion does.

It seems to me the OP is trying to get the course the aircraft flies over the ground.

I'm currently trying to use /velocities[0]/speed-north-fps and /velocities[0]/speed-east-fps and arctan to calculate the ground track. Is this a valid approach?


and that approach works to get it (I have the same issue in Shuttle entry guidance where heading is frequently 30-40 degrees different from course over ground, and I'm also using trigonometry on v-east and v-north ).
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Ground track from properties tree

Postby superlou » Tue Jan 31, 2017 2:28 pm

Image

I'm not sure I understand the difference between "the path the aircraft describes over the ground" and "the course the aircraft flies over the ground." In the diagram above, I'm looking for the red arrow, while I would naively think heading-deg would be the green arrow.

While using GPS deltas is feasible inside FlightGear, when we move to real hardware it's a very noise-susceptible approximation at low speeds, so I'm trying to avoid doing that.
superlou
 
Posts: 20
Joined: Wed Sep 16, 2015 9:33 pm

Re: Ground track from properties tree

Postby Thorsten » Tue Jan 31, 2017 3:27 pm

The path is a 1-dim manifold parametrizable as [x(t), y(t)], the course is an angle which can be cast as a 2-d vector - which is the normalized derivative of the path at any given time instance. :mrgreen: Confused now?

That's a path:

Image

and your arrow is a course.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Ground track from properties tree

Postby jtiseo » Tue Jan 31, 2017 3:29 pm

Looks like you want "Course Over Ground" (COG). See line 894 of http://api-docs.freeflightsim.org/flightgear/FGStateSpace_8h_source.html for it's calculation. I'm not sure if thats available in the property tree though.
jtiseo
 
Posts: 1
Joined: Tue Jan 31, 2017 3:25 pm

Re: Ground track from properties tree

Postby superlou » Tue Jan 31, 2017 6:50 pm

Thorsten, you are correct. I misread "path" and "course" as being interchangeable, which they are not. If the 1D manifold (curve?) is the path take over the ground, then I believe I want the "course." Since I'm only looking at small periods of times, I'm assuming the rotation of the earth under the aircraft is negligible.
superlou
 
Posts: 20
Joined: Wed Sep 16, 2015 9:33 pm

Re: Ground track from properties tree

Postby Thorsten » Tue Jan 31, 2017 7:08 pm

Since I'm only looking at small periods of times, I'm assuming the rotation of the earth under the aircraft is negligible.


I'm not sure what your application really is, so I can't say whether it matters. Aircraft are actually co-rotating with Earth because the atmosphere is (otherwise there'd be supersonic storms on the ground) - spacecraft are not. JSBSIm supplies inertial as well as co-rotating coordinates in case you need inertial course, YaSim does not. Shuttle entry guidance is largely atmospheric flight and is done in a co-rotating system, Shuttle launch guidance and orbital targeting is done in an inertial system and Earth rotation matters.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Ground track from properties tree

Postby Torsten » Tue Jan 31, 2017 9:07 pm

May be the property /orientation/track-deg is what you are looking for?
This is the flown course over ground base on the current position and the position of the previous frame (if change).
There is also /orientation/path-deg for the vertical path.
Those get computed in $FGSRC/src/FDM/flight.hxx lines 90++

Torsten
flightgear.org - where development happens.
User avatar
Torsten
 
Posts: 648
Joined: Fri Feb 01, 2008 10:22 pm
Location: near Hamburg, Germany
Callsign: offline
Version: next
OS: Linux


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 2 guests