1. Getting Set Up |
Using the Raspi. to Fly the Drone |
As a teacher I am always looking for new ways to engage students in learning and make it exciting and different. I remember LOGO from my school days and it was fairly dull. We then discovered you could upload a bitmap image so we created race courses and coded the turtle to drive round in the quickest time. Now in 2016 why not take the same activity and learning concepts and apply them to a Drone? The Parrot Drones use a Python API which means you can access and control the Drone directly with Python Code. This excites students and opens up a load of learning possibilities.
|
|
2. Basic Flight ControlsOne of the great features of using Python to interact with the Drone is that you can pre-program a flight path. The commands are very simple and pretty self explanatory. To get started try:
import libardrone from time import sleep drone = libardrone.ARDrone() drone.takeoff() sleep(3) drone.move_forward() sleep(2) drone.land() sleep(3) drone.halt() A full list of controls is avaiable in the demo.py library 3b. Getting the Camera feedIf you have installed openCV and still have the patience to carry on then the next step is to install a different Drone API. This one ' PS-Drone' offers a more extensive selection of code to control every element of your Drone from the sensors to the Navigation. The PS-Drone-API is a full featured SDK, written in and for Python, for Parrot's AR.Drone 2.0. It was designed to be easy to learn, but it offers the full set of the possibilities of the AR.Drone 2.0, including Sensor-Data (aka NavData), Configuration and full Video-support.
Download the API from here: |
3. Using the CameraTo access the Drone's camera you will require openVC which is an advanced image processing library. This enables you to stream the video and also manipulate the images. The install process is fairly lengthy and requires a good few hours of your time. Luckily there is an excellent step by step guide available from pyimagesearch which breaks down the whole process into simple stages and provides a detailed commentary on what each stage is doing and how to check you have completed it correctly.
Head over to pyimagesearch and follow the guide 3a. Install openCV |
LANDING THE DRONE WITH THE RASPBERRY PI |
Drone Glove Test One |
|
|