Salma MayorquinTerry Rodriguez
Published © MIT

MajorTom: Alexa Voice Controlled ARDrone 2.0

Cellular backdoor with Hologram Nova on Raspberry Pi flask-ask server-Amazon Alexa controlled.

BeginnerFull instructions provided4 hours5,287

Things used in this project

Story

Read more

Schematics

Setup Diagram

Hologram Nova connected to raspberry pi via usb. The raspberry pi and AR Drone are connected via AR Drone's wifi network. Alexa queries responses from raspberry pi cellular flask-ask application

Code

app.py

Python
flask-ask application
#!/usr/bin/env python
from flask import Flask
from flask_ask import Ask, statement
import ardrone
import time

app = Flask(__name__)
ask = Ask(app, '/')

drone = ardrone.ARDrone()
time.sleep(5)
drone.reset()

@app.route('/')
def home():
    return 'Ground control to Major Tom'
    
@ask.intent('reset')
def reset():
    drone.reset()
    speech_text = 'resetting'
    return statement(speech_text)
    
@ask.intent('takeoff')
def takeoff():
    drone.takeoff()
    speech_text = 'taking off'
    return statement(speech_text)
    
@ask.intent('land')
def land():
    drone.land()
    speech_text = 'landing'
    return statement(speech_text)

@ask.intent('hover')
def hover():
    drone.hover()
    speech_text = 'hovering now'
    return statement(speech_text)
    
@ask.intent('goForward')
def goForward():
    drone.move_forward()
    speech_text = 'going forward'
    return statement(speech_text)
  
@ask.intent('goBackward')
def goBackward():
    drone.move_backward()
    speech_text = 'going backward'
    return statement(speech_text)
    
@ask.intent('goLeft')
def goLeft():
    drone.move_left()
    speech_text = 'going left'
    return statement(speech_text)
    
@ask.intent('goRight')
def goRight():
    drone.move_right()
    speech_text = 'going right'
    return statement(speech_text)
    
if __name__ == "__main__":
    app.run()

Credits

Salma Mayorquin

Salma Mayorquin

21 projects • 381 followers
Software engineer AI/ML & hardware tinkerer interested in embedded AI. Lets hack the change we want to see!
Terry Rodriguez

Terry Rodriguez

21 projects • 194 followers
hack the change you want to see

Comments