kebhr / scratch3-tello

Let's fly Tello with Scratch 3.0 !
https://scratch3-tello.app/
Other
86 stars 34 forks source link

Repeating tello commands if tello fails to execute them #27

Open zolnayag opened 9 months ago

zolnayag commented 9 months ago

Dear Kanta Ebihara

Thank you for publishing your Scratch3 tello extension. It must have been a lot of work to figure out how to control the tello drone from scratch.

I use your scratch tello extension to teach programming at a primary school in the Netherlands. During the coding workshops, kids have to program some maneuvers or try to find and land on a mission pad automatically.

Sometimes my tello drones fails to perform a command at the first time. However, when I send the same command again a few seconds later, it is performed as expected. I have found a nice idea in this python library (https://github.com/damiafuentes/DJITelloPy): commands are repeated if tello fails the execute them.

I have tried to add repeating of tello commands to the scratch3 tello extension. Similar to the scratch "Wait X sec" block, the tello blocks are also waiting until tello confirms a command with "ok". If tello does not reply within 7-10sec or answers with an error message, then the command is sent again to the drone. The code makes use of the scratch util.yield() function, which ensures that the scratch even loop keeps on calling the code of the tello block, until it succeeds.

I thought, you might find the code interesting. Feel free to download it here:
scratch3_tello.zip

Please do not hesitate to reply if you have any comment or question on the code.

Best regards, Andreas Zolnay