I’ve been out of the Crazyflie scene for a few months due to newfound (overwhelming) responsibilities as a dad and homeowner, but recently I came back because I had a few moments to spare. I’ve almost finished setting up my “workshop” in my new house and once I get my shop stool and soldering station put together, I’ll have more entries to make. But for now, I thought I should just get up and flying again.
A number of things have changed since I was out of the mix. Firstly, Crazyflie Nano (CF1) and Crazyflie 2 now have a unified firmware source tree. I covered that in my last post. Mac OS X is currently shipping El Capitan (OS X 10.11), the Crazyflie Python client has had a couple releases, and the firmware has as well. First thing for me was to get running on Mac OS X.
I went to the Crazyflie client Read Me, and since I’m used to using MacPorts, I read up on that install. It looks pretty much the same as it did a while back but now they’re using Python 3.4. I decided to install per the instructions but found a few problems along the way. So, in the interest of making this easier, I’m posting my steps here. Of course, I’ve also submitted a pull-request to Bitcraze to update the Read Me. Without further adieu, here’s the install steps that got me running.
First, the specs:
Mac OS: 10.11.1
1) Download MacPorts for El Capitan and open the package to install it. Then follow the instructions to get it all setup and ready to install ports.
cd ~/Downloads curl http://iweb.dl.sourceforge.net/project/macports/MacPorts/2.3.4/MacPorts-2.3.4-10.11-ElCapitan.pkg -O open ~/Downloads/MacPorts-2.3.4-10.11-ElCapitan.pkg
2) Install cfclient dependencies using MacPorts. This intentionally leaves out pyusb34 which, as of this writing, is a non-existent port.
sudo port install libusb python34 py34-SDL2 py34-pyqt4 py34-pip
3) Set Python 3.4 as the default for both the python and python3 commands. Just a little warning, this will force python to invoke the MacPorts python instead of the default Apple install on your machine.
sudo port select --set python python34 sudo port select --set python3 python34 sudo port select --set pip pip34
4) Use pip to install pyusb.
sudo pip install pyusb
5) Install pyqtgraph with MacPorts. Go find something to do after you start this, it will take a long time!
sudo port install py34-pyqtgraph
Interestingly, it looks as if the pyqtgraph install also installs Python 2.7 as of this writing. That’s OK though, it has a pleasant side-effect in that it makes getting the environment working for firmware compilation a little easier. For some reason, compilation still requires Python 2.7 at this point. I’ll cover the dev environment in my next post!
So, now all that’s left is to download the client app if you don’t already have a Git clone. Change into the directory and run:
and you should be on your way to flying. If you still need more help. Check out the Bitcraze wiki page about the GUI app!