Hello Gregorio, I'm very pleased that you used my little project and found the admittedly not very visible Python3 version of PS-Drone. The problem you describe is usually due to a faulty installation of OpenCV. OpenCV is a little bitchy about this, in most cases the problem is solved after reinstalling OpenCV. If you want to make sure that PS-Drone is not the source of the error, I recommend you to grab the video stream via saveVideo(), as the preprocessing of the video stream is skipped here -...
Recently, I have been working on a project using the PS-Drone library in Python3 along with OpenCV (cv2) to capture and process video from a Parrot AR.DroneWhen trying to run a Python script that uses PS-Drone to connect to the drone and OpenCV (cv2) to display the video feed in real-time, I encountered errors that prevent the correct capture and display of the video. While the connection to the drone and obtaining data such as battery level work correctly, the video capture part does not.
Question: Is there any way to upload code that executes on the drone (not on the pc?)
I am also interested to get copies of these files, please. Thanks!
Hi Parwin, this error is related to an elementary and very well tested part of PS-Drone, so I rather guess an external reason than a program error. Have you ever run PS-Drone directly on the console ? Feel free to contact me directly if the error still occur. Best wishes, Phil
Hi Loke! Recently I have been working on this repository. I'm facing few attribute errors in the execution of the script ps-drone3.py.
Hi Loke! Recently I have been working on this repository. I'm facing few attribute errors in the execution of the script ps-drone3.py.
Attribute error in executing the script
i did some more tweaking on the math and got a better result. I have also hanged the drone freely. Attached is a videoclip of the measurement while the drone is hanging freely and rotating around the Z-axis. The single measurement points are mean and not as dense as in the incoming data stream. With a little fantasy it looks more like a circle now :)
Good morning Phil, it helps a little but not really. If I have a brainstorm, I'll get back to you here. Thanks for the prompt reply :) wally
Hello Wally, this is a known problem of the drone. Ruffly, sensors are not very accurate in the small values - of course there are differences in quality. Depending on the technology used, this has different effects, especially with the Z-dimension attitude and magnetic sensors. The error magnitude vary between individual drones and actual temperature. That this "rotation" corresponds to an ellipse I also did not know yet, thanks for sharing. Up to firmware version 2.3.3 the measured values simply...
Hello Wally, this is a known problem of the drone. In a nutshell, sensors are not very accurate in the small values - of course there are differences in quality. Depending on the technology used, this has different effects, especially with the Z-dimension attitude and magnetic sensors. The error magnitude vary between individual drones and actual temperature. That this "rotation" corresponds to an ellipse I also did not know yet, thanks for sharing. Up to firmware version 2.3.3 the measured values...
Hello, with the ApI it was easy to read out the magnetometer data. After evaluating this data, I found that when the drone rotates around the Z-axis, the measurement data does not describe a circle, but an ellipse. A calibration of the magnetic sensor is probably necessary. Can someone tell me how to calibrate the drone using the PS-DRONE API if possible? Thank You wally
Hi Wally, the programs are still not very clear and only give them out on request at the moment. You'll have them in a few minutes ;-) Best wishes, Phil
Hi, where can I find the "quick and dirty" files mentioned in https://www.playsheep.de/drone/quickdirty.html "Matador.py", "searchFollow.py" and "followBall.py" thanks wally
Hi Loke, sounds very interesting. Especially because you used the psdrone API. Have you published anything about path planning? Is there any demo code ? wally
Ah, I wasn't using ps-drone3. After downloading that, it works fine now. Thank you, Phil!
Hi Zachary, that's odd, this problem should have been solved with last week's update. Are you using the latest version? Best wishes, Phil
I am having the same issue
Hello everyone Last year I did my master thesis "Autonomous Drone Path Planning Navigation and Operation" and used this API for that project. It turned out really well. I will therefore let everyone know, that is you need some help or inspiration, I might be able to help :)
We have worked on the problem away from the forum. It turned out that Loke's project was very ambitious and impressive, so I decided not to summarise this complex issue in this forum. Just so you know, he got it done and I am very impressed.
We have worked on the problem away from the forum. The latest uploaded version contains a fix with which video should work.
PS-Drone3
Thanks a lot! I'm looking forward to trying it if you succeed
The above code works absolutely satisfactorily and outputs the correct GPS data. I had a hardware issue, sorry.
Hi Martin, I am glad you like my little project and thanks for your feedback. Yes, it looks like PS-Drone behaves differently under Python3 than under Python2, especially with the video function. I will revise and upload PS-Drone3 in the next few days and fix this. Feel free to write me if you have further questions. Best wishes, Philipp
First of all, thanks a lot for creating this API. I'm having troubles getting the video feed from the drone when using the python3 API. In python2 I'm able to control the drone as well as getting the video. However, in python3 I'm only able to control the drone. I can see that the drone sends me something repeatedly in the video channel that isn't recognized as any of the options in the mainloopV below the if statement "if ip == vstream_pipe" and therefore the image is disregarded. My theory is that...
Hello Daniel, Hello Philipp, I also tried to read the GPS data and replaced [wifi] with [zimmu_3000] but did not have the success Daniel reported. My output after waiting for minutes still looks like this: [0.0, 0.0, 0]. (see output end of code) I use ArDrone 2.0 (fw; 2.4.8), PS-Drone3.py, Python3.8 and the little red FleightController attached and blinking white: Here is my code, with the request for a hint what is wrong there: ######### # getNavData.py (modified) ########### ##### Suggested clean...
Hello Daniel, Hello Philipp, I also tried to read the GPS data and replaced [wifi] with [zimmu_3000] but did not have the success Daniel reported. My output after waiting for minutes also looks like this: [0.0, 0.0, 0]. (see output end of code) I use ArDrone 2.0 (fw; 2.4.8), PS-Drone3.py, Python3.8 and the little red FleightController attached and blinking white: Here is my code, with the request for a hint what is wrong there: ######### # getNavData.py (modified) ########### ##### Suggested clean...
It has worked perfectly, thank you very much for the help.
Hi Daniel, I don't have a GPS-modul myself, so I have to help blind. I suggest to take a look to http://www.playsheep.de/drone/prgs/getNavData.py and replace e.g. drone.NavData["wifi"] with drone.NavData["zimmu_3000"] Since the drone does not support GPS-A, a GPS cold start must be assumed - So it can take up to two minutes until the position is found.
You don't have any example of how to read the GPS data? Please I really need that
I have a question, what would be the command to read the GPS data. I have tried NavData["zimmu_3000"] but without success.
Hi Daniel, shame on me, I forgot to patch the PS-Drone, but I made up for it and just uploaded new/patched versions for Python 2 and Python 3. The Navdata-packet is still "zimmu_3000", but returns (hopefully) the three GPS-values. Hope it works, I would be pleased about a short feedback.
Hi, how can I get the GPS data with PS-Drone, I have seen that there is a patch but I have not been able to use it.
Dear all, i am encountering problems by using ps-drone3. When trying to use the camera, i get an error in "mainloopV" in the line : "write2pipe = open(VidPipePath,"w+")". The error is: " io.UnsupportedOperation: File or stream is not seekable. " If i add buffering = 0 this error does not occur but i get no image (IMC stays 0), so i expect that the problem lies within the buffering, i tried io.BufferedReader instead without success. Can anyone help me with this? Would be really awesome. Best to all...
Hey Philipp Thanks for the quick answer. I am already using the markers and I have made a scrips where I have implemented a PD-controller found by a model of the system I have made. Often the markers work just fine, but on a cloudy day it can have problems finding the markers. My problem is that I don't know how to use the ground camera without using setConfigAllID(). I have tried: drone.setConfig("detect:detections_select_h", "0") drone.setConfig("detect:detections_select_v", "128") and drone.groundVideo(True)...
Hi Loke, I am pleased that you like my project and that it helps you :-) The usage ofsetConfigAllID() is a bit tricky and you have to use setMConfig() instead of setConfig(). However, I suggest to avoid setConfigAllID() in case of doubt. Did you already try to modify the tag-detection tutorial ? (https://www.playsheep.de/drone/tut6Markers.html) If nothing helps at all, you can write the marker recognition yourself, using the video-stream. The drone's cameras are not that good, so the build in marker...
Hi I am doing my master thesis with this API and so far it was been great. Big thanks to the creatot of this. My project has been so much fun thanks to this API. I have made a PD controller to position the drone relativ to a marker ("tag"), using the front camera. I also need the the ground camera to look for objects at the gound. When I use ” drone. setConfigAllID() ” in order to get the ground camera going, marker detection woun’t work. Is there any way I can use the ground camera without using...
Hello Zapa, I upladed the Python3-version of PS-Drone a minute ago, hope it will help you. Best wishes, Phil
Hello Zapa, I am glad that you like my little project. Due to lack of time I could not port PS-Drone to python3, but I heard that someone already did - I will ask him to share his port, but this might take some time. As far as I know Python2 understands the code for Python3, so your programs should run out of the box if you install Python2. I'm curious to see if it works. If you have any further questions, feel free to contact me. Good luck and happy coding, Phil
Hello, First of all, I want to thanks the creator of this wonderful API for making easy to tinker with my good old (and almost forgotten) parrot AR Drone. I'm quite newbie on python development, and I'm learning on the fly. I've found this API and I'm trying to develop some customized interface for controlling the drone from PC. But, as far as the version of python I've been learning & testing been 3.7, I'd like to know if there is a port of this API to python3 or some ways to port it. I have searched...
Still maintained
Thanks a lot for the help. Congratulations for your work. I hope to carry out a trajectory control project using as input the speeds of each engine. Regards, Wallace
Hi Wallace, John measured the rotation of the propellers, as far as I remember. Although the internal PWM inputs are expected 9-bit values, but supports only 256 gradations, the lowest bit is ignored. The raw values are sent to the four small controllers under the motors where the LEDs are as well. These controllers send the actual used PWM-value back to the main system. The sampling/data rate is much lower than for other sensors, presumably because of the serial transmission. Hope this helps. Best...
Good morning, I'm Wallace, I'm doing projects with Parrot, and the quiz will know if this PWM x RPM relationship is propeller or engine related. Another question of mine is whether this PWM data is taken from the drone.pwm () command. Thanks, Wallace
Good morning, I'm Wallace, I'm doing projects with Parrot, and the quiz will know if this PWM x RPM relationship is propeller or engine related. Thanks, Wallace
Bugfixes in PS-Drone 2.1.4
Hi Gustavo, I am happy that you like the API. :-) In general, a flood of OpenCV generated error messages indicate a broken installation of OpenCV. Unfortunately, this happens pretty often. Please try to reinstall OpenCV, then everything should work. I can not imagine that this has something to do with Anaconda. Please give me a hint, if the messages keep coming up, I'm sure we'll find a solution. Best wishes, Philipp
Hi, Philip, thank you for the great work. Most examples are working very well for me, but I'm also having problems with useVideo.py and firstVideo.py, they are not working on my Ubuntu 18.04. A error message is appearing: "OpenCV(3.4.2) /tmp/build/80754af9/opencv-suite_1535558553474/work/modules/highgui/src/window.cpp:626: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev...
Dear philip I have installed the Linux mint. Good news is the useVideo and firstVideo script can work now( i use opencv version == 3.3.1.11). But it is not always working( about 1 in 3, and i clear the workspace and terminal,it is better). But the problem is i can not access the ground cam after changing the frontCam() to groundCam(),it still displays the frontcam view, which i saw a similar one : https://sourceforge.net/p/psdrone/discussion/general/thread/43894f62/ Again thanks for your time and...
Hi , Phil I am using Ubuntu 18.04 on virtual box. And the firstVideo.py is not normally working: it just keep running without showing display window. I have installed python-opencv, so with methods of using cv2.imshow() , the result is no image. I will send you the log file and the result of config .py before tomorrow. Anyway thanks for your suggestion and reply! Best Regards
Hi Ji, seems your drone does not enable Video or your OS block TCP-traffic drom the drone. It would be interesting to know, if drone.VideoImageCount increases. Wich OS are you using ? Is firstVideo.py running ? Is firstConfig.py working as discribed ? Did you install python-opencv ? Depending on the problem, it helps sometimes to reinstall openCV. You can set drone.debug = True and/or self.showCommands = True before drone.startup() to see internal comunication. Feel free to send me a logfile (e.g....
Hello I used your library to implement on AR.Drone 2.0. The basic movement is no problem, but i can not get any output of video or image with the script. I before think that maybe AR.Drone is broken so the camera is not working. However i have tried two sets of AR.Drone, both of them gave no response and the IMC is always equal to 0 Thanks in advance if you can give me some ideas, or is there some requirements or installation subject to the camera using?
Hi,Tim, i also have the same problem. And the script did not give any error but just shows nothing
Hi all, is this issue still around or does the latest PS_Drone fix it? If it is still an issue how do I install the patch? I tried patch < ps_drone.patch but got Hunk #1 FAILED at 1853, any help would be great as my GPS config data is just showing a static number.
Hi Phillip, I have one drone connected to my inbuilt wifi card, and another drone connected to my USB Wi-fi dongle. I first run the 'drone1.py' script, which assigns a drone to ip "192.168.1.101" Then I run the 'drone2.py' script, which assigns a drone to ip "192.168.1.102" Then I run 'droneSwarm.py', it gets to line 12, prints "3" then says drone2 is not online and exits.
Hi Ian, I'm sure that's just a small problem. is it ok if I take a look to your code ? Can you send it to me ? The init-part is ok. cu Phil
Hi Phillip, Thank you for clarifying how the changeIP() function works. I've tried as you said running 2 seperate scripts to set the ip addresses of the drones and then a third script to actually connect to and control the drones but have ran into some trouble. If I change the IP of just one drone, I can connect to it on it's new IP and issue commands just fine but can't seem to get it to work with two drones. I should probably clarify I am working on a laptop and drone1 is connected to my inbuilt...
Hello Ian, yes, you can use the (still undocumented) command "changeIP" for this: I suggest to write two small extra scripts to set the IPs of the drones, by e.g. ... drone = ps_drone.Drone() drone.startup() drone.changeIP("192.168.1.101") ... and ... drone = ps_drone.Drone() drone.startup() drone.changeIP("192.168.1.102") ... If you remove the battery from the drones, the IPs jump back to "192.168.1.1". Now you can run your swarm-program, start two instances of PS-Drone (e.g. drone1 and drone2)...
Hi Luis, I just send you a mail, hope it will help. Have a great day, Philipp
Is it possible to setup a swarm of drones using PS-Drone? My controller has two network cards so can 'connect' to two drones . Ideally i'd be able to control two drones from a central controller but when I attempt this I get an error because the IP address is in use, if I change one of the drones IP addresses would I be able to issue commands to both drones?
Hi, I have sent a message early this afternoon regarding the control with PWM commands. Can you send me the algorithms that you were refering? Thank you, Luís
Hi, I am happy that you like the API. Although Parrot has mostly documented the drone very well, some parts are missing completly, such as most parts of NavData. I put together all information I could find in the documentation. I did some research the last few days and found out that LBS is a fixed floating-point data format, which is used e.g. by MatLab, and which should have structured like xxxxxxxxxxxx.yyyy There is also a good chance the documentation of the accelerator-chip discribes the data-format....
Dear sir, You did a great job and I'm know using your provided API to do the school project. I have one question that the raw data from the Accelerometer you said in the tutorial is LSB, but I read it out and it returns some value of 2xxx which makes no sense what the unit is. I tried to read the datasheet of the IMU but it means nothing. Could you explain it in more detail I would be very appriciate. Thank you sir
No solution found for me. I have just decided to use the Node.JS library even though it is less reliable and less complete of a library.
That's all! Thank you! = )
Hello Syarif, thank you, I really appreciate your praise :-) Yes, ps-drone sends the commands as you assumed to the drone. The commands start with "AT*" and the command itself. The first option is an ascending number, other options have to be seperated by a comma. Floating-point-values have to be send as a raw 4 byte IEEE 754-value. The drone demands a kind of a heartbeat, so the command "COMWDG" is just to keep the connection up. If you set drone.showCommands=true, all commands send to the drone...
Hello Syarif, thank you, I really appreciate your praise :-) Yes, ps-drone sends the commands as you assumed to the drone. The commands start with "AT*" and the command itself. The first option is an ascending number. Floating-point-values have to be send as a raw 4 byte IEEE 754-value. The drone demands a kind of a heartbeat, so the command "COMWDG" is just a dummy-command to keep the connection. If you set drone.showCommands=true, all commands send to the drone will be shown. I am sure, this will...
Hello Syarif, thank you, I really appreciate your praise :-) Yes, ps-drone sends the commands as you assumed to the drone. If you set drone.showCommands=true, all commands send to the drone will be shown. I am sure, this will help to understand how the drone and PS-Drone are working together, Also the AR.Drone Developer Guide might help you, too. "ARDrone_Developer_Guide.pdf" can be found in folder "Docs" of the ARDrone SDK 2.0 (http://developer.parrot.com/docs/SDK2/ARDrone_SDK_2_0_1.zip) What are...
Sure, you can download it at http://www.playsheep.de/drone/misc/searchFollow.zip The drone will start and turn to find a marker. If found, it will fly to it. Its a combination of a couple of routines. You can change the behavior between line 514 and 526: marker: "True" enables the internal-marker-detection, "False" detects red dots follow: Follows the detected object (move the marker, the drone follows) followZ: The drone holds a distance of about 1m (3ft) to the marker (only works with markers)...
Hi Philipp, can you send me this program too? Thank you very much.
hello, first of all thanks to J. Philipp de Graaff for your open source API and i choose this for help my bachelor thesis. i want ask for somebody here about how the AT*PCMD will be send to the drone, i trying to understand this API code but i just got stuck, would you tell me about how these function work and send the AT*PCMD to the drone? for example i want make the drone move left with 0.5 in percent speed, so i should call function moveLeft(0.5) then where this code should continue? previously,...
hello, first of all thanks to J. Philipp de Graaff for your open source API and i choose this for help my bachelor thesis. i want ask for somebody here about how the ATPCMD will be send to the drone, i trying to understand this API code but i just got stuck, would you tell me about how these function work and send the ATPCMD to the drone? for example i want make the drone move left with 0.5 in percent speed, so i should call function moveLeft(0.5) then where this code should continue? previously,...
I have released a major new package that also handles the Bebop 2 (preliminary but development is ongoing) and the Mambo via wifi or BLE. https://github.com/amymcgovern/pyparrot
Hello Huzaifa and Rouzbeh, are the threads https://sourceforge.net/p/ps-drone/discussion/general/thread/dc620cd0// https://sourceforge.net/p/ps-drone/discussion/general/thread/c3de07a9/ usefull ? Best wishes, Philipp
Hi huzaifa, I happen to have the same problem, on mac also. Did you figure out the solution? Thanks.
Hi Phillip, Firstly, I would just like to thank you and anyone else that is helping to build and maintain this library! I have just started so I am probably doing something wrong, but I am getting an error that wont allow me to run firstVideo.py . When I run it, I get the following error: OpenCV: Couldn't read video stream from file "/var/folders/yy/9w999chn7kv9h18y7j0gf8qh0000gn/T/dronevid-6409228224-012237.h264" I have OpenCV version 3.3 and Python 2.7.10 installed on a Mac OS Sierra OS. Would...
Hi Phillip, Firstly, I would just like to thank you and anyone else that is helping to build and maintain this library! I have just started so I am probably doing something wrong, but I am getting an error that wont allow me to run firstVideo.py . When I run it, I get the following error: OpenCV: Couldn't read video stream from file "/var/folders/yy/9w999chn7kv9h18y7j0gf8qh0000gn/T/dronevid-6409228224-012237.h264" I have OpenCV version 3.3 and Python 2.7.10 installed on a Mac OS Sierra OS. Would...
Hello Soham, I send you a PM with a quick and dirty program, which uses the PID-controlers (based on the controllers shown at https://sourceforge.net/p/ps-drone/discussion/general/thread/ee9cd802/) to hover in front of a marker. Hope this will help you, if you have any questions, you are welcome. Best wishes, Philipp
I'm trying to make the drone hover on top of a 'black and white Roundel' marker. I use the drones Semi-Autonomous flying mode. So far it does this fine but drifts a lot while hovering, after which it corrects it's position. This does not help my situation as I want it to stay stable over the tag. This because, I intend to mount the drone with a tiny barcode scanner and then scan. Can you help me with some PID or feedback algorithm or sample code that can help me achieve the same. I have tried using...
That's all! Than you! = )
Hi Thiago, if you start ps_drone.py directly, it turns to a stand-alone-application by running a little build-in tutorial-script (last 40 lines). Long story short: I suggest to copy the relevant parts of ps-drone (line 2072 - 2094) to line 21 of getNavData.py. If you have further questions, you are welcome. Best wishes, Philipp
Hi Thiago, if you start ps_drone.py directly, it turns to a stand-alone-program by running a a little build-in tutorial-script (last 40 lines). Long story short: I suggest to copy the relevant parts of ps-drone (line 2072 - 2094) to line 21 of getNavData.py. If you have further questions, you are welcome. Best wishes, Philipp