Code covered by the BSD License
-
[lat_deg, lon_deg, alt_ft, gn...
[LAT_DEG, LON_DEG, ALT_FT, GND_ELEV_M, HEAD_DEG, PITCH_DEG,
-
[wp_dist_m]=get_wpdist(host, ...
[WP_DIST_M]=GET_WPDIST(HOST, PORT)
-
[wp_lat_deg, wp_lon_deg, wp_a...
[WP_LAT_DEG, WP_LON_DEG, WP_ALT_FT]=GET_WP(WP, HOST, PORT)
-
[wp_stack]=get_wpstack(host, ...
[WP_STACK]=GET_WPSTACK(HOST, PORT)
-
activate_ap(speed, host, port...
ACTIVATE_AP(SPEED, HOST, PORT)
-
add_wp(lon_deg, lat_deg, alt_...
ADD_WP(LON_DEG, LAT_DEG, ALT_FT, HOST, PORT)
-
change_view(viewno, host, por...
CHANGE_VIEW(VIEWNO, HOST, PORT)
-
clear_rt(host, port)
CLEAR_RT(HOST, PORT)
-
delete_wp(pos, host, port)
-
insert_wp(lat_deg, lon_deg, a...
INSERT_WP(LAT_DEG, LON_DEG, ALT_FT, POS, HOST, PORT)
-
pop_wp(host, port)
-
speedup_fg(sp, host, port)
-
tsim=get_simtime(host, port)
-
View all files
from
FlightGear Route Manager
by Johann Schweikl
Matlab functions accessing FlightGear to remotely control an aircraft's route and track its position
|
| [wp_dist_m]=get_wpdist(host, port)
|
function [wp_dist_m]=get_wpdist(host, port)
% [WP_DIST_M]=GET_WPDIST(HOST, PORT)
%
% Read distance WP_DIST of aircraft from current waypoint in
% Flightgear over socket connection (HOST, PORT).
% Run Flightgear on HOST (e.g. '127.0.0.1' = localhost) with
% parameter "--props = PORT".
import java.net.Socket
import java.io.*
fg_socket = Socket(host, port);
out = PrintWriter(fg_socket.getOutputStream(), true);
in = BufferedReader(InputStreamReader(fg_socket.getInputStream()));
% waypoint distance meter
out.println(sprintf('get /autopilot/route-manager/wp/dist\r\n'));
wp_dist_m_str = char(in.readLine());
j = findstr(wp_dist_m_str,'''');
%Conversion from sea miles (nm) to meter
wp_dist_m = str2double(wp_dist_m_str(j(1)+1:j(2)-1)) * 1852;
out.close();
in.close();
fg_socket.close();
end
|
|
Contact us at files@mathworks.com