Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.


Drone Pilot

Autonomous Pilot software that runs on companion computers.

Main functionalities:

  • Communication with flight controllers, including <Pixhawk, PX4, APM and MultiWii>.
  • Bridge between a ground station computer and flight controller, this allows to control vehicles from a computer.
  • Black box of flight data (save all the data from the flight controller and ground station).
  • Position control algorithms. Uses data from a motion capture system and compute the pilot commands to keep the vehicle in a desired position.
  • Uses DroneKit (when using Pixhawk and PX4) to perform advanced missions.

The objective of this repository is to do research using multirotor vehicles and learn how to develop with them.

Vehicle flying using a hover controller (

Flying quadcopter

This library uses a companion computer alongside a flight controller, you can check this post

Current scripts:

MultiWii scripts:

  • -> Send joystick commands via UDP from a ground-station running Matlab to a flight controller running MultiWii software.

Multiwii joystick (naze32)

  • -> Computer pilot commands (using a PID structure) to make a Multiwii multicopter hold a specified x,y,z coordinate.

Pixhawk scripts:

  • -> Reads data from a flight controller (either SITL or real) and displays it. Dronekit related. Script that will be used first to ensure the communication with the flight controller is working.

  • -> Script that makes a pixhawk take off in a secure way. Dronekit related.

Example take-off

  • -> Send joystick commands via UDP from a ground-station running Matlab to a pixhawk. Dronekit related.

Pixhawk joystick

  • -> Script that logs data from a vehicle and a MoCap system. Dronekit related.

Example logdata

  • -> Script that commands the vehicle to follow waypoints.

Example goto

  • -> Script that send the vehicle a velocity vector to form a square and diamond shape.

Example velocity vector

Supported flight controllers:

  • Multiwii boards (using MSP). Currently using on this examples a naze32.

  • Pixhawk / PX4 / APM (using mavlink & DroneKit 2.0)

Supported companion computers:

  • Raspberry Pi (B+, 2 or Zero)

  • oDroid U3

Note: Code is in python, so, any linux companion computer should be able tu run it.

How to:


  1. Update your Pi...
``` sudo apt-get update sudo apt-get upgrade ```
  1. Next this one:
``` sudo apt-get install python-dev ```
  1. More utilities:
``` sudo apt-get install screen python-wxgtk2.8 python-matplotlib python-opencv python-pip python-numpy python-serial ```
  1. Then mavlink and mavproxy:
``` sudo pip install pymavlink sudo pip install mavproxy sudo pip install dronekit ```
  1. Clone this repository:
``` git clone ```

Have a read here for a tutorial on DroneKit and SITL.


Ubuntu LTS

Install Ubuntu

Connect to internet or a network

Have in mind that this particular configuration is for the wireless setup in my laboratory, you will have to change this part so that it suits your own configuration.

  • Mount a USB to install two packages: libw30, wireless-tools (packages must be for armhf)
  • List devices: sudo fdisk -l
  • Create USB folder sudo mkdir /media/usb
  • Mount device sudo mount /dev/sda2 /media/usb
  • Navigate to the folder and install:
sudo dpkg -i libiw30_30-pre9-8ubuntu1_armhf.deb
sudo dpkg -1 wireless-tools_30-pre9-5ubuntu2_armhf.deb
  • Add this information to interfaces:
auto wlan0
iface wlan0 inet dhcp
	wireless-essid	jws-uav-lab
	wireless-mode	Managed
	wireless-key	s:#########
  • Reboot and you will be connected!

Utilities and extra software

  • sudo apt-get install openssh-server
  • sudo apt-get install python-dev
  • sudo apt-get install screen python-wxgtk2.8 python-matplotlib python-opencv python-pip python-numpy python-serial python-twisted htop git
  • sudo pip install pymavlink
  • sudo pip install mavproxy
  • sudo pip install dronekit

For higher UART speed

Edit /boot/config.txt file, and add to the end:

# Higher UART Speed


This code is still under heavy development, everyday I add and remove stuff. Proceed with caution.

Social networks:

You can follow us in this URL's:


updateDronePilot shell script


echo "Deleting previous directory..."
rm -rf DronePilot/
echo "Done."
echo "Cloning DronePilot repository: "
git clone
#echo "Copying mavinit.scr to proper directory..."
#mkdir DronePilot/TestQuad
#mv DronePilot/mavinit.scr DronePilot/TestQuad/
#echo "Done."
echo "Ready to do: --master=/dev/ttyAMA0 --baudrate 115200 --aircraft TestQuad"
echo "Dont forget to go inside the DronePilot directory."



ServerAliveInterval 5
ClientAliveInterval 5



auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet static
  wireless-channel 1
  wireless-essid RPiAdHocNetwork
  wireless-mode ad-hoc
sudo ifdown wlan0
sudo ifup wlan0
sudo apt-get install dhcp3-server
ddns-update-style interim;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet netmask {

In case of failure starting DHCP:

sudo service ifplugd stop


sudo modprobe -v bcm2835-v4l2
git clone
cd h264_v4l2_rtspserver
cmake .
make install
h264_v4l2_rtspserver -H <height> -W <width> -F <fps>

To start:


Low latency video

  • Same DHCP configuration as before

  • Install "hostapd"

sudo apt-get install hostapd netcat-traditional

  • Interfaces:
auto wlan0
iface wlan0 inet static
  • /etc/hostapd/hostapd.conf
  • /etc/default/hostapd
  • On rpi, create fifo file:
mkfifo fifo.500 
  • On client (mac):
brew install netcat
brew install mplayer
  • To start (mac):
netcat -l -p 5000 | mplayer -fps 60 -cache 1024 -
  • To start (rpi):
cat fifo.500 | nc.traditional 5000 &
/opt/vc/bin/raspivid -o fifo.500 -t 0 -b 50000


Automatic pilot that can control and fly several drones, including Pixhawk's, APM's and MultiWii's







No releases published


No packages published