Flying Car Project

Home | Installation | Teleop Package | Mocap Setup | Crazyflie Control Modification | Useful BASH

How To Run Crazyflie using ROS and Standalone Cfclient.

  1. Install ROS
  2. This Guide uses ROS Indigo on a Ubuntu 14.04 Machine. Follow ths guide: http://wiki.ros.org/indigo/Installation/Ubuntu

    Remember to add source /opt/ros/indigo/setup.bash to your .bashrc

  3. Create a ROS workspace.
  4. You can follow the guide here: http://wiki.ros.org/catkin/Tutorials/create_a_workspace.

    Make sure to run source devel/setup.bash from your workspace directory on every new terminal you use for ROS, or you will not get access to your pacakges. You can also put this in your .bashrc

    Additionally, the following alias may be handy (you can add it to ~/.bash_aliases; it is already added on Picobug #1) alias setupros='cd ~/workspace;source devel/setup.bash. You may have to change the name of your workspace or its location if it is not the same as above. This alias, when run, moves you to your workspace and sets it up automatically.

  5. Get the crazyflie_ros package.
  6. Get the package (2 options): (
    1. Clone https://github.com/spohorec/flying_car into your workspace/src folder. run catkin_make from the workspace directory. This package allows ROS to interact with the crazyflies. You may need to install git if you haven't already.
    2. (
    3. You can also directly download the repo from github.com as a zip. If you choose this method, you may want to rename the folder from crazyflie_ros-master to crazyflie_ros.

    Run catkin_make from your workspace folder to build the package. Remember that you need to rerun this command everytime to change source code in any of your packages (similar to compiling) before ROS commands will make use of it.

  7. Get hector_quadcopter package.
  8. run sudo apt-get install ros-indigo-hector-quadcopter. This gives teleop control from crazyflie_ros.

  9. Get robot_localization package.
  10. run sudo apt-get install ros-indigo-robot-localization.

  11. Get mocap_optitrack package.
  12. From Github.

  13. Get the Bitcraze Cfclient
  14. First, need to install dependecies run the following:

    sudo apt-get install python3 python3-pip python3-pyqt4 python3-zmq

    sudo pip3 install pyusb==1.0.0b2

    sudo pip3 install pyqtgraph appdirs

    Then you can run sudo pip3 install cfclient. This will install the client with a GUI interface for connecting to and controlling your crazyflies. Run:

    sudo pip3 install cfclient.

    This should build some files in /etc/udev/rules.d. These should be named 99-crazyradio.rules and 99-crazyflie.rules.

    If they don't exist, run the following:

    sudo echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev"' >> 99-crazyradio.rules

    sudo echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev"' >> 99-crazyflie.rules

    If the echo command doesn't work. Create the files by hand and copy in the echo'd text. Remember to sudo!

    Regardless, run the command:

    echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="0101", MODE="0664", GROUP="plugdev"'' >> 99-crazyradio.rules

    This corrects for the Crazyradio sometimes appearing with Product ID 0101.

    At this point, reboot your computer to reset the Udev rules. This can apperently be done without reboot but I've found consistant success only by rebooting.

    The Crazyflie client should, at this point, be functional. Plug in game controller and run cfclient from the console. This should start the client and you should be able to connect to a Crazyflie.

    See the Teleop Packagefor ROS launching and control information.