Skip to content
Public Source Seeking Repository
C++ Python
Branch: master
Clone or download
Latest commit f1dac3c Oct 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Conversion added crazyflie firmware Sep 25, 2019
crazyflie-firmware @ 5a839d5 added crazyflie firmware Sep 25, 2019
readme_fig update pipelin fig Sep 25, 2019
.gitmodules added crazyflie firmware Sep 25, 2019
README.md Update README.md Oct 9, 2019

README.md

Source Seeking on a Nano drone

In this repository, we include all code necessary for inference of a full 8-bit quantized DQN policy on a BitCraze CrazyFlie. Our methodology is summarized as:

Air Learning

This repository consists of the following three parts:

  • Training: the settings required to train with the Air Learning platform.
  • Conversion: the python code for conversion from a Tensorflow checkpoint (.cktp) to a piece of c++ code.
  • crazyflie-firmware: the crazyflie firmware enabling inference.

The Project

Paper: https://arxiv.org/abs/1909.11236

Title: Learning to Seek: Autonomous Source Seeking with Deep Reinforcement Learning Onboard a Nano Drone Microcontroller

Authors: Bardienus P. Duisterhof, Srivatsan Krishnan, Jonathan J. Cruz, Colby R. Banbury, William Fu, Aleksandra Faust, Guido C. H. E. de Croon, Vijay Janapa Reddi

Video:

ss_vid

Install

The following instructions are tested on Ubuntu 18.04

Training

First of all, install the Air Learning platform according to the instructions on its github page. Verify your installation was successfull before proceeding.

Your installation will contain an airlearning-rl folder, which is the folder we need to change to train a source-seeking agent. Simply do a:

cd ~/airlearning-rl
git fetch --all
git checkout source-seeking

This will provide you with all the algorithmic changes we made to Air Learning.

Conversion

dependencies

pip3 install tensorflow matplotlib numpy 

Crazyflie-firmware

dependencies

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
sudo apt install gcc-arm-embedded

Clone

git clone https://github.com/harvard-edge/source-seeking --recursive
cd crazyflie-firmware 
git submodule init
git submodule update

Use

Training

Once the source seeking branch in airlearning-rl is checked out, you can proceed using airlearning in a normal fashion. Use the settings.py file to adjust the environment.

Conversion

Use main.py in the conversion folder to call the functions needed. For the current settings, the provided model will be converted in a total of 1,000 iterations. Settings can be altered in settings.py.

CrazyFlie Firmware

make clean
make -j4
make cload

Note: the crazyflie won't take-off without a light-sensor connected. We designed the code as such to verify sensor connectivity before commencing a run. If no sensor is present, alter this file, by commenting out all 'TS2591XXX' functions, and replace 'sensor_read' with something else (e.g., random values).

Contact

For help, contact Bart (bduisterhof@g.harvard.edu)

Contributors

Bardienus Duisterhof (bduisterhof@g.harvard.edu)

Srivatsan Krishnan (srivatsan@seas.harvard.edu)

William Fu (wfu@college.harvard.edu)

You can’t perform that action at this time.