Beginner question

Firmware/software/electronics/mechanics
luckpolar
Member
Posts: 30
Joined: Thu Oct 09, 2014 11:04 am

Beginner question

Post 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 !~
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Beginner question

Post 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.
luckpolar
Member
Posts: 30
Joined: Thu Oct 09, 2014 11:04 am

Re: Beginner question

Post 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.
luckpolar
Member
Posts: 30
Joined: Thu Oct 09, 2014 11:04 am

Re: Beginner question

Post 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?
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: Beginner question

Post 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.).
luckpolar
Member
Posts: 30
Joined: Thu Oct 09, 2014 11:04 am

Re: Beginner question

Post 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.
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: Beginner question

Post 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
?
luckpolar
Member
Posts: 30
Joined: Thu Oct 09, 2014 11:04 am

Re: Beginner question

Post 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~
luckpolar
Member
Posts: 30
Joined: Thu Oct 09, 2014 11:04 am

Re: Beginner question

Post 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.
luckpolar
Member
Posts: 30
Joined: Thu Oct 09, 2014 11:04 am

Re: Beginner question

Post 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...
Post Reply