Skip to content
Snippets Groups Projects
Commit 0ea7c0f9 authored by RIBEIRO-LUSTOSA Leandro's avatar RIBEIRO-LUSTOSA Leandro
Browse files

fixed UDP conventions for working with both real and sim Tellos

parent 8c3a598f
No related branches found
No related tags found
No related merge requests found
No preview for this file type
%% final script for tello landing
% open udp socket for communication with Tello drone (sim AND real)
u_lb = udp('127.0.0.1', 8889);
u_dr = udp('192.168.10.1', 8889);
fopen(u_lb);
fopen(u_dr);
% send command to get tello ready to receive commands
fwrite(u_lb,'command');
fwrite(u_dr,'command');
% send command to takeoff
fwrite(u_lb,'land');
fwrite(u_dr,'land');
% close socket so that simulink or other software can use it
clear u_lb;
clear u_dr;
%% initialization script for tello takeoff %% initialization script for tello takeoff
% open udp socket for communication with Tello drone (sim or real) % open udp socket for communication with Tello drone (sim AND real)
u = udp('127.0.0.1', 8889); u_lb = udp('127.0.0.1', 8889);
fopen(u); u_dr = udp('192.168.10.1', 8889);
fopen(u_lb);
fopen(u_dr);
% send command to get tello ready to receive commands % send command to get tello ready to receive commands
fprintf(u,'command\n'); fwrite(u_lb,'command');
fwrite(u_dr,'command');
% send command to takeoff % send command to takeoff
fprintf(u,'takeoff\n'); fwrite(u_lb,'takeoff');
fwrite(u_dr,'takeoff');
% send command to request video stream % send command to request video stream
fprintf(u,'streamon\n'); fwrite(u_lb,'streamon');
fwrite(u_dr,'streamon');
% close socket so that simulink or other software can use it % close socket so that simulink or other software can use it
clear u; clear u_lb;
clear u_dr;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment