Skip to content
Public Source Seeking Repository
C++ Python
Branch: master
Clone or download
Latest commit f1dac3c Oct 9, 2019
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 Update Oct 9, 2019

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


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




The following instructions are tested on Ubuntu 18.04


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.



pip3 install tensorflow matplotlib numpy 



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


git clone --recursive
cd crazyflie-firmware 
git submodule init
git submodule update



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


Use 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

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).


For help, contact Bart (


Bardienus Duisterhof (

Srivatsan Krishnan (

William Fu (

You can’t perform that action at this time.