DummyTextToSpeech.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package RobotAPI::ArmarXObjects::DummyTextToSpeech
17  * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
18  * @date 2018
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "DummyTextToSpeech.h"
24 
26 
27 namespace armarx
28 {
30  {
31  usingTopic(getProperty<std::string>("TextToSpeechTopicName").getValue());
32  offeringTopic(getProperty<std::string>("TextToSpeechStateTopicName").getValue());
33  }
34 
35 
37  {
38  textToSpeechStateTopicPrx = getTopic<TextToSpeechStateInterfacePrx>(getProperty<std::string>("TextToSpeechStateTopicName").getValue());
39  textToSpeechStateTopicPrx->reportState(eIdle);
40  }
41 
42 
44  {
45 
46  }
47 
48 
50  {
51 
52  }
53 
55  {
58  }
59 
60 
61 
62  void armarx::DummyTextToSpeech::reportText(const std::string& text, const Ice::Current&)
63  {
64  //ARMARX_IMPORTANT << "reportState";
65  textToSpeechStateTopicPrx->reportState(eStartedSpeaking);
66 
67  ARMARX_IMPORTANT << "DummyTTS StartedSpeaking: " << text;
68 
69  //ARMARX_IMPORTANT << "sleep";
70  sleep(1);
71  TimeUtil::SleepMS(text.length() * 10);
72  //ARMARX_IMPORTANT << "reportState";
73  ARMARX_IMPORTANT << "DummyTTS FinishedSpeaking";
74  textToSpeechStateTopicPrx->reportState(eFinishedSpeaking);
75  }
76 
77  void armarx::DummyTextToSpeech::reportTextWithParams(const std::string& text, const Ice::StringSeq& params, const Ice::Current&)
78  {
79  ARMARX_WARNING << "reportTextWithParams is not implemented";
80  }
81 }
armarx::DummyTextToSpeech::onDisconnectComponent
void onDisconnectComponent() override
Definition: DummyTextToSpeech.cpp:43
armarx::DummyTextToSpeech::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: DummyTextToSpeech.cpp:54
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::DummyTextToSpeech::onConnectComponent
void onConnectComponent() override
Definition: DummyTextToSpeech.cpp:36
armarx::DummyTextToSpeech::reportText
void reportText(const std::string &text, const Ice::Current &) override
Definition: DummyTextToSpeech.cpp:62
armarx::DummyTextToSpeech::onExitComponent
void onExitComponent() override
Definition: DummyTextToSpeech.cpp:49
armarx::DummyTextToSpeech::onInitComponent
void onInitComponent() override
Definition: DummyTextToSpeech.cpp:29
DummyTextToSpeech.h
armarx::ManagedIceObject::usingTopic
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Definition: ManagedIceObject.cpp:248
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
armarx::TimeUtil::SleepMS
static void SleepMS(float milliseconds)
Definition: TimeUtil.h:195
TimeUtil.h
armarx::ManagedIceObject::offeringTopic
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
Definition: ManagedIceObject.cpp:290
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::DummyTextToSpeech::reportTextWithParams
void reportTextWithParams(const std::string &text, const Ice::StringSeq &params, const Ice::Current &) override
Definition: DummyTextToSpeech.cpp:77
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
armarx::DummyTextToSpeechPropertyDefinitions
Definition: DummyTextToSpeech.h:36
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28