00001 #include "talker.h" 00002 00003 #include <std_msgs/String.h> 00004 00005 Talker::Talker(ros::NodeHandle nodeHandle, const char* topic) 00006 { 00007 m_Publisher = new ros::Publisher(nodeHandle.advertise<std_msgs::String>("robot_face/text_out", 1000)); 00008 } 00009 00010 void Talker::sendMessage(QString text) 00011 { 00012 std_msgs::String msg; 00013 00014 std::stringstream ss; 00015 ss << text.toStdString(); 00016 msg.data = ss.str(); 00017 00018 ROS_INFO("%s", msg.data.c_str()); 00019 00020 m_Publisher->publish(msg); 00021 }