Code overview¶
BaseSocketis an abstract class providing the framework for the other socketsVideoSocketis a class that connects to the video streaming port of the telloStateSocketis a class that connects to the port where the state of the tello is continuously published and displays the stateCommandSocketis the class that creates and stores and manages the command queue and its execution, sends commands to the drone, waits for its response (if timeout set) and retries sending commands (if retries enabled)Telloclass is a wrapper class that instantiates a command, video and state socket as well as a joystick. As all commands are always sent via the command socket,Telloclass implements functions to convert the joystick inputs to commands and calls the function to send commands, ensuring that the joystick library is isolated- To ensure that the tello does not automatically land after 15 seconds (this is in the Tello firmware) a command of
rc 0 0 0 0is sent if no other commands have been sent. The timeout of this command can be set as required, and this feature can be activated/deactivated - The tello does not wait receive a response when an
rccommand is sent, regardless of whether the command is sent via joystick or autonomously Terminalis a class that opens up an xterm (install xterm before using) and allows command line input that sends the commands to the drone.
Notes¶
- Due to the asynchronous nature of the communication, the responses printed to the command might not be to the command state in the statement (for example in case the joystick was moved after a land command was sent, the statement would read
received response ok to command rc a b c dinstead ofreceived response ok to command land)