First of all, good job making that Interface :) I am currently trying to control the drone (ARDrone 2) with a Raspberry Pi 3. Therefore i am using ps_drone, however things do not seem to work. My goal is to make the drone record stuff and save it on a USB attached to the drone.
Looking at your tutorial files such as firstVideo, i have made my own Code as following:
importps_droneimportcwiidimporttimeimportosimporttypesdefmain():drone=ps_drone.Drone()drone.startup()time.sleep(0.5)drone.getConfig()time.sleep(1)printdrone.ConfigDatadrone.setConfigAllID()time.sleep(4)print"lets hope it starts recording now..."drone.hdrecVideo()drone.frontCam()drone.USBrecVideo()CDC=drone.ConfigDataCountwhileCDC==drone.ConfigDataCount:time.sleep(0.0001)print"And action!"stop=Falsewhilenotstop:key=drone.getKey()ifkey==" ":stop=Trueelifkey=="f":drone.frontCam()print"film the front!"elifkey=="g":drone.groundCam()print"film the floor!"print"okay, we are done."#i added these two functions to use USB recording drone.hdrecVideo(False)drone.USBrecVideo(False)print"shutting down..."drone.shutdown()print"done."main()
Now to run this script, i usually plug in the drone's battery, wait for it to be ready for the usb stick, and then i run the script. However, i face difficulties during startup(): The program gets stuck in line 158 of ps_drone.py, most likely because the ConfigQueue does not clear (i found out that both if's are executed only once).
Stuff i have tried so far:
remove len(ConfigQueue) from while-condition: Program continued, then got stuck waiting for ConfigDataCount to change
remove all weird pollings where the program waits for things to happen inside the drone (and replace it with e.g. time.sleep(4)): No errors, no being stuck, no successful records or interactions... I highly doubt that my functions USBrecVideo() and hdrecVideo() are the problem, but if you want i can post them as well.
set sendConfigSaveMode to True: no difference towards false.
With that, i am at my wit's end, but maybe you still have some input for me to work on?
Regards,
Mike
Last edit: Mike Richter 2016-07-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I must to give you a short answer this time, but I think I have to take a closer look at your problem anyway.
My first guesses:
The configuration-part of the drone uses TCP, which blocks, if no connection could be established. startup() just does try to connect to the drone and also blocks if there is no response. Are you sure, the drone uses 192.168.1.1 and does not switch its IP or port ? Does it respond if you ping it ?
Am I right that you edit/forked the code of PS-Drone? That's OK of cause, I am sure your new functions are well done, but maybe you forgot a symbol or accidentally messed up something somewhere else. If you like, I can take a look at your code.
You are welcome to mail me directly.
cu,
Philipp
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've Found out that the problem most likely lies in Mike's IDE. PS-Drone creates several threads, but IDLE seems to have trouble with these. Also, CTRL-Cing a multithreaded script seems not to have any effects on the other threads. My solution is using e.g. SPE, everything works well there.
cu,
Andreas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Andreas,
yes, your guess was absolutely right. We found out, that there was something wrong with the python-installation. Mike was able to ping the drone, but not to connect anything python. He switched to an other Linux (Ubuntu on VirtualBox) and everything was fine.
cu,
Philipp
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Philipp!
First of all, good job making that Interface :) I am currently trying to control the drone (ARDrone 2) with a Raspberry Pi 3. Therefore i am using ps_drone, however things do not seem to work. My goal is to make the drone record stuff and save it on a USB attached to the drone.
Looking at your tutorial files such as firstVideo, i have made my own Code as following:
Now to run this script, i usually plug in the drone's battery, wait for it to be ready for the usb stick, and then i run the script. However, i face difficulties during startup(): The program gets stuck in line 158 of ps_drone.py, most likely because the ConfigQueue does not clear (i found out that both if's are executed only once).
Stuff i have tried so far:
remove len(ConfigQueue) from while-condition: Program continued, then got stuck waiting for ConfigDataCount to change
remove all weird pollings where the program waits for things to happen inside the drone (and replace it with e.g. time.sleep(4)): No errors, no being stuck, no successful records or interactions... I highly doubt that my functions USBrecVideo() and hdrecVideo() are the problem, but if you want i can post them as well.
set sendConfigSaveMode to True: no difference towards false.
With that, i am at my wit's end, but maybe you still have some input for me to work on?
Regards,
Mike
Last edit: Mike Richter 2016-07-18
Hi Mike,
I must to give you a short answer this time, but I think I have to take a closer look at your problem anyway.
My first guesses:
The configuration-part of the drone uses TCP, which blocks, if no connection could be established. startup() just does try to connect to the drone and also blocks if there is no response. Are you sure, the drone uses 192.168.1.1 and does not switch its IP or port ? Does it respond if you ping it ?
Am I right that you edit/forked the code of PS-Drone? That's OK of cause, I am sure your new functions are well done, but maybe you forgot a symbol or accidentally messed up something somewhere else. If you like, I can take a look at your code.
You are welcome to mail me directly.
cu,
Philipp
Hi Phillip,
I've Found out that the problem most likely lies in Mike's IDE. PS-Drone creates several threads, but IDLE seems to have trouble with these. Also, CTRL-Cing a multithreaded script seems not to have any effects on the other threads. My solution is using e.g. SPE, everything works well there.
cu,
Andreas
Hello Andreas,
yes, your guess was absolutely right. We found out, that there was something wrong with the python-installation. Mike was able to ping the drone, but not to connect anything python. He switched to an other Linux (Ubuntu on VirtualBox) and everything was fine.
cu,
Philipp