Skip to content

thinktecture/api-summit-2017-apis-at-home

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

api-summit-2017-apis-at-home

This repository contains the code for the API Bridge, Alexa Skill and EV3 program. For more in-depth information, please take a look at this blog post: https://manuel-rauber.com/2017/05/30/alexa-start-lego-robot-connecting-amazon-alexa-to-lego-mindstorms-ev3/

Architecture

The following image describes the architecture used to use Alexa to command an EV3 robot.

Architecture

API Bridge

The API Bridge is currently hosted on Azure, but can run anywhere, where Node.js and WebSockets are available. It is used to translate HTTP(S) Web API calls, which are sent from the Alexa Skill, into WebSocket commands (currently done via Socket.io v1) which are sent to the EV3 robot. The following APIs are exposed:

  • claw/open: Opens the claw.
  • claw/close: Closes the claw.
  • move/forward: Indefinitely moves forward, until a move/stop command is issued.
  • move/backward: Indefinitely moves backward, until a move/stop command is issued.
  • move/stop: Stops the robot.
  • doitdude: Runs a predefined program to grab some beer in front of the robot.

Alexa Skill

The Alexa Skill uses a Lambda Function running Node.js 6.10. The following intents (currently only in German) are available:

  • ClawIntent: Can open and close the claw.
    • Voice Command: Zange {ClawOperation} with the following ClawOperations:
      • schließen: Closes the claw.
      • öffnen: Opens the claw.
  • MoveIntent: Can move the robot.
    • Voice Command: Fahre {MoveOperation} with the following MoveOperations:
      • vorwärts: Moves the robot forwards.
      • rückwärts: Moves the robot backwards.
  • StopIntent: Stops any movement.
    • Voice Command: halt.
  • DoItDudeIntent: Runs the predefined program.
    • Voice Command: hop.

All intents call the appropriate API rather then calling the function on the robot directly. By that architecture, the business logic has been moved to the API bridge, allowing more custom integration scenarios.

EV3 Program

The EV3 program has been written in Python by using the ev3dev operating system. The program opens a WebSocket connection to the API Bridge which is used for communication.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages