Q : Is there a way to use FlightGear to plot a course (waypoints) and have it output GPS to an autopilot as the simulated plane in FlightGear flies that course? Or even output GPS while you fly the plane in FlightGear manually?
For any flightgear flight (manually flown, flown on autopilot, etc.) you can continually output GPS sentences over a serial port. There is a command option that let's you choose exactly what you want to do:
It looks something like:
<protocol>=<channel>,<direction>,<hertz>,<channel_specific_options>
So if you wanted to output standard NMEA strings on COM1 at 1hz using 4800
baud, you would do this:
nmea=serial,out,1,COM1,4800
With this option activated, you can connect a variety of moving map applications, or a PDA, or just about anything else that is capable of connecting up with a gps and doing something. For instance, there is a palm pilot moving map application designed for flying and this can be slaved to a running
copy of FlightGear. Here's a video of that:
So you could plug a real gps into flightgear and have flightgear draw a 3d view based on the gps data.
Or you could slave one (or more) copies of flightgear to a single master copy (sending and receiving the data at 60hz over a network connection) and create a
multi-monitor distributed simulator system with a wrap around visuals.
That's what we've done here:
File input/output is also an option for this command so for another example you could fly some route, log the nmea/gps strings as you fly to a file (instead of sending them out a serial port), and then have that file to feed that back into your autopilot system later for testing and development.
This all might sound a bit crazy, but one of the design goals of FlightGear is
(as much as possible) to be open, flexible, and adaptable to new
situations. Exposing a variety of ways to send and receive data allows
FlightGear to be adapted to a huge variety of uses.
So just to summarize ...
OUTPUT:
FlightGear can be used to drive external moving maps, external gps's, even
other copies of FlightGear to create a multi-monitor wrap-around visual
configuration.
INPUT:
FlightGear can take input from a variety of sources so it can be slaved to an
external GPS or IMU outputting data in real time, it can be used to replay a
saved flight. I talked to an engineer that had ride in the back of a 767
with no windows and wanted to interface FlightGear to the live 767 systems so
he could see what was going on while he flew.
MULTIPLAYER:
Don't forget the FlightGear multiplayer system. If you are slaving
FlightGear to some external data source, but have the same copy of FlightGear
connected to the FG MP system, now suddenly you have the possibility of
injecting a real, live flight into the virtual FlightGear world and anyone else
logged onto the multiplayer system, can watch your real UAV fly in the virtual
world. They can come up and fly with you, etc. If you have multiple
uav's registered in the system they can all see each other in their respective
synthetic views, they can be highlighted/circled on the hud overlay, etc.
It's almost a little mind bending to think about, but it's all there and has
been succesfully demoed. Oh, and we have a google maps based multiplayer
map system, so if you do have your live UAV flight registered in the MP system
via a local running slaved copy of FlightGear, anyone with a web browser,
anywhere in the world can track your UAV live.
I don't know if all of these things are immediately useful to everyone (or may
never actually be useful for anyone) but sometimes you do things just because
they are cool and fun and because you can, and somewhere, someplace you hope
you've scored a couple geek points. :-)
[In our next installment of this series, we're going to drill down on connecting FlightGear to an IMU...]
Comments
I wonder if it can simulate other sensors as well (IR-based attitude-control or inertia meassurement) and
how to get the servo-output back into the simulator.