Page 1 of 2

Beginner question

Posted: Sat Oct 11, 2014 7:48 am
by luckpolar
Hi,
I'm a beginner of Crazyflie ,and I want to develope a program on PC to control my Crazyflie.
I have learned C++ programing and I find that the Crazyflie may be developed by Python.
So, what should I do?
Learning Python Programing and what else?
Thank you !~

Re: Beginner question

Posted: Wed Oct 29, 2014 8:54 pm
by tobias
Python is great for making progress quickly so it might be worth learning. There are some examples in the example folder in the cfclient and also here.

Re: Beginner question

Posted: Sat Nov 01, 2014 9:40 am
by luckpolar
tobias wrote:Python is great for making progress quickly so it might be worth learning. There are some examples in the example folder in the cfclient and also here.
I'm learning the Python programing. Thanks a lot.

Re: Beginner question

Posted: Sun Nov 16, 2014 2:49 am
by luckpolar
tobias wrote:Python is great for making progress quickly so it might be worth learning. There are some examples in the example folder in the cfclient and also here.
How should I run the Sample in eclipse? Besides python2.7 and pyqt4, anything else needed?

Re: Beginner question

Posted: Sun Nov 16, 2014 5:00 am
by whoenig
There are some additional dependencies (pyusb, pygame etc.), but if you are able to run the cfclient, you have most likely everything you need.
For the beginning, you should try to run the samples directly without eclipse. Open a command prompt, navigate to the folder with the samples, and type "python ramp.py". This should find your flie, connect to it and ramp up the motors.
I am not sure how easy it is to get going with eclipse, however you can also use PyCharm (https://www.jetbrains.com/pycharm/). There you simply open the file (e.g. ramp.py) and select Run and it should do everything else for you (i.e. no separate project file needed etc.).

Re: Beginner question

Posted: Tue Nov 18, 2014 4:28 am
by luckpolar
whoenig wrote:There are some additional dependencies (pyusb, pygame etc.), but if you are able to run the cfclient, you have most likely everything you need.
For the beginning, you should try to run the samples directly without eclipse. Open a command prompt, navigate to the folder with the samples, and type "python ramp.py". This should find your flie, connect to it and ramp up the motors.
I am not sure how easy it is to get going with eclipse, however you can also use PyCharm (https://www.jetbrains.com/pycharm/). There you simply open the file (e.g. ramp.py) and select Run and it should do everything else for you (i.e. no separate project file needed etc.).
I downloaded the PyCharm 3.4.1 and import the crazyflie-clients-python-master(download fromhttps://github.com/bitcraze/crazyflie-clients-python) into the PyCharm.
Then, I ran the ramp.py ,but it says "ImportError: No module named usb".
So,How should I do now?
I have already download the pyusb and libusb from the install page of wiki(http://wiki.bitcraze.se/projects:crazyf ... ls:install),and installed the PyQt4 64bits pyGame 64bits for my Python 2.7.6 64bits. My computer system is Win7 - 64bits.

Re: Beginner question

Posted: Tue Nov 18, 2014 5:02 am
by whoenig
It sounds like it can't find pyusb. How did you install it? Did you run

Code: Select all

python setup.py install
?

Re: Beginner question

Posted: Tue Nov 18, 2014 9:04 am
by luckpolar
whoenig wrote:It sounds like it can't find pyusb. How did you install it? Did you run

Code: Select all

python setup.py install
?
I do the same way in your advices and it doesn't works.

it says that:

Traceback (most recent call last):
File "setup.py",line 16, in (module)
raise Exception("Cannot run git: Git is required to generate packages!")
Exception:Cannot run git:Git is required to generate packages!

BTW: I don't know how to post a photo,so I type the code above~

Re: Beginner question

Posted: Tue Nov 18, 2014 11:50 am
by luckpolar
whoenig wrote:It sounds like it can't find pyusb. How did you install it? Did you run

Code: Select all

python setup.py install
?
My probleme solved!~
First of all, I open the cmd.exe and run the setup.py of pyusb file ,
then I copy the file named "usb" to the crazyflie-clients-python-masters file
Finally, I run the "cfclient" in bin in PyCharm and it works~

BTW: There are still some modules needed for the crazyflie client.
For example:
scipy,numpy,pyqtgragh and etc.

Re: Beginner question

Posted: Wed Nov 19, 2014 2:07 am
by luckpolar
whoenig wrote:It sounds like it can't find pyusb. How did you install it? Did you run

Code: Select all

python setup.py install
?
Though I could run the client in the PyCharm, I still don't know how to run the setup.py in cmd.exe...