Cannot get Crazyflie Python API to work

Firmware/software/electronics/mechanics
Post Reply
iscoyd
Beginner
Posts: 8
Joined: Mon Mar 04, 2019 7:42 am

Cannot get Crazyflie Python API to work

Post by iscoyd »

Hello, I am working with the Crazyflie 2.0 quadcopter, and am trying to get it working from my Macbook Pro (in native mode, not VM). I followed the Bitcraze Wiki and am able to bring up the main window showing that there is a radio connection between my Crazyradio PA dongle (radio://0/80/2M, address: 0xE7E7E7E7E7) and the Crazyflie. The lights on the dongle are flashing red/green at a very fast rate, but essentially I'm able to read the status for thrust, pitch, roll, yaw and height (via Flow Deck). When I move the Crazyflie around by hand the blue & brown horizon moves around accordingly.

My issue is this: I'm having a hard time getting the Python API to work. Following the instructions, I created the virtualenv container and tried to run autonomousSequence.py from crazyflie-lib-python/examples (after activating the venv environment) but when I do so I get the error:
Traceback (most recent call last):
File "autonomousSequence.py", line 37, in <module>
import cflib.crtp
ModuleNotFoundError: No module named 'cflib'
However, I can see that cflib is installed.

Can you please let me know how to get the Python API working? Thanks!
iscoyd
Beginner
Posts: 8
Joined: Mon Mar 04, 2019 7:42 am

Re: Cannot get Crazyflie Python API to work

Post by iscoyd »

Never mind my previous post, I was able to get it to work!

I had not installed cflib. Once I did that with: pip3 install cflib it started working well.

In short, I'm all set :)
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Cannot get Crazyflie Python API to work

Post by arnaud »

Thanks for posting your solution :-).

As a note, if you want to work on the lib itself as well, you can also install it from source by typing "pip install -e ." in the source folder of the crazyflie-lib
Post Reply