Board index FlightGear Support Interfacing

Drive OzRunways on iPad with FGFS

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

Drive OzRunways on iPad with FGFS

Postby mnewbery » Fri Dec 30, 2016 6:24 am

I did it using configuration only!

Anyone interested?
mnewbery
 
Posts: 9
Joined: Wed Dec 28, 2016 8:54 am

Re: Drive OzRunways on iPad with FGFS

Postby mahela007 » Fri Jan 13, 2017 6:30 pm

what do you mean by Drive OzRunways?
mahela007
 
Posts: 41
Joined: Sat Nov 02, 2013 8:35 am
OS: Linux Mint 18

Re: Drive OzRunways on iPad with FGFS

Postby wlbragg » Fri Jan 13, 2017 9:34 pm

Sure we're interested!
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Drive OzRunways on iPad with FGFS

Postby mnewbery » Thu Feb 09, 2017 4:36 am

Drive as in use FGFS to output a binary UDP stream that makes OzRunways think its listening to valid binary data from a different simulator and have the moving map display on the iPad show the data
Last edited by mnewbery on Thu Feb 09, 2017 4:57 am, edited 1 time in total.
mnewbery
 
Posts: 9
Joined: Wed Dec 28, 2016 8:54 am

Re: Drive OzRunways on iPad with FGFS

Postby mnewbery » Thu Feb 09, 2017 4:39 am

This is the protocol to use. It references some new config constants in preferences.xml

Code (XPlanoutput.xml): Select all
<?xml version="1.0"?>

<PropertyList>
<generic>
<output>
<binary_mode>true</binary_mode>
<byte_order>host</byte_order>
<var_separator></var_separator>
<line_separator></line_separator><!-- DATA0 = 68 65 84 65 60 -->


<chunk>
<name>XPlaneHeader0</name>
<type>float</type>
<node>/constants/XPlaneHeader</node><!-- DATA-->
</chunk>
<chunk>
<name>XPlaneHeader1</name>
<type>bool</type>
<node>/constants/DefaultZero</node><!-- 0 -->
</chunk>

<chunk>
<name>XPlaneFieldIndex18Header</name>
<type>float</type>
<node>/constants/Header18</node>
</chunk>

<chunk>
<name>pitch</name>
<type>float</type>
<!-- we could just put 0 0 0 0 in here-->
<node>/orientation/pitch-deg</node>
</chunk>

<chunk>
<name>roll</name>
<type>float</type>

<node>/orientation/roll-deg</node>
</chunk>

<chunk>
<name>heading-true</name>
<type>float</type>
<node>/orientation/heading-deg</node>
</chunk>

<chunk>
<name>heading-mag</name>
<type>float</type>
<node>/orientation/heading-magnetic-deg</node>
</chunk>

<chunk>
<name>magnetic-compass-display</name>
<type>float</type>
<node>/instrumentation/magnetic-compass/indicated-heading-deg</node>
</chunk>

<chunk>
<name>mag-variation</name>
<type>float</type>
<node>/environment/magnetic-variation-deg</node>
</chunk>

<chunk>
<name>blank1</name>
<type>float</type>
<node>/orientation/magnetic-variation-deg</node>
</chunk>

<chunk>
<name>blank2</name>
<type>float</type>
<node>/orientation/magnetic-variation-deg</node>
</chunk>

<!-- Position index is 20-->

<chunk>
<name>XPlaneFieldIndex20Header</name>
<type>float</type>
<node>/constants/Header20</node>
</chunk>

<chunk>
<name>latitude-deg</name>
<type>float</type>
<format>%.5lf</format>
<node>/position/latitude-deg</node>
</chunk>

<chunk>
<name>longitude-deg</name>
<type>float</type>
<format>%.5lf</format>
<node>/position/longitude-deg</node>
</chunk>

<chunk>
<name>altitude-ft-msl</name>
<type>float</type>
<node>/position/altitude-ft</node>
</chunk>

<chunk>
<name>altitude-ft-agl</name>
<type>float</type>
<node>/position/altitude-agl-ft</node>
</chunk>

<chunk>
<name>on-runway</name>
<type>float</type>
<node>constants/OnRunway</node>
</chunk>

<chunk>
<name>altitude-ft-ind</name>
<type>float</type>
<node>/instrumentation/altimeter/indicated-altitude-ft</node>
</chunk>

<chunk>
<name>latitude-deg-south</name>
<type>float</type>
<node>/position/latitude-deg</node>
</chunk>

<chunk>
<name>longitude-deg-west</name>
<type>float</type>
<node>/position/longitude-deg</node>
</chunk>

<!-- Velocity and track index 21-->
<chunk>
<name>XPlaneFieldIndex20Header</name>
<type>float</type>
<node>/constants/Header21</node>
</chunk>

<chunk>
<name>xM</name>
<type>float</type>
<node>/constants/xM</node>
</chunk>

<chunk>
<name>yM</name>
<type>float</type>
<node>/constants/yM</node>
</chunk>

<chunk>
<name>zM</name>
<type>float</type>
<node>/constants/zM</node>
</chunk>

<chunk>
<name>xMs</name>
<type>float</type>
<node>/velocities/east-relground-fps</node>
<factor>0.3038</factor>
</chunk>

<chunk>
<name>yMs</name>
<type>float</type>
<format>%.5lf</format>
<node>/velocities/down-relground-fps</node>
<factor>-0.3038</factor>
</chunk>

<chunk>
<name>zMs</name>
<type>float</type>
<format>%.5lf</format>
<node>/velocities/north-relground-fps</node>
<factor>0.3038</factor>
</chunk>

<chunk>
<name>dist-ft</name>
<type>float</type>
<node>/constants/DefaultZero</node>
</chunk>

<chunk>
<name>dist-nm</name>
<type>float</type>
<node>/constants/DefaultZero</node>
</chunk>

</output>

</generic>

</PropertyList>
mnewbery
 
Posts: 9
Joined: Wed Dec 28, 2016 8:54 am

Re: Drive OzRunways on iPad with FGFS

Postby mnewbery » Thu Feb 09, 2017 4:41 am

These are the constants to add into preferences.xml

Code (): Select all
<constants>

<XPlaneHeader type="float">13.26593</XPlaneHeader>

<DefaultZero type="bool">false</DefaultZero>

<OnRunway type="float">0</OnRunway>

<Header18 type="float">2.522337E-44</Header18>

<Header20 type="float">2.802597E-44</Header20>

<Header21 type="float">2.942727E-44</Header21>

<xM type="float">34280.1875</xM>

<yM type="float">-295.46466</yM>

<zM type="float">-51065.03125</zM>

</constants>
mnewbery
 
Posts: 9
Joined: Wed Dec 28, 2016 8:54 am

Re: Drive OzRunways on iPad with FGFS

Postby mnewbery » Thu Feb 09, 2017 4:56 am

For those who are scratching their heads, I have a word document that spells out what needs to be done. The header value is used as a binary start of message and 13.26593 (float) as a four byte array is 68 65 84 64. These values as ASCII spell DATA. The next byte is binary zero. So the first two chunks together are "DATA0". This tells the iPad listening on the generic protocol port that the rest of the data is to be used. Header 18 is 18 0 0 0 which when converted to a big-endian float becomes 2.52337 x 10 ^ -44. Some of the other fields are mandatory and need to be set to "something" which is the values for xM, yM and zM.

I wrote a tool that listened to valid data then attempted to decipher the 18, 20 and 21 fields. Once I got the tool working I knew I got the right output from FGFS because it would show the same values (e.g. same position, height, speed etc).

Anyone got anything else they want output, let me know and I will see what I can cook up.
mnewbery
 
Posts: 9
Joined: Wed Dec 28, 2016 8:54 am


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 5 guests

cron