Hi all, I'm experimenting with head tracking and to get the data into FlightGear I want FlightGear to read a stream of binary UDP packets using the generic protocol capability. Since it currently only support binary protocols for output, I implemented some minimal support for binary input protocols.
I have put a patch and my example protocol here: http://www.gidenstam.org/FlightGear/HeadTracking/FlightGear/ Example of protocol xml description: <generic> <input> <binary_mode>true</binary_mode> <record_length>25</record_length> <chunk> <name>version field</name> <type>bool</type> <node>/sim/headtracking/updated</node> </chunk> <chunk> <name>heading-deg</name> <type>fixed</type> <node>/sim/headtracking/orientation/heading-deg</node> </chunk> <chunk> ... </input> </generic> Some known potential problems: - Currently record_length needs to be set, but it could compute the default length from the specified chunks. (A larger record_length could be used to skip data at the end of each packet). - I made the binary input mode assume network byte order since I needed that. However, the binary output mode use host byte order. I think this byte order should be configurable from the protocol xml description. - Maybe the read request for binary input should request exactly record_length bytes. (multiple records might returned otherwise?) UDP does not seem to do that but for other input methods it is most likely an issue. I'll update the diff tonight. Does anyone see other issues? Suggestions are welcome! Cheers, Anders -- --------------------------------------------------------------------------- Anders Gidenstam mail: anders(at)gidenstam.org WWW: http://www.gidenstam.org/FlightGear/JSBSim-LTA/ ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel