Hello Tello Pilot!
Join our DJI Tello community & remove this banner.
Sign up

Tello Python Programming (How to do Obstacle avoidance combination?)

Muppet Party

Member
Joined
Apr 9, 2021
Messages
6
Reaction score
3
Hello, I am new to Tello programming and my Python knowledge is not very strong.

I have recently programmed my Tello using Python (Pycharm) for object detection and avoidance using Yolov3, as well as programmed RC controls to move the drone (like a planned flight route). Currently, I am able to combine these 2 programs into 1, which means when I run the codes my drone is able to detect & avoid obstacles and follow the planned flight route I set. However, it can only do one thing at a time. For example, if it is following the RC controls, it will not detect the object and vice versa.

But I want both of them to be integrated, like when it is following the planned route, it will avoid any obstacles in its way, and continue flying on its flight route.

Is this possible to program using Python? Thank you!
 
Last edited:

Dan

Well-known member
Joined
Feb 20, 2020
Messages
129
Reaction score
56
Hello
You are probably further than we are in this kind of programming. We have done some programming in Python using a Raspberry Pi. it seems that the drone and UDP communication is designed to only use a single stream of code, that needs a wait time before the next command will function. We have a fe of the Robomaster TT extension kits and Robomaster Tello Talents. it may work with the Arduino programming, as this system now use 5.9 bands also, and not just the 2.4Hz ( n WiFi protocol ) We need to do more testing. This might be a good test, as we have not started using the Arduino yet. You could send us the code to play with and test if you wish. Sounds like a good project. Good luck.
 
  • Like
Reactions: hari lachu

hari lachu

Member
Joined
May 8, 2020
Messages
5
Reaction score
1
Hey, that's wonderfull. I too wanna do object detection and avoidance for really a long time. Can you kindly guide me?
 

strat-o

New member
Joined
Jun 21, 2021
Messages
2
Reaction score
0
The question I have is when an obstacle is encountered, what would you want to do? Stop and land or try to get around it so that you can continue with your route? You might have to make some assumptions that aren't always true. One assumption you might make is to gain altitude until you can fly over the obstacle but that won't always work.
 

Muppet Party

Member
Joined
Apr 9, 2021
Messages
6
Reaction score
3
Hey, that's wonderfull. I too wanna do object detection and avoidance for really a long time. Can you kindly guide me?
Hello, we followed the yolov3 object detection tutorial (free) from

For the avoidance part, we created an 'if else' statement under their 'for' loop for selected objects and programmed the drone to move away (left/right) using RC controls. Which looked something like:

1624703901324.png

It is not perfect, but it works fine for me. Hope this helps!
 

Muppet Party

Member
Joined
Apr 9, 2021
Messages
6
Reaction score
3
Hello
You are probably further than we are in this kind of programming. We have done some programming in Python using a Raspberry Pi. it seems that the drone and UDP communication is designed to only use a single stream of code, that needs a wait time before the next command will function. We have a fe of the Robomaster TT extension kits and Robomaster Tello Talents. it may work with the Arduino programming, as this system now use 5.9 bands also, and not just the 2.4Hz ( n WiFi protocol ) We need to do more testing. This might be a good test, as we have not started using the Arduino yet. You could send us the code to play with and test if you wish. Sounds like a good project. Good luck.
Thank you! Its nice to know that we are trying to program something that is not widely used/known yet. I will upload the txt files of my codes, but here is a rough guide on each of those files.

Combining avoidance and flight path: This is the program where I tried to unsuccessfully combine the 2 object avoidance & pre-planned flight route together.

SkeletonYolo: This file contains the code to object avoidance, but it is used to link the code for the object avoidance into the first file (preplanned flight route).

The problem I am facing with these 2 codes is that when I run the first file, it calls the function from the second file before letting me input my options for the planned flight route. Which means I am able to avoid objects, but after it finishes avoiding, it asks me to input my flight route, which is quite frustrating.

Please note that I used Pycharm for all my programming and not Arduino or Raspberry Pi. And if you managed to make it work, could you please let me know as I am very curious to find out, be it programming on Arduino/RaspberryPi/Pycharm or any other platforms.

Thank you so much for your comment!
 

Attachments

  • Combining avoidance and flight path.txt
    830 bytes · Views: 9
  • SkeletonYolo.txt
    3 KB · Views: 5
  • Like
Reactions: Mike Shock

Muppet Party

Member
Joined
Apr 9, 2021
Messages
6
Reaction score
3
The question I have is when an obstacle is encountered, what would you want to do? Stop and land or try to get around it so that you can continue with your route? You might have to make some assumptions that aren't always true. One assumption you might make is to gain altitude until you can fly over the obstacle but that won't always work.
Hello, I think I would like for my Tello to fly above the object and move forward after. Because right now if i make it move to the side, it might be off course and would not land where i want it to.

If it is possible to make it go around and still be on its route, I would be more than happy for it to do that haha. But, i think having it fly above the obstacle would work fine for me as I am just playing around with my Tello and not doing anything too advanced or out of its capabilities.

If you have any idea on how to make this work, please do let me know as I am very curious to find out. Thank you!
 

New Threads

Members online

Forum statistics

Threads
5,168
Messages
37,431
Members
14,018
Latest member
urgeles