Module2 - project - Setup and configuration

The Crazyflie

crazyflie.jpg

The Crazyflie is a small Unmanned Aerial Vehicle (UAV) that poses many interesting theoretical and practical challenges with respect to control and state estimation. It is produced by the company Bitcraze Links to an external site.. This short tutorial is designed to get you to set up the necessary software on your computer.

Warning: Be aware that the UAV might possibly be able to hurt you (or people in your surrounding, or pets, or stuff) if you are extremely unlucky, for instance if you get a rotor in your eye. So use some caution.

Computer Environment

Note: If you want a slightly more efficient design flow with the Crazyflie, and you think you will be able to set it up yourself on your computer,  it is recommended to take the extra effort and install the software stacks on your native OS (support for Linux, Windows and OSX). But it is some extra effort, and you are then on your own. So we will use a setup that (should) work with the installation you have done in module 1 in the course.

To get started quickly, we will in this tutorial make use of a new virtual machine (VM) running a Linux distribution, equipped with the necessary tool-chains to compile code and operate the Crazyflie. This fits the VirtualBox we used in module 1. This new VM (BitcrazeVM2017.03.ova) is hence setup in VirtualBox in your host OS, as a parallel choice to the previously installed Ubuntu 16.04 Wasp VM (which we will not use here).

On your Host Computer

  • If not already available on your computer, download and install Oracle's VirtualBox [1] Links to an external site. (Or VMware, note that VMware is currently used in the official guide by Bitcraze, but we will use VirtualBox, specifically version 5.2.8, as it may be run free of charge on Windows, Linux and OSX, contrary to VMware). VirtualBox was also used for the WASP VM, so most of you should already have it installed. If your version of VirtualBox is earlier than 5.2.8 we recommend you upgrade to 5.2.8 since we then know that the following works.
  • Download and install the "VirtualBox Extension pack" for version 5.2.8 found here [2] Links to an external site.. This is required to use the USB dongle on OSX systems, and may be required on Windows and Ubuntu too.
  • Download the virtual machine (BitcrazeVM2017.03.ova) from [3] Links to an external site.. Note that browsers such as Firefox and Chrome might have a buffer size of 2GB, meaning that your file (2.17GB) then will be corrupted if using the direct download link. If this is a problem then instead use the torrent or mega-download links (both of which will require additional OS-dependent software). Note also that there is a later VM available, 2018.01, but we chose to use the 2017.03 version with which we have verified functionality.
  • Open the VirtualBox application and use "import appliance..." to load the BitcrazeVM2017.03.ova.
  • You probably want to add a shared folder between the host and guest OS to make file exchange simpler. Select the new Virtual machine and click Settings and then the Shared folder tab. To add a shared folder click the icon near the menu entry Access to the right. Select the folder you was on the host and select Auto-mount and Make Permanent and then click OK.
    Bitcraze shared folder.png
  • Start the virtual machine

In the Virtual Machine

  • When you boot the VM you will be notified that there is a new version of Ubuntu available. Don't install the new version.
  • To get the Shared folder to work, open a terminal (click Terminal Emulator on the desktop) and execute
    sudo adduser bitcraze vboxsf
    Now log in and out of the virtual machine to make this change take effect

    You can see the shared folder if you click on the File System icon on the desktop and the go to the sf_Shared folder
  • To enable drag and drop and shared clipboard to go the Devices meny of the VM and select Bidirectional for "Shared Clipboard" and "Drag and Drop"
  • If you want to change from US to Swedish (or some other keyboard layout) click the icon in the top left corner (blue and white) and select Settings (to the right) and the Keyboard tab as in the images below. Add the layout you want
    Bitcraze settings.png Bitcraze keyboard.png
  • Press the desktop icon "Update all projects". This clones all the necessary GitHub repositories and pulls the stock firmware and can be used to reset the code at any time, overwriting your changes (if you do this in the future, make sure to remember to backup any code you have developed which you want to save, otherwise it will be lost...)
  • The VM is installed with Eclipse, for which a nice introductory tutorial is found here [4] Links to an external site.. However, you can install any editor of your choice in the VM, and our own suggestion is to use Atom.  To install atom write
sudo add-apt-repository ppa:webupd8team/atom 
sudo apt-get update sudo apt-get install atom

The password to the VM is "crazyflie" in lowercase letters and the username is bitcraze.