Mike,
Have a look at docs-mini/README.IO for the specific command line syntax,
but yes, for task #1 you can setup FG to expect control inputs to come
in via an FGNetCtrls packet (which you can send from your remote java
application.) You can specify the rate at which FG checks for incoming
packets, but you can send the packets whenever you like and FG won't
complain.
Similarly you can setup FG to export the primary flight dynamics data
via the FGNetFDM structure.
The details of doing sockets in Java I'll have to leave up to others. :-)
There is also the "generic" protocol which I haven't used as much so I'm
less familiar with it. I believe you can set it up for both input and
output, but be aware that it sends data out in "ascii" rather than
binary, so you will have a small parsing task on the remote end if you
use the generic protocol. The generic protocol is really good for
things like exporting to a delimited ascii file for import into excel
for instance.
Regards,
Curt.
Mike Kopack wrote:
Hey gang,
I'm trying to write some Java code to interface with FlightGear's IO system
via sockets. I'm running on Windows (don't know if that matters or not.)
Anyhow, I need to do two things:
1) Have one socket sending flight commands (like changing the rudder
position, or turning on/off the autopilot, setting throttle, etc.) These can
come in at any time.
2) Have another socket that my code listens for periodic updates in status
information from FlightGear (position, attitude, engine temp, fuel flow
rates, etc.)
From what I see in the documentation, it shows that you can do this. I'm a
bit confused by it though.
To do task #1 above, do I just open a socket to Flightgear on the specified
port, then send a XML doc with just the 1 command element I want to specify?
To do task #2 above, as I understand it, I have to set up a XML file on the
machine running FG that basically tells FG what data I want sent back over
the socket. Does it come across the wire as an XML doc every x.x seconds (I
see that there's a Hz setting when specifying the socket connection in FG),
or does it come across as comma delimited or something like that?
Any help with this is greatly appreciated.
--
Curtis Olson http://www.flightgear.org/~curt
HumanFIRST Program http://www.humanfirst.umn.edu/
FlightGear Project http://www.flightgear.org
Unique text: 2f585eeea02e2c79d7b1d8c4963bae2d
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d