[simpits-tech] FlightGear and Hardware

Manuel Bessler flightdeck at varxec.de
Mon Dec 15 21:46:31 PST 2003


Hi Al,

you here too :-)))


On Sat, Dec 13, 2003 at 01:30:05AM -0000, Al West wrote:
> Hi,
> I'm new here to the list so first of all a Big Hello from the UK.
> 
> I'm running flightgear and want to start building generic hardware
> using PIC
> chips and USB interface. However, I'm not too sure how flightgear
> interface
> with hardware. i.e. what is envolved in getting a button press to
> action
> something like flaps down or such like. 

Generally, you would interface the flightgear internals via the property
tree. Have a look at the files in the Network subdirectory of the
flightgear
source tree. There are a couple of easy to understand examples to study.
I've hacked together a networkable Joystick driver that way.
Its called JsClient.[ch]pp, currently only in CVS.
The bindings for the analog axes (button states are transmitted, but no
used yet on the flightgear side) are defined via the property tree.
eg. you want the first axis of the networked joystick to be mapped to
the speedbrake: you'd set /jsclient/axis[0] to
"/controls/flight/speedbrake"
The commandline to start fgfs would look like this:
fgfs ... --jsclient=socket,in,5,,16759,udp
--prop:/jsclient/axis[0]="/controls/flight/speedbrake"


> The design I've come up with gives 8 analogue inputs (10 bit
> resolution) and
> 20 digital inputs/outputs. I intend to make the design so you can have
> a
> number of these units connected at the same time.
> 
> However, I have not done anything with USB yet and don't know if
> common USB
> HID drivers for the OS will be enough.

If you want to use it as a virtual com port (VCP on windows,
/dev/ttyUSB* in Linux), USB should be no problem, except maybe for
debugging :-)

> If there is anyone out there who will be willing to speak to me with
> regards
> to this then I'd be very grateful.


Manuel
-- 
Opensource/Free Software: No Gates, No Windows



More information about the Simpits-tech mailing list