Hello Sieuwe Elferink, thanks for this cool tutorial. Can you make another video on how to get a stream video from parrot bebop 2? I would like to make some computer vision applications but i am stuck about how to get the images from the drone camera. Thanks in advance
@@abdoulsavadogo8628 Due to a major change in the communication protocol, PS-Drone is (currently) not compatible with bebop drones. However, can use ffmpeg or openCV to simply grab the (h264) video-stream and dump it on disk.
The undocumented PS-Drone-command "changeIP()" will be useful here. It changes the IP address of the drone until the next battery change, so you can controll all drones with one script. Usage: drone.changeIP("192.168.4.5"). It returns "True" if successfull. I suggest to use a separate script to change the drones IP, because the running script loses the connection to the drone and PS-Drone need to reinitiate.
Thanks for the really great info. Here's a project idea - that you combine your last EEG leds project with this one, for use by youth who are nonverbal with special learning needs to communicate their emotional state while they build neural plasticity. The EEG + Drone design by Puzzlebox Orbit is only for elite minds because the drone darts all over the place before young minds have developed the cognitive control required. Your vertical drone would offer a less stressful engagement and pushing it off centre but keeping it floating would encourage playful engagement.
Thanks for the idea. I am currently working on some other projects so I don’t really have time for this. If you want some advice just ask in this comment section.
What do you mean with disable optical flow? Normal camera feed using ps drone does not have any optical flow algarithm running over it. Just plain image.
@@sieuweelferink6852 Ok, I thought that the AR drone 2.0 used optical flow (from bottom camera) to stabilize horizontal position during hover. This is also visible as the drone tries to get back to its hover position, if disturbed.
Request: Interesting topic, can you make a drone with 3d stereo camera for autonomous flying. I got a sample code for stereo camera in java processing. Actually it's really simple but need more processing power in case you use Pi. If u are ready let me know. Idea is using stereo camera we can find the distance of objects and We can take right decision to fly towards destination.
sachin lobo interesting idea. I am going to work soon on a project where i want to make ar drones fly autonomous around my yard and that they the pickup trash. An ai running on a onsite servet will do trash detection but i somehow have to make sure the drones dont collide into stuff. I was self thinking about adding 9 of those cheap hc04 distance sensors to the ar drone in all directions one. Because stereo vision indeed needs some processing power. Als to see completely around the drone a lot of cameras are needed. I may am going to work on an ai based flying algorithm which learns how to fly a drone using behavioral cloning. This same concept i already used in a autonomous car project which i will post a video of coming week!
@@sieuweelferink6852 that's good idea but I don't think drone needs ultra sonic sensors in all directions.. because people like us use only fpv camera and altimeter to fly a drone.... But I am not real genius in drone control. github.com/wangyida/gan-depth-semantic3d/tree/master/3dv I found this but it's little complicated. And camera is arducam readily available suppose if you're making so, 😜😍 Ultra sonic hc04 has 3.5m detection range Nice idea .. if u add ultra sonic sensors around it would be great for path finding but stereo camera may provide better clarity of depth sensing.(whatever you can apply your own ideas) Okay waiting for next week now, 🤣🤣 thanks for reply
Hi Sieuwe Elferink, Can I use python 3.8.1 if not I'll use 2.7 to program the drone? After watching your video I have a ps-drone shipping to me and I see programming drones as the future! This could be a great income provider, because companies will be hiring like Amazon for anyone who has experience in this field of know how with drone program knowledge. What was your greatest obstacle with this drone project in coding? Awesome video presentation Sieuwe!
The biggest obstacle was to find a drone which was easy to program. I wantwd to quickly devolep something since i only had 3 days. This is why I used the ar drone because there are a lot of examples and a very nice python library which makes it easy to control the drone. If this was not made then that was the biggest obstacle. Because the control was easy i think the biggest obstacle was making a good tuned P controller for minimizing the error from the center points. This could still be done much better. I am now working on a new drone project where i will be doing this much better with also a more professional drone.
What was the purpose of line 212 in your Main.py file? I don't really follow the conditional statement made: " if cv2.waitKey(25) & 0xFF == ord('q'tAltitude - Altitude) < -80". Thanks in advance for any assistance
hey man, I love your project and I really want to do that by myself. I wanted to ask if you used an audrino or something? maybe you said it but I missed it. secondly, could you tell me what skills I need to know? I can do some python programming and I am learning to use an audrino. will that be enough? thanks and best of luck with your future projects
This drone does not use a Arduino or any microcotroller. This drone actually has a small computer inside it running a stripped down version of linux. This is also why I chose this drone. I used a library called PS drone which enables made me able to control the drone with simple python functions. If you want to make this yourself buy a AR-drone since it is really simple to work with. Also learning Arduino is a great skill to have but not needed for a project like this.
@@sieuweelferink6852I've moved bro, but for the reading of the image is not terdektesi, I've read the instructions on GITHUB and I've followed the instructions but the drone does not follow the target on the circle
Sieuwe, so what do we need to get started on controlling a drone with python as far as drone hardware goes? Just a drone with a camera? Obviously some come with software, or you can buy software but I want to learn how to interact with it and fly one from my PC ;)
If you want to fully control the drone on low level you will have to start with mathematical models representing forces on the drone and perform optimization to minimize errors. Use something like a rpi with esc connected to the pwm gpio pins of rpi. Then according to the mathematical model perform stabilization by writing pwm to the esc’s. But trust me this is very low level and will take you a lot of time and research. If you want something quick just use a drone with existing Python library.
I used a library called ps drone. This uses the wifi connection between the drone and the pc running the python script to send commands using the ar drone protocol.
probably but you have to change the code to make it connect with that drone. The computer vision code will work just fine only the drone part has to be changed.
Hoi P Dg. ik heb daar geen rekening mee hoeven te houden om twee redenen. Ten eerste is de PS Drone library super snel dus is er minimale vertraging. Ten tweede maakt een kleine vertraging van bijvoorbeeld 50ms niet zoveel uit. dit is omdat als de drone bijvoorbeeld naar links beweegt ten opzichte van de stip dan veranderd deze bewegings trend niet in 50ms zo erg dat de drone plots een heel andere beweging moet maken. Dit zou wel uitmaken als je hem helemaal 100% op de mm nauwkeurig in het midden wilt krijgen maar dat praktisch gezien toch onmogelijk. Bij dit project was het goed als de drone ongeveer in een circle van diameter 30cm rond de rooie stip vliegt.
Python 3.8 is installed in my device and cv2 too. But ps_drone can’t be installed. May be I don’t know how to do. Please give some advices. Ps. I ran main.py with visual and it show many red lines.
@@kyiseinmsp8005 Ps drone does not need to be installed. You only have to download the Ps drone python file from the Ps drone website and put it in the same folder as the main python script. It should then work.
does it work with any drone? I'm having a bad time trying to understand if people is programming an specific kind of drone or if all of them are programable (straight out of the box I mean)
It depends on the drone. The AR Drone is specially devoleped with developers in mind. They provide documentation on how the drone can be programmed and a framework. Some companies like dji don't do this so programming them will require reverse engeneering the hardware and software. This is A LOT of work and maybe it is even impossible because the drone is can be locked down. If you want to program a drone the Parrot AR Drone is the easiest one.
Hey i didn't get, do i need this specific drone for this? Today i just realized it would be cool to make a drone fly with my computer but like idk if it's possible with my drone... Don't ask me which drone ive got lol its like the most cheap drone idk where it came from
@@sieuweelferink6852 Oh ok. Is there any chance of me writing this myself (i have some knowledge of python and JS and im willing to learn more as soon as i know it is possible or not.) and make it work on a normal drone, or do i need a drone with special functions for this?
gravitowl you can make code to work with any drone but it depends on hoe much work you want to put into it and how easy you want it to be. I used this drone since there were already multiple libraries written for it, it already had a camera which i can get the feed from and it is intelligent enough to hover by itself without continue direct input like cheap drones need. If you want to keep it easy use this drone!
@@sieuweelferink6852 Okay, ill try to do some more research. i don't have the biggest budget, and ucrrently im already saving up for a gaming pc. About cheap drones not being able to hover by themselves, i got a 30 dollar wish drone that does it perfectly haha! Thanks for this info!
When I run Main.py, I get: Traceback (most recent call last): File "Main.py", line 158, in CurrentAltitude = drone.NavData["altitude"][3] KeyError: 'altitude' Help :D
Hi Loke I can remember I also had that error but I can't remember right now how I fixed it. Will take a look this week. In the mean time you can try to look in the psdrone.py file for the altitude key. Maybe I have made a typo?
The drone I am using is called an Parrot AR Drone that is why I say AR Drone. Using the word Ai does not have any meaning in this project since there is no Ai used in this project. I only use traditional Computer vision and PID control techniques.
Sieuwe Elferink that’s also true , I just was confused what AR should be in this project but well I guess marketing fail from Drone Developers. But yeah there is no AI in this project. But some people call their software AI even it’s not AI.
Hi everyone I just bought 2 more Ar-drones. What do you want me to make with 3 drones working together?
Hello
Sieuwe Elferink, thanks for this cool tutorial. Can you make another video on how to get a stream video from parrot bebop 2? I would like to make some computer vision applications but i am stuck about how to get the images from the drone camera. Thanks in advance
@@abdoulsavadogo8628 Due to a major change in the communication protocol, PS-Drone is (currently) not compatible with bebop drones.
However, can use ffmpeg or openCV to simply grab the (h264) video-stream and dump it on disk.
The undocumented PS-Drone-command "changeIP()" will be useful here. It changes the IP address of the drone until the next battery change, so you can controll all drones with one script.
Usage: drone.changeIP("192.168.4.5"). It returns "True" if successfull.
I suggest to use a separate script to change the drones IP, because the running script loses the connection to the drone and PS-Drone need to reinitiate.
hack the other two in mid air and take over remote controls wirelessly using a RPI and aircrack-ng tool
Thanks for the python code man!!
Just found this guys channel. Loving your content subscribed immediately
Thank you for subscribing 👍
Thanks for the really great info. Here's a project idea - that you combine your last EEG leds project with this one, for use by youth who are nonverbal with special learning needs to communicate their emotional state while they build neural plasticity. The EEG + Drone design by Puzzlebox Orbit is only for elite minds because the drone darts all over the place before young minds have developed the cognitive control required. Your vertical drone would offer a less stressful engagement and pushing it off centre but keeping it floating would encourage playful engagement.
Thanks for the idea. I am currently working on some other projects so I don’t really have time for this. If you want some advice just ask in this comment section.
nice work there
Just what i needed go start my project!!! Thanks
well done Sieuwe, that is pretty awesome
Great job👍 underrated video
Bro i love your vids please dont forget me
great job man!
Cool video, cheers!
Hi great job. which do you used companion computer?.can i change this project to object tracking for drone
Check my latest project for person tracking drone!
Hello , this project seems awesome. Please guide me can I test my control algorithms on this drone. I mean I want motor control.
zainab hamid if you want deep level motor control this is not the platform for you. Take a look at APM. This can give you full control of everything.
sieuwe Good day i love your works and video contents, i want to learn ar drone programming can you help me with that sir
Hi, nice video! by the way, do you know how to disable the optical flow in ar drone 2?
What do you mean with disable optical flow? Normal camera feed using ps drone does not have any optical flow algarithm running over it. Just plain image.
@@sieuweelferink6852 Ok, I thought that the AR drone 2.0 used optical flow (from bottom camera) to stabilize horizontal position during hover. This is also visible as the drone tries to get back to its hover position, if disturbed.
@@ashutoshsimha3656 you are correct, it does. However, as it is being reprogrammed, this is overwritten within the library.
Request: Interesting topic, can you make a drone with 3d stereo camera for autonomous flying.
I got a sample code for stereo camera in java processing. Actually it's really simple but need more processing power in case you use Pi. If u are ready let me know.
Idea is using stereo camera we can find the distance of objects and We can take right decision to fly towards destination.
sachin lobo interesting idea. I am going to work soon on a project where i want to make ar drones fly autonomous around my yard and that they the pickup trash. An ai running on a onsite servet will do trash detection but i somehow have to make sure the drones dont collide into stuff. I was self thinking about adding 9 of those cheap hc04 distance sensors to the ar drone in all directions one. Because stereo vision indeed needs some processing power. Als to see completely around the drone a lot of cameras are needed. I may am going to work on an ai based flying algorithm which learns how to fly a drone using behavioral cloning. This same concept i already used in a autonomous car project which i will post a video of coming week!
@@sieuweelferink6852 that's good idea but I don't think drone needs ultra sonic sensors in all directions.. because people like us use only fpv camera and altimeter to fly a drone.... But I am not real genius in drone control.
github.com/wangyida/gan-depth-semantic3d/tree/master/3dv I found this but it's little complicated. And camera is arducam readily available suppose if you're making so, 😜😍
Ultra sonic hc04 has 3.5m detection range
Nice idea .. if u add ultra sonic sensors around it would be great for path finding but stereo camera may provide better clarity of depth sensing.(whatever you can apply your own ideas)
Okay waiting for next week now, 🤣🤣 thanks for reply
Good work.. I will try to do this.
Hi Sieuwe Elferink,
Can I use python 3.8.1 if not I'll use 2.7 to program the drone? After watching your video I have a ps-drone shipping to me and I see programming drones as the future! This could be a great income provider, because companies will be hiring like Amazon for anyone who has experience in this field of know how with drone program knowledge.
What was your greatest obstacle with this drone project in coding? Awesome video presentation Sieuwe!
The biggest obstacle was to find a drone which was easy to program. I wantwd to quickly devolep something since i only had 3 days. This is why I used the ar drone because there are a lot of examples and a very nice python library which makes it easy to control the drone. If this was not made then that was the biggest obstacle. Because the control was easy i think the biggest obstacle was making a good tuned P controller for minimizing the error from the center points. This could still be done much better. I am now working on a new drone project where i will be doing this much better with also a more professional drone.
keep goin my friendo
Nice vidoe man!
Greta video i enjoyed your video! just wanted to comment to show my appreciation
Nice work!!!
What was the purpose of line 212 in your Main.py file? I don't really follow the conditional statement made: " if cv2.waitKey(25) & 0xFF == ord('q'tAltitude - Altitude) < -80". Thanks in advance for any assistance
hi Phelan I think that it was a weird copy paste bug because it was not suppose to be there. I fixed it right now on the github.
hey man,
I love your project and I really want to do that by myself.
I wanted to ask if you used an audrino or something? maybe you said it but I missed it.
secondly, could you tell me what skills I need to know? I can do some python programming and I am learning to use an audrino. will that be enough?
thanks and best of luck with your future projects
This drone does not use a Arduino or any microcotroller. This drone actually has a small computer inside it running a stripped down version of linux. This is also why I chose this drone. I used a library called PS drone which enables made me able to control the drone with simple python functions. If you want to make this yourself buy a AR-drone since it is really simple to work with. Also learning Arduino is a great skill to have but not needed for a project like this.
@@sieuweelferink6852 I want to design my own controller with parrot AR drone. Is it possible to test complicated control algorithms on it
bro want to ask, should the ar drone camera be moved down? what is the effect when the camera is not moved?
Yes camera needs to be moved down!!!! Otherwise software wont work. Make sure to read the readme on GitHub for instructions!
@@sieuweelferink6852I've moved bro, but for the reading of the image is not terdektesi, I've read the instructions on GITHUB and I've followed the instructions but the drone does not follow the target on the circle
Great bro
Sieuwe, so what do we need to get started on controlling a drone with python as far as drone hardware goes? Just a drone with a camera? Obviously some come with software, or you can buy software but I want to learn how to interact with it and fly one from my PC ;)
If you want to fully control the drone on low level you will have to start with mathematical models representing forces on the drone and perform optimization to minimize errors. Use something like a rpi with esc connected to the pwm gpio pins of rpi. Then according to the mathematical model perform stabilization by writing pwm to the esc’s. But trust me this is very low level and will take you a lot of time and research. If you want something quick just use a drone with existing Python library.
@@sieuweelferink6852 OK thanks, appreciate it! I don't want to reinvent the wheel lol
how did you send commands to the drone, what kind of transmitter did you use?
I used a library called ps drone. This uses the wifi connection between the drone and the pc running the python script to send commands using the ar drone protocol.
Is this possible on the smaller Parrots such as the Mambo?
probably but you have to change the code to make it connect with that drone. The computer vision code will work just fine only the drone part has to be changed.
Goed gedaan. Hoe heb je de vertraging van de door de drone uitgezonden video gecompenseerd?
Hoi P Dg. ik heb daar geen rekening mee hoeven te houden om twee redenen. Ten eerste is de PS Drone library super snel dus is er minimale vertraging. Ten tweede maakt een kleine vertraging van bijvoorbeeld 50ms niet zoveel uit. dit is omdat als de drone bijvoorbeeld naar links beweegt ten opzichte van de stip dan veranderd deze bewegings trend niet in 50ms zo erg dat de drone plots een heel andere beweging moet maken. Dit zou wel uitmaken als je hem helemaal 100% op de mm nauwkeurig in het midden wilt krijgen maar dat praktisch gezien toch onmogelijk. Bij dit project was het goed als de drone ongeveer in een circle van diameter 30cm rond de rooie stip vliegt.
Can anyone give the buy link for the drone please
www.amazon.com/Parrot-AR-Drone-2-0-Elite-Quadcopter/dp/B00FS7SSD6
Lekahh!
I have a problem about ps-drone. how can i fix it?
what is the problem
Python 3.8 is installed in my device and cv2 too. But ps_drone can’t be installed. May be I don’t know how to do. Please give some advices.
Ps. I ran main.py with visual and it show many red lines.
@@kyiseinmsp8005 Ps drone does not need to be installed. You only have to download the Ps drone python file from the Ps drone website and put it in the same folder as the main python script. It should then work.
Thanks a lot. I will try it again.
does it work with any drone? I'm having a bad time trying to understand if people is programming an specific kind of drone or if all of them are programable (straight out of the box I mean)
It depends on the drone. The AR Drone is specially devoleped with developers in mind. They provide documentation on how the drone can be programmed and a framework. Some companies like dji don't do this so programming them will require reverse engeneering the hardware and software. This is A LOT of work and maybe it is even impossible because the drone is can be locked down. If you want to program a drone the Parrot AR Drone is the easiest one.
@@sieuweelferink6852 nice, thanks man,keep up the good work
Do you know how to code a drone to take off?
Take a look at DroneKit library
nice bro
Hey i didn't get, do i need this specific drone for this? Today i just realized it would be cool to make a drone fly with my computer but like idk if it's possible with my drone... Don't ask me which drone ive got lol its like the most cheap drone idk where it came from
Hi you need to have this specific drone called: AR-drone from parrot. Any other drone wont work with this code.
@@sieuweelferink6852 Oh ok. Is there any chance of me writing this myself (i have some knowledge of python and JS and im willing to learn more as soon as i know it is possible or not.) and make it work on a normal drone, or do i need a drone with special functions for this?
gravitowl you can make code to work with any drone but it depends on hoe much work you want to put into it and how easy you want it to be. I used this drone since there were already multiple libraries written for it, it already had a camera which i can get the feed from and it is intelligent enough to hover by itself without continue direct input like cheap drones need. If you want to keep it easy use this drone!
@@sieuweelferink6852 Okay, ill try to do some more research. i don't have the biggest budget, and ucrrently im already saving up for a gaming pc. About cheap drones not being able to hover by themselves, i got a 30 dollar wish drone that does it perfectly haha! Thanks for this info!
What drone did you use
Edit: nevermind
0:30
Dope
When I run Main.py, I get:
Traceback (most recent call last):
File "Main.py", line 158, in
CurrentAltitude = drone.NavData["altitude"][3]
KeyError: 'altitude'
Help :D
Hi Loke I can remember I also had that error but I can't remember right now how I fixed it. Will take a look this week. In the mean time you can try to look in the psdrone.py file for the altitude key. Maybe I have made a typo?
@@sieuweelferink6852 Thanks man :) I will look into the file. btw you are doing a awesome work and I really appreciate it.
Have you found. a solution for this? I am also having a same problem.
@@aashishgautam3519 Visit www.playsheep.de/drone , there is a documentation, tutorials and you can ask for help.
that was inspiring
nice
how to install or connect ps drone???
you don't have to install it. download the psdrone.py file from the ps drone website and make sure it is in the same folder as my python script.
@@sieuweelferink6852 ok when i run it in my python 2.7 and wifi is connected then it will fly
@@SauravKumar2 yes
@@SauravKumar2 what is your problem?
@@sieuweelferink6852i am unable to fly my drone. The code has some errors. Please help me.
Mooi hoor
you are greeat
It’s Not AR maybe you mean AI?
The drone I am using is called an Parrot AR Drone that is why I say AR Drone. Using the word Ai does not have any meaning in this project since there is no Ai used in this project. I only use traditional Computer vision and PID control techniques.
Sieuwe Elferink that’s also true , I just was confused what AR should be in this project but well I guess marketing fail from Drone Developers. But yeah there is no AI in this project. But some people call their software AI even it’s not AI.
and i can't use ps_drone.can you help me?