MiRo-Training
The aim of the project is to develop a software architecture for interacting with Miro using vocal and gestural commands.
 All Classes Files Functions Variables
Public Member Functions | Public Attributes | List of all members
command_recognition.CommandRecognition Class Reference

The class CommandRecognition handles the different incoming commands and publish on the robot the corresponding action. More...

Public Member Functions

def __init__
 Constructor.
 
def callback_receive_command
 Callback function that receive and save the user's voice command as text.
 
def callback_sleep_action
 Callback that receives the action to be executed when the vocal command is "Sleep".
 
def callback_sad_action
 Callback that receives the action to be executed when the vocal command is "Bad".
 
def callback_play_action
 Callback that receives the action to be executed when the vocal command is "Play".
 
def callback_gbb
 Callback that receives the action to be executed when the vocal command is "Let's go".
 
def callback_good_action
 Callback that receives the action to be executed when the vocal command is "Good".
 
def callback_kill_action
 Callback that receives the action to be executed when the vocal command is "Kill".
 
def switching_commands
 Function that check the incoming commands and publish the corresponding action
The command "Miro" brings the robot in a default configuration the first time is used. More...
 

Public Attributes

 rate
 Node rate.
 
 robot_name
 Allow to switch from real robot to simulation from launch file.
 
 activate
 Initialization of the enabling command.
 
 command
 Initialization of the string to evaluate.
 
 q_sleep
 Platform control Object that represents the sleep action ("Sleep")
 
 q_sad
 Platform control Object that represents the miro action when it is scolded ("Bad")
 
 q_play
 Platform control Object that represents the miro action when it follows the Ball ("Play")
 
 q_gbb
 platform_control object that rapresents the Gesture Based Behavior ("Let's go out")
 
 q_good
 Platform control Object that represents the miro action when it is praised ("Good")
 
 q_kill
 Platform control Object that represents the miro action when it is praised ("Kill")
 
 sub_speech_to_text
 Subscriber to the topic /speech_to_text a message of type String that cointains the vocal command converted in text.
 
 sub_sleep_action
 Subscriber to the topic /miro_sleep a message of type platform_control that rapresents the action corresponting to the command "Sleep".
 
 sub_sad_action
 Subscriber to the topic /miro_sad a message of type platform_control that rapresents the action corresponting to the command "Bad".
 
 sub_play_action
 Subscriber to the topic /miro_follow a message of type platform_control that rapresents the action corresponting to the command "Play".
 
 sub_gbb
 Subscriber to the topic /miro_dance a message of type platform_control that rapresents the action corresponting to the command "Let's go out".
 
 sub_good_action
 Subscriber to the topic /miro_good a message of type platform_control that rapresents the action corresponting to the command "Good".
 
 sub_kill_action
 Subscriber to the topic /miro_good a message of type platform_control that rapresents the action corresponting to the command "Kill".
 
 pub_platform_control
 Publisher to the topic /platform/control a message of type platform_control which execute Miro actions.
 

Detailed Description

The class CommandRecognition handles the different incoming commands and publish on the robot the corresponding action.

Definition at line 31 of file command_recognition.py.

Member Function Documentation

def command_recognition.CommandRecognition.switching_commands (   self)

Function that check the incoming commands and publish the corresponding action
The command "Miro" brings the robot in a default configuration the first time is used.

The variable activate is set to True and enables the evauation of the other commands.
The command "Bad" is executed only if self.active is True and publish the action managed by the node bad.py
The command "Good" is executed only if self.active is True and publish the action managed by the node good.py
The command "Play" is executed only if self.active is True and publish the action managed by the node play.py
The command "Let's go out" is executed only if self.active is True and publish the action managed by the node gbb_miro.py
The command "Sleep" is executed only if self.active is True and publish the action managed by the node sleep.py.
The variable activate is set to False and Miro remains in sleep mode until a new command "Miro" is received.

Definition at line 132 of file command_recognition.py.


The documentation for this class was generated from the following file: