From: Bruce J. <br...@ja...> - 2014-01-29 20:40:32
|
Date: Wed, 29 Jan 2014 17:02:51 +0100 (CET), Anders Gidensta <and...@gi...> wrote: > > > On Wed, 29 Jan 2014, Jon S. Berndt wrote: > >> Would it be possible to use net_fdm to send named properties over to >> FlightGear? > > IIRC net_fdm is just a fixed format packet. Changing that would be a major > change and would need measures to preserve backwards compatibility. > > The quickest way to your goal with least (if any) source changes would be > to switch to a generic protocol - with a JSBSim output specification you > should be able to stream a comma separated list of states (rows) to FG. > You then set up the generic protocol for FG to take each element in the > rows and put it in the right FG property. > > This way the set of properties to transfer would be defined by XML files > both on the JSBSim and on the FG side. Jon, That's how we're driving FG for the same project you're working on: custom protocol. We've made up an arbitrary property tree hierarchy and are shoveling control deflections and other bits into those properties; on the other end, we're using those properties to drive a custom HUD, and I guess Gene H's 3D model is doing the same thing for control deflections. In our custom protocol XML file, items like this appear: <!-- Upper left body flap deflection --> <chunk> <name>ulbf-pos-norm</name> <node>/surface-positions/ulbf-pos-norm</node> <type>double</type> </chunk> and <!-- Outer glideslope flight path angle, deg --> <chunk> <name>ogs-gamm-deg-hud</name> <node>fcs/ogs-gamma-deg-hud</node> <type>double</type> </chunk> The first chunk is used by the 3D model, and the second by my custom HUD (which required a custom HUD.xml file and some mods to HUD.cpp) To hook up the surface deflections, a custom XML file for the aircraft that included things like: <PropertyList> <path>DC.ac</path> <!-- this is the exterior geometry file --> <animation> <type>rotate</type> <object-name>ul</object-name> <!-- I expect this matches some geometry structure name in the .ac file --> <property>/surface-positions/ulbf-pos-norm</property> <!-- matches protocol property list tree --> <offset-deg>0</offset-deg> <center> <x-m>12.052</x-m> <y-m>-1.402</y-m> <z-m> 3.576</z-m> </center> <axis> <!-- I assume this is the rotation axis --> <x>0</x> <y>1</y> <z>0</z> </axis> </animation> . . . </PropertyList> Give me a call or text and I can try to share the details. -- Bruce |