Code covered by the BSD License  

Highlights from
FlightGear Route Manager

Be the first to rate this file! 7 Downloads (last 30 days) File Size: 7.96 KB File ID: #25047
image thumbnail

FlightGear Route Manager

by Johann Schweikl

 

16 Aug 2009

Matlab functions accessing FlightGear to remotely control an aircraft's route and track its position

| Watch this File

File Information
Description

The ZIP-file contains a library of Matlab functions to remotely control an aircraft's path in FlightGear:

activate_ap.m:
Activates Autopilot and sets target speed.

add_wp.m:
Adds waypoint/s (Latitude [deg], Longitude [deg], Altitude [ft]) after last entry of current route.

change_view.m
Changes view to view number n.

clear_rt.m:
Deletes all waypoints of the current route.

delete_wp.m:
Deletes waypoint n on the current route.

get_pos.m:
Reads aircraft position and orientation (Latitude [deg], Longitude [deg], Altitude [ft], Ground elevation [m], Heading [deg], Pitch [deg], Yaw [deg], Roll [deg]).

get_simtime.m:
Reads FlightGear's simulation time in seconds.

get_wp.m:
Reads waypoint n of the current route.

get_wpdist.m:
Reads distance of aircraft from current waypoint in sea miles and converts it to meters.

get_wpstack.m:
Reads number of remaining waypoints on the current route.

insert_wp.m:
Inserts waypoint/s (Latitude [deg], Longitude [deg], Altitude [ft]) at certain position of current route.

pop_wp.m:
Pops current waypoint.

speedup_fg.m:
Speeds up FlightGear's simulation speed by a factor.

The functions were written for the simulation of routing algorithms in Matlab. Functions for other purposes can be easily implemented by using the same type of socket connection.

In order to communicate with the flight simulator, FlightGear has to be started with the following command line options:

fgfs.exe -fg-root=SOME.PATH -fg-scenery=SOME.PATH -props=PORT-A -httpd=PORT-B

PORT-A is the port used for communicating with Matlab. With a web browser on the same machine, one can browse the FlightGear property tree when opening the following url:

http://localhost:PORT-B/

The httpd-option offers a similar interface as the props-option, but is more convenient for the manual assignment of state variables in FlightGear.

MATLAB release MATLAB 7.8 (R2009a)
Other requirements FlightGear (www.flightgear.org)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
flightgear Johann Schweikl 17 Aug 2009 10:56:44
flight simulator Johann Schweikl 17 Aug 2009 10:56:45
simulation Johann Schweikl 17 Aug 2009 10:56:45
socket connection Johann Schweikl 17 Aug 2009 10:56:45
route manager Johann Schweikl 17 Aug 2009 10:56:45
routing Johann Schweikl 17 Aug 2009 10:56:45
routing Ajay 22 Feb 2010 00:04:03

Contact us at files@mathworks.com