Skip to content

Juancams/dialogflow_ros2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dialogflow ROS 2

This package uses the Google Text-To-Speech (TTS) API to send results to Dialogflow, Google's NLP platform.

Further information can be found at the ROS wiki. Reproduced here:

Installation

There is an install.sh script available in git directory if you wish to use it, however, I will go over the steps one-by-one here.

Installing this package requires 3 main steps: cloning the dialogflow repo, setting up your Google cloud project, and setting up Dialogflow. However, we need to install PortAudio so we can use PyAudio to get mic data.

sudo apt-get install portaudio19-dev

Cloning The Repo

Install all the requirements using pip by cloning the Github repo and installing all the packages in requirements.txt.

cd <workspace>/src
git https://github.com/Juancams/dialogflow_ros2.git
cd dialogflow_ros2
pip install -r requirements.txt

Google Cloud and DialogFlow Setup

Follow the instructions here for configuring your Google Cloud project and installing the SDK for authentication. You will need a google/gmail account.

Usage of the Google Cloud SDK requires authentication. This means you require an API key and an activated service account to utilize the APIs.

  1. Go to Google Cloud Console.
  2. Create a new project.
  3. Go to the Kick Setup.
  4. Enable API.
  5. Create Service Account.
  6. Create key & download the JSON File. Rename and move it t your HOME as ~/df_api.json.
  7. Go to DialogFlow Console.
  8. Create new Agent & select the project.
  9. Edit dialogflow_ros2/config/param.yaml and write down your project id. You can find it in the DialogFlow Console, clicking in the gear icon.
  10. Add export GOOGLE_APPLICATION_CREDENTIALS='/home/<user>/df_api.json' to your .bashrc and change user.

Usage

Follow the steps below to setup the package properly.

Configuration

Go into the config directory and change the following parameters in the params.yaml file:

  • results_topic: (Optional) The topic where your results will be published.
  • project_id: The name of your project for the Google Speech node. This is the name of your Google Cloud project when going through the Google Cloud setup.

Launching nodes

To start the Dialogflow nodes, run the following command:

ros2 launch dialogflow_ros2 dialogflow.launch

ROS Nodes

mic_client

ROS node receives text from the Google Cloud Speech API and publishes it onto text_topic (see config/params.yaml). This is used by the dialogflow_client node.

Published Topics

text_topic (std_msgs/String) Acquired text from the Google Cloud Speech API.

dialogflow_client

ROS node that takes text from the mic_client node and sends it to Dialogflow for parsing.

Published Topics

results_topic (dialogflow_msgs/DialogflowResult) Publishes a message with the actions, parameters (python dictionary), and fulfillment text associated with the detected intent as a std_msgs/String.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published