icub-client
subSystem_recog.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2014 WYSIWYD Consortium, European Commission FP7 Project ICT-612139
3 * Authors: Gregoire Pointeau, Maxime Petit
4 * email: gregoire.pointeau@inserm.fr, m.petit@imperial.ac.uk
5 * website: http://wysiwyd.upf.edu/
6 * Permission is granted to copy, distribute, and/or modify this program
7 * under the terms of the GNU General Public License, version 2 or any
8 * later version published by the Free Software Foundation.
9 *
10 * A copy of the license can be found at
11 * icub-client/license/gpl.txt
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16 * Public License for more details
17 */
18 
19 #ifndef __ICUBCLIENT_SUBSYSTEM_RECOG_H__
20 #define __ICUBCLIENT_SUBSYSTEM_RECOG_H__
21 
22 #define SUBSYSTEM_RECOG "recog"
23 
25 
26 #include <iostream>
27 
28 namespace icubclient{
34 class SubSystem_Recog : public SubSystem
35 {
36 protected:
37  virtual bool connect();
38  yarp::os::RpcClient ears_port;
40 public:
45  SubSystem_Recog(const std::string &masterName);
46 
47  virtual void Close();
48 
53  void enableEars(bool on);
54 
58  void waitForEars();
59 
60 
67 
72  yarp::os::Bottle recogFromGrammar(std::string &sInput);
73 
83  yarp::os::Bottle recogFromGrammarLoop(std::string sInput, int iLoop = 50, bool keepEarsEnabled = false, bool keepEarsDisabledAfterRecog = false);
84 
85 };
86 }//Namespace
87 #endif
88 
yarp::os::Bottle recogFromGrammarLoop(std::string sInput, int iLoop=50, bool keepEarsEnabled=false, bool keepEarsDisabledAfterRecog=false)
From one grxml grammar, return the first non-empty sentence recognized can last for several timeout (...
bool interruptSpeechRecognizer()
Interrupt the speech recognizer.
Abstract class to handle sub-systems of the icub-client.
Definition: subSystem.h:43
yarp::os::RpcClient ears_port
Port to /ears/rpc.
Abstract subSystem for speech recognizer.
SubSystem_Recog(const std::string &masterName)
Default constructor.
yarp::os::Bottle recogFromGrammar(std::string &sInput)
From one grxml grammar, return the sentence recognized for one timeout This is not supported...
virtual void Close()
Clean up resources.
void enableEars(bool on)
Send a command to ears whether it should listen to the speechRecognizer.
void waitForEars()
Send a command to ears that it should stop listening to the speechRecognizer, and wait until it hands...