speech.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Aldebaran
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 /*
19  * LOCAL includes
20  */
21 #include "speech.hpp"
22 
23 
24 namespace naoqi
25 {
26 namespace subscriber
27 {
28 
29 SpeechSubscriber::SpeechSubscriber( const std::string& name, const std::string& speech_topic, const qi::SessionPtr& session ):
30  speech_topic_(speech_topic),
31  BaseSubscriber( name, speech_topic, session ),
32  p_tts_( session->service("ALTextToSpeech") )
33 {}
34 
36 {
38 
39  is_initialized_ = true;
40 }
41 
42 void SpeechSubscriber::speech_callback( const std_msgs::StringConstPtr& string_msg )
43 {
44  p_tts_.async<void>("say", string_msg->data);
45 }
46 
47 } //publisher
48 } // naoqi
void reset(ros::NodeHandle &nh)
Definition: speech.cpp:35
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
SpeechSubscriber(const std::string &name, const std::string &speech_topic, const qi::SessionPtr &session)
Definition: speech.cpp:29
void speech_callback(const std_msgs::StringConstPtr &speech_msg)
Definition: speech.cpp:42


naoqi_driver
Author(s): Karsten Knese
autogenerated on Sat Feb 15 2020 03:24:26