Closed pbag47 closed 2 years ago
Refactored archiecture (once again)
The main thread runs the setup, then runs the pygame loop (user input detection + pygame window update) until the stop signal, then runs the stop procedure. A separate thread is in charge of the reception of frames coming from the Tello. It puts them in a Last-in First-out queue to make them available to other threads. Another separate thread handles the image processing. A loop takes the most recent frame out of the LiFo queue and dismisses the outdated ones. It then detects markers and controls the UAV repeatedly until the stop signal.
This architecture allows for extensive image-processing features (or any other time-consuming computations) in real time without deteriorating the UAV responsiveness.
The simulator seems a bit laggier than before, but the real Tello is way better handled. (Tested in manual control mode with an xbox gamepad in the SMO6 flight zone)
The previous pull request merge did not work as intended and the previous issue #27 fix has been deleted