Skip to main content
. 2024 Feb 7;10:e1759. doi: 10.7717/peerj-cs.1759
20: decode the data received from the client_socket
21: if no data received, break the loop
22: get lat and lon converting to float
23: calculate pan_angle and tilt_angle, calculate_angles function
24: set the servo position for pan and tilt angles
25: print latitude, longitude, pan angle, and tilt angle
26: create a Tello object
27: connect to the Tello drone
28: start streaming video from the drone
29: create a server socket
30: bind the server to all interfaces and port 12345
31: set the server to listen for connections
32: print “Server listening for connections...”
33: while true do
34: accept a new client connection
35: print the client address
36: call handle_client function with the client socket
37: close the client socket
38: end while