FlightGear Route Manager

Matlab functions accessing FlightGear to remotely control an aircraft's route and track its position
2.5K Downloads
Updated 16 Aug 2009

View License

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.

Cite As

Johann Schweikl (2024). FlightGear Route Manager (https://www.mathworks.com/matlabcentral/fileexchange/25047-flightgear-route-manager), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0