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
|
| activate_ap(speed, host, port)
|
function activate_ap(speed, host, port)
% ACTIVATE_AP(SPEED, HOST, PORT)
%
% Activate Autopilot in Flightgear over socket connection (HOST,
% PORT) and set target speed = SPEED [mph].
% 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);
% activate autopilot
out.println(sprintf(...
'set /autopilot/locks/altitude altitude-hold\r\n'));
out.println(sprintf(...
'set /autopilot/locks/heading true-heading-hold\r\n'));
out.println(sprintf(...
'set /autopilot/locks/speed speed-with-throttle\r\n'));
% set target speed (convert mph to knots)
out.println(sprintf(...
'set /autopilot/settings/target-speed-kt %d\r\n',speed*0.869));
out.close();
fg_socket.close();
end
|
|
Contact us at files@mathworks.com