Skip to content

Shillin123/speech_module_client

 
 

Repository files navigation

#Research Project on Implementation of Speech Module on Ohmni Telepresence Robot

This documents serves as a complete description to setup and start a speech module on ohmni robot

Maintainer: Sharath Nataraj Email id: [email protected]

Filetree

src

Robot Setup

  • pull this repo into robot by using linux shell follow instructions from : https://docs.ohmnilabs.com/

  • cd speech_module

  • pip install -r src/requirements.txt

A google mail id has been created to manage multiple services for the robot

email id: [email protected]

password: Ohmni@123@iaas

This module allows you to choose between two wake word recognition models 1 and 2

1.Procupine Wake word Recognition Setup

launcing the Porcupine wake word

  • working with pre-trained models: rosrun porcupine_wake_word kai_wake_word.py --access_key 7segjTjkamk6oOQb/SLE8OBex4vHMdGxW+Z2cxX1EthTIJ13wNPnqg== --keyword_path path_to_extracted file/Hello-Kai_en_linux_v2_1_0.ppn
  • Custom trained model: rosrun porcupine_wake_word kai_wake_word.py --access_key access_key_generated_from the previous steps --keyword_path path_to_extracted file/Hello-Kai_en_linux_v2_1_0.ppn

2.Efficient Net Wake Word Recognition Setup

  • some extra requirements, pip install librosa && pip install ffmpeg
  • This repo also contains a pre-trained efficent-net model sample_refs/,
  • remember to change the directorty path of the pre-trained model in line 12 of effnet_word.py
  • it is also possible to train a new wake word using the instructions https://github.com/Ant-Brain/EfficientWord-Net#generating-custom-wakewords
  • simply replace json modle inside the sample_refs directory and change the directory path of newly trained model at line 12 of effnet_word.py
  • remember to run the wake word node before starting other nodes.
  • node can be started by rosrun efficient_wakeword effnet_word.py
  • rostopic pub -1 /eff_wake_word_status std_msgs/String "data: 'on'"

Next is the speech recognition models

by default this branch contains only vosk as STT model, switch to devel branch to find more models

Vosk Speech Recognition Engine

  • Vosk STT is pre-compiled with models and can be started easily with a simle command
  • rosrun vosk_ros vosk_node.py

Choosing Different NLU models

  • This repository provides two differet NLU models which can be choosen by choosing different launch files in launch/

1.Dialogflow Launch

2.RASA Launch

  • navigate to cogrob_chatbot/ and start the rasa server
  • rasa run -m models --endpoints endpoints.yml --port 5002 --credentials credentials.yml --enable-api
  • roslaunch vosk_ros start_rasa_service.lauch
  • this node is currently under development this can be used to get replies on the frontend but some features like apointment scheduling system and controlling IOT systems may not work, refer rasa docs to change intents and rules inside cogrob_chatbot/

Quick start

Robot Setup

  • contact [email protected] for dialogflow service key.
  • clone this repository onto the robo
  • add the service key to evironment using export GOOGLE_APPLICATION_CREDENTIALS='/path_to_doownloaded_file/service_key.json'
  • catkin_make
  • rosrun rosrun porcupine_wake_word kai_wake_word.py --access_key 7segjTjkamk6oOQb/SLE8OBex4vHMdGxW+Z2cxX1EthTIJ13wNPnqg== --keyword_path path_to_porcupine_model/Hello-Kai_en_linux_v2_1_0.ppn &
  • roslaunch vosk_ros start_dialogflow_service.launch
  • this starts all the required nodes for the operation

Local Setup

Configuring Dialogflow service

  • this configuration can be made from a host computer and not on ohmni robot
  • login to google dialogflow with the given credentials at the start of the readme file
  • install ngrok: https://ngrok.com/download
  • start ngrok service ngrok http 8000 this connects dialogflow with webhook.py application
  • copy the url generated and paste it in fullfilment section of dialogflow console with a route /webhook, the url looks like : www.example_url.com/webhook
  • save the changes
  • the console can be used to add changes to intents

Conecting to Home Assistant

  • Use the SD card provided with the deliverables, and insert it to Raspberry pi 4 with atleast 2GB of RAM, the SD card is configured to automatically connect to Service lab's WiFi. and boot Home Assistant.
  • Check the IP adddress of Raspberry pi and make a note of it
  • add the IP address of Raspberry pi in line 20 of webbhook.py and line 17 of mailer.py, mailer.py provides an example schema of how the employee database can be structured, more customization and development can be made to suite the needs.
  • start both the applications python3 webook.py and python3 mailer.py
  • setup of mailer.py is rather simple nacvigate to app passwords in google account setup and create a password with other application. copy and paste the password at line 15 of mailer.py
  • This ensures mails can be sent through this python script.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.8%
  • JavaScript 0.3%
  • Shell 0.2%
  • Scheme 0.2%
  • Makefile 0.2%
  • Python 0.1%
  • Other 0.2%