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 {
29  void
31  {
32  usingTopic(getProperty<std::string>("TextToSpeechTopicName").getValue());
33  offeringTopic(getProperty<std::string>("TextToSpeechStateTopicName").getValue());
34  }
35 
36  void
38  {
39  textToSpeechStateTopicPrx = getTopic<TextToSpeechStateInterfacePrx>(
40  getProperty<std::string>("TextToSpeechStateTopicName").getValue());
41  textToSpeechStateTopicPrx->reportState(eIdle);
42  }
43 
44  void
46  {
47  }
48 
49  void
51  {
52  }
53 
56  {
59  }
60 
61  void
62  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
79  const Ice::StringSeq& params,
80  const Ice::Current&)
81  {
82  ARMARX_WARNING << "reportTextWithParams is not implemented";
83  }
84 } // namespace armarx
armarx::DummyTextToSpeech::onDisconnectComponent
void onDisconnectComponent() override
Definition: DummyTextToSpeech.cpp:45
armarx::DummyTextToSpeech::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: DummyTextToSpeech.cpp:55
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:190
armarx::DummyTextToSpeech::onConnectComponent
void onConnectComponent() override
Definition: DummyTextToSpeech.cpp:37
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:50
armarx::DummyTextToSpeech::onInitComponent
void onInitComponent() override
Definition: DummyTextToSpeech.cpp:30
DummyTextToSpeech.h
armarx::ManagedIceObject::usingTopic
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Definition: ManagedIceObject.cpp:254
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
armarx::TimeUtil::SleepMS
static void SleepMS(float milliseconds)
Definition: TimeUtil.h:203
TimeUtil.h
armarx::ManagedIceObject::offeringTopic
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
Definition: ManagedIceObject.cpp:300
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::DummyTextToSpeech::reportTextWithParams
void reportTextWithParams(const std::string &text, const Ice::StringSeq &params, const Ice::Current &) override
Definition: DummyTextToSpeech.cpp:78
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:193
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:35
armarx::DummyTextToSpeechPropertyDefinitions
Definition: DummyTextToSpeech.h:36
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27