Go to the documentation of this file.00001
00002
00003
00004
00005 import rospy
00006 from jsk_gui_msgs.msg import VoiceMessage
00007 from speech_recognition_msgs.msg import SpeechRecognitionCandidates
00008
00009
00010 class Android2SpeechRecognitionBridgeNode(object):
00011 def __init__(self):
00012 self.pub = rospy.Publisher("voice", SpeechRecognitionCandidates)
00013 self.sub = rospy.Subscriber("/Tablet/voice", VoiceMessage, self.androidCallback)
00014
00015 def androidCallback(self, msg):
00016 self.pub.publish(SpeechRecognitionCandidates(transcript=msg.texts))
00017
00018
00019 if __name__ == '__main__':
00020 rospy.init_node("android2speech_recognition")
00021 r = Android2SpeechRecognitionBridgeNode()
00022 rospy.spin()