1.创建xml文件,命名为outfile.xml(名字随意),将下面代码写进去保存就好,
实时输出经纬度(输出)
<?xml version="1.0"?>
<PropertyList>
<generic>
<output>
<line_separator>newline</line_separator>
<var_separator></var_separator>
<binary_mode>false</binary_mode>
<!--经度-->
<chunk>
<name>lon</name>
<type>float</type>
<format>lon:%6.5f\r\n</format>
<node>/position/longitude-deg</node>
</chunk>
<!--纬度-->
<chunk>
<name>lat</name>
<type>string</type>
<format>lan:%6.5f\r\n</format>
<node>/position/latitude-deg</node>
</chunk>
</output>
</generic>
</PropertyList>
2.创建xml文件,命名为input.xml(名字随意),将下面代码写进去保存就好,
通过客户端发送指令实现起落架的收放,起落架默认是打开的为(true),收起来需发送false,将false转换为十六进制发出去就好,需以0a结尾
true十六进制为:747275650a;
false为:66616c73650a;
<?xml version="1.0"?>
<PropertyList>
<generic>
<input>
<line_separator>newline</line_separator>
<var_separator></var_separator>
<binary_mode>false</binary_mode>
<!--起落架-->
<chunk>
<name>undercarriage</name>
<type>string</type>
<format>%s</format>
<node>controls/gear/gear-down</node>
</chunk>
</input>
</generic>
</PropertyList>
3. 文件写好以后将其拷贝到flightgear安装目录下的data->Protocol文件夹内
4.启动flightgear,在其设置界面编写配置指令
socket:通信协议
out:输出
10:输出的频率为10hz
192.168.3.125:对方ip地址
8888:端口号
tcp:数据通信协议
outfile:上面编写的outfile.xml文件
配置好以后打开网络调试助手或者服务器,开始飞行就可以自动链接上了