7 from speech_recognition_msgs.msg
import Vocabulary
8 from speech_recognition_msgs.msg
import Grammar
13 pub = rospy.Publisher(
"/vocabulary", Vocabulary, queue_size=1)
15 if rospy.is_shutdown()
or pub.get_num_connections() > 0:
18 rospy.loginfo(
"Waiting /vocabulary is advertised")
19 if pub.get_num_connections() == 0:
20 rospy.logerr(
"/vocabulary is not advertised")
22 voca = Vocabulary(words=words)
29 root_dir, name = os.path.dirname(path), os.path.basename(path)
30 pub = rospy.Publisher(
"/grammar", Grammar, queue_size=1)
32 if rospy.is_shutdown()
or pub.get_num_connections() > 0:
35 rospy.loginfo(
"Waiting /grammar is advertised")
36 if pub.get_num_connections() == 0:
37 rospy.logerr(
"/grammar is not advertised")
def load_grammar(path, name)
def register_isolated(name, words)
def register_grammar(name, path)