Connecting to the hardware

Connecting to Parrot 2.0 is also quite easy; you'll just need to connect to its WLAN access point. However, to add control via a programming language, such as Python, you'll need to install some libraries for the Raspberry Pi. First, let's download the libraries. You'll get these from https://github.com/venthur/python-ardrone. Download the files to your Raspberry Pi by typing wget https://github.com/venthur/python-ardrone. Now create a simple program to demonstrate that the system works. Here is the code:

import libardrone 
from time import sleep 
drone = libardrone.ARDrone() 
drone.takeoff() 
sleep(3) 
drone.move_forward() 
sleep(2) 
drone.land() 
sleep(3) 
drone.halt() 

This program is quite simple. You import the library and ...

Get Raspberry Pi Robotic Projects - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.