5 from dynamic_reconfigure.client
import Client
7 from speech_recognition_msgs.srv
import SpeechRecognition
8 from ros_speech_recognition.cfg
import SpeechRecognitionConfig
as Config
13 srv_name=
"/speech_recognition",
14 node_name=
"/speech_recognition",
16 self.
_sr_srv = rospy.ServiceProxy(srv_name, SpeechRecognition)
17 self._sr_srv.wait_for_service(timeout=timeout)
18 self.
_cfg = Client(node_name, timeout=timeout)
22 return self._cfg.config[
"language"]
26 self._cfg.update_configuration({
'language': value})
30 return self._cfg.config[
"engine"]
34 self._cfg.update_configuration({
'engine': value})
38 return self._cfg.config[
"energy_threshold"]
40 @energy_threshold.setter
43 rospy.logerr(
"Dynamic energy thresholding is enabled")
45 self._cfg.update_configuration({
46 "energy_threshold": value
51 return self._cfg.config[
"dynamic_energy_threshold"]
53 @dynamic_energy_threshold.setter
55 self._cfg.update_configuration({
56 "dynamic_energy_threshold": value
60 return self.
_sr_srv(**args).result
def energy_threshold(self)
def dynamic_energy_threshold(self)
def recognize(self, args)
def __init__(self, srv_name="/speech_recognition", node_name="/speech_recognition", timeout=10)