Board index FlightGear Support Interfacing

Wrong data output using generic protocol

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

Wrong data output using generic protocol

Postby hofiisek » Tue Oct 02, 2018 4:01 pm

Hello,

I am having an issue when retreiving data (heading in particular) from FG using Generic IO protocol.
I firstly used telnet to retreive data from FG, which still works fine, however the frequency in which telnet is able to deliver data is ca. 180ms (in my case).
So, I thought I might want to try generic protocol to see if it's not faster. Actually it is, but delivers wrong data, especially heading.

Here is how my FG command line looks line:
Code: Select all
fgfs --telnet=foo,bar,62,foo,9000,bar
fgfs --generic=socket,out,62,localhost,8000,udp,fg_to_uav_generic_protocol
fgfs --httpd=5400


For both generic and telnet protocols, I've chosen 62hz frequency since it equals cca. 16ms, which is the frequency that my simulation asks FG for data.

and this is how my protocol looks like:
Code: Select all
<?xml version="1.0"?>
<PropertyList>
<generic>
   <output>
      <binary_mode>true</binary_mode>
      <line_separator>newline</line_separator>
      <var_separator>tab</var_separator>
       <chunk>
         <name>heading degrees</name>
         <node>/orientation/heading-deg</node>
         <type>float</type>
         <format>%03.6f</format>
       </chunk>
.... altitude, longitude, etc. follows


The issue is that headings retrieved using telnet and generic protocol are not the same at all, as seen in my console output.
Code: Select all
GENERIC retrieved heading:81.2676
GENERIC retrieved heading:81.278076
TELNET retrieved heading:24.497282
GENERIC retrieved heading:81.28856
TELNET retrieved heading:25.104437
GENERIC retrieved heading:81.29905
GENERIC retrieved heading:81.31303
TELNET retrieved heading:25.870789
GENERIC retrieved heading:81.32352
TELNET retrieved heading:26.714748
GENERIC retrieved heading:81.334015
GENERIC retrieved heading:81.34801


Heading retrieved by telnet is quite the same as heading displayed in primary flight display in FG User interface, however heading delieved by generic is completely different..
Is there any explanation why is this happening?

Thanks in advance!
hofiisek
 
Posts: 4
Joined: Fri Aug 10, 2018 7:10 pm

Return to Interfacing

Who is online

Users browsing this forum: No registered users and 3 guests