Flying a Drone from Myro and IPython Notebook

In [1]:
from Myro import *
In [2]:
makeRobot("ROSARDrone")
Out[2]:
ROSARDrone

Time to take off!

In [10]:
speak("Please prepare for liftoff")
for i in range(10, 0, -1):
    speak(str(i))

reset()
takeoff()
Please prepare for liftoff
10
9
8
7
6
5
4
3
2
1
In [7]:
turnLeft(1, .5)
In [8]:
gamepad()
        Pad   Action
     ------   -------
 Left/Right   turnLeft() and turnRight()
    Up/Down   forward() and backward()

     Button   Action
     ------   -------
          1   stop()
          2   takePicture()
          3   beep(.25, 523)
          4   beep(.25, 587)
          5   beep(.25, 659)
          6   speak('Hello. My name is .')
          7   speak('Ouch! I'm a sensitive robot.')
          8   speak('I'm hungry. Do you have any batteries?')

Gamepad is now running... Press button 1 to stop.
In [22]:
turnLeft(1, .6)
In [16]:
land()

And snap a picture:

In [4]:
p = takePicture()
calico.display(p)

Take 15 seconds worth of pictures and display them.

In [20]:
for i in timer(15):
    calico.animate(takePicture())

Using a list of pictures (for ten seconds) to create an animated gif.

In [15]:
lst = []
for t in timer(5):
    p = takePicture()
    show(p)
    lst.append(p)
filename = "drone-%f.gif" % currentTime()

savePicture(lst, filename)
calico.display(calico.HTML("<img src = %s>" % filename))

Now display the animated gif

In [28]:
 
In [ ]: