Controlling Parrot AR Drone 2.0 using Docker containerhuilu/slides580ksp20/demo3.pdf · Parrot...
Transcript of Controlling Parrot AR Drone 2.0 using Docker containerhuilu/slides580ksp20/demo3.pdf · Parrot...
Controlling Parrot AR.Drone 2.0
using Raspberry PI 3 & Docker
By Ihab AbuHilal
B00624202
Agenda
Overview
Raspberry Pi 3 Model B+
Parrot AR.Drone 2.0
PYARDRONE Library
Python Code
Create the Docker Container for Raspberry Pi
Demo
Conclusion
Future Work
Notes
Questions
Overview
In this project we will develop docker container that runs on Raspberry PI 3
and remote-control Parrot AR.Drone 2.0 using keyboard
Using
Raspberry Pi 3 Model B+
Parrot AR.Drone 2.0
Docker
Python 3
Raspberry Pi 3 Model B+
Tiny credit card size computer, single board computer
quad core 64 bit ARMv8 CPU operating at 1.4GHz
1GB LPDDR2 SDRAM
Wireless LAN, Bluetooth, Ethernet, USB, HDMI
SD card support microSD format for OS and data storage
40 GPIO (general-purpose input/output) pins
Raspbian Stretch OS
Price $35
Parrot AR.Drone 2.0
AR.Drone 2.0 is a small quadcopter with a WiFi interface acts as a WiFi
hotspot
high-definition Camera
Can be controlled using an iOS or Android smartphone or tablet
Processor: ARM 1GHz 32 bit, RAM: 1GB, OS: Linux 2.6.32
USB 2.0, WIFI
UDP is using to communicate with the drone
AT Commands are sent to specific ports
Price $90
Communication With the Drone
the AR.Drone creates a WIFI network called adrone2_xxx 192.168.1.1
the client device connects to the network & requests an IP address from the
drone DHCP server.
the AR.Drone DHCP server grants the client with an IP address which is
192.168.1.2
the client device can start sending requests the AR.Drone IP address and its
services ports
Main Communication AR.Drone Ports
Controlling and configuring the drone is done by sending AT commands on
UDP port 5556.
navdata - Information about the drone (like its status, its position, speed
etc.), sent by the drone to its client on UDP port 5554
A video stream is sent by the AR.Drone to the client device on port 5555 TCP.
PYARDRONE Library
library written in Python3 and it provides a high-level API to communicate
with the AR.Drone
requires Python 3.4 or later and OpenCV 3.0 or later (for video support).
to install the library run:
pip install pyardrone
class pyardrone.ARDrone(*, host='192.168.1.1', at_port=5556, navdata_port=5554,
video_port=5555, watchdog_interval=0.5, timeout=0.01, bind=True, connect=True)
import time
from pyardrone import ARDrone
drone = ARDrone()
drone.navdata_ready.wait() # wait until NavData is ready
while not drone.state.fly_mask:
drone.takeoff()
time.sleep(20) # hover for a while
while drone.state.fly_mask:
drone.land()
Create the Docker Container for
Raspberry Pi
Installing Raspbian Stretch
Install python3 and OpenCV4
Install Docker
Create folder and add all the needed files
Create Dockerfile “Dockerfile”
FROM python:3
ADD control_ardrone.py /
ADD start.sh / -- > Shell script file to run the python file
RUN chmod +x start.sh
RUN pip install pyardrone
Create Docker Image from Dockerfile
docker build --tag "ardrone_remotecontrol:v1" .
Running the docker container
$docker run --privileged -it ardrone_remotecontrol:v1 /bin/bash
$./start.sh
Demo
https://youtu.be/ck2lkFNhaaE
Key Action
Enter Takeoff
Space Land
CTRL+z Exit
Up Arrow Move up
Down Arrow Move Down
Right Arrow Rotate Right
Left Arrow Rotate Left
h Hover
w Move forward
s Move backward
a Move left
d Move right
Conclusion
using docker container will save time and effort by using base images withneeded libraries and frameworks
Docker provide standardization and improve productivity, so for any futurework this new image can be built on top of this one and used for newapplications
Compatibility and maintainability this docker container will work on any Linuxmachine that support such base images and libraries
Docker is easy to create
Connecting to a drone with an API will make hacking on drone becomes easy,and with ability to capture images , videos , using docker containers andconnecting to cloud services will open the space for more Internet of Thingsapplications
Future work
Adding more keys such as changing speed, perform automatic flying such as fly in a polygonshape or a triangle etc.
Running face recognition on the drone images
Running speech recognition to drive the drone
Objects recognition to perform certain tasks
Perform computation and processing on the cloud such as Microsoft Azure Face API
Use more than one docker container to perform microservices on images and info captured bythe drone
Using ardrone-wpa2 (wpa2 support for AR.Drone 2.0) project , to secure the WiFi connectionand let the drone join an existing WiFi connection , that will make connecting to internet andhave more than one device in the network more easy.
The parrot AR.Drone 2.0 doesn’t fly quite as stably as the much more expensive new parrotbebop 2 drone, it is better to use the new drone which also provide better images and videoquality.
Notes
Parrot AR actually flies a lot better without the safety hull
The batterie take hours to charge and then last for about 10-15 minutes of
flying. I recommend buying two additional batteries.
By default, the Parrot AR.Drone 2.0 serves a wireless network that clients
connect to. Every time you want to try something, you need to disconnect
from your network and get on the drone’s network it was annoying.
A major security issue of the Parrot AR.Drone is it can be easily hacked since
they are using an open network infrastructure.
It is better to work wide and safe space
Thank You
Questions?