han1222 / flask_ask_ros

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flask_ask_ros

A locally hosted web service + ROS node for custom Alexa skills based on Flask-Ask.

Table of Contents

Description

This package combines a Flask server and ROS node into a script that serves as an endpoint for a custom Alexa Skill. This enables information sent by voice to the Amazon Alexa to be processed by other ROS nodes and services.

In this package we provide a simple Alexa skill that parses a single slot (word/argument) from an utterance (spoken function call) and publishes it to a ROS topic.

Requirements

  • Ubuntu 18.04 or 16.04

  • ROS Melodic or Kinetic

  • Flask-ask (Python): follow installation from source here.

Maintainers

Installation

  • Navigate to source directory of your ROS catkin workspace (e.g. catkin_ws):

        cd catkin_ws/src
        git clone https://github.com/3SpheresRoboticsProject/flask_ask_ros
  • Build catkin workspace:

        cd catkin_ws
        catkin_make
  • If necessary, set script file permissions to executable:

        chmod +x catkin_ws/src/flask_ask_ros/src/*
  • Source workspace:

        source catkin_ws/devel/setup.bash

Usage

  • Using ngrok as a tunnel

ngrok tunnel configuration

  1. Set the ROS_IP environment variable to be the local machine IP

  2. Download ngrok for Linux and unzip

  3. Start an ngrok server:

    ./ngrok http $ROS_IP:5000
  4. Open the Amazon Developer Console and navigate to your custom skill:

    • Under Configuration, select HTTPS and paste the URL shown on the ngrok terminal (see below).

      ![alt text][ngrok_url]

    • Under SSL Certificate select My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority.

  5. Run the skill server with the ngrok argument set to true:

    roslaunch flask_ask_ros start_skill_server.launch ngrok:=true

Testing

In order to test the provided skill server, open your Amazon Developer Console, create a custom skill, and follow the steps above to configure your endpoint.

Inside the skill builder, navigate to the JSON Editor and paste the contents of src/test_skill.json. Save and build the model.

Run the skill server to test your skill.

TODO

  • Sample code for ROS services

This app was not created or endorsed by Amazon.

flask_ask_ros

reference https://github.com/3SpheresRoboticsProject/flask_ask_ros

About

License:MIT License


Languages

Language:Python 55.0%Language:CMake 45.0%