def volume_setting(self, data):
rospy.loginfo('intonation range is 0 ~ 9')
if data in self.level:
rospy.set_param('~VOL', data)
else:
rospy.loginfo('currently not support this intonation level')
python类set_param()的实例源码
def format_setting(self, data):
rospy.set_param('~FORMAT', data)
def response_sensitivity(self, data):
rospy.set_param('~ResponseSensitivity', data)
def workspace_setting(self, data):
rospy.set_param('~WorkSpaces', data)
#engine setting
def CTP_setting(self, data):
if data == 1:
rospy.set_param('~CTP', data)
else:
rospy.loginfo('currently not support this customer terminal type')
def Api_Key_setting(self, data):
rospy.set_param('~Api_Key', data)
def Secrect_Key_setting(self, data):
rospy.set_param('~Secrect_Key', data)
def Grant_type_setting(self, data):
rospy.set_param('~Grant_type', data)
def Token_url_setting(self, data):
rospy.set_param('~Token_url', data)
def Speeker_url_setting(self, data):
rospy.set_param('~Speeker_url', data)
def sample_rate_setting(self, data):
rospy.loginfo('please input sampling rate')
if data in self.sample_rate_range:
rospy.set_param('~REG_SAMPLING_RATE', data)
else:
rospy.loginfo('data out of range')
def upper_level_setting(self, data):
rospy.loginfo('please input upper level of sampling')
rospy.set_param('~REG_UPPER_LEVEL', data)
def lower_level_setting(self, data):
rospy.loginfo('please input lower level of sampling')
rospy.set_param('~REG_LOWER_LEVEL', data)
def count_number_setting(self, data):
rospy.loginfo('please input how much number of data higher than lower level counted before recording')
rospy.set_param('~REG_COUNT_NUM:', data)
def save_length_setting(self, data):
rospy.loginfo('please input recording uni length of voice data')
rospy.set_param('~REG_SAVE_LENGTH:', data)
def no_words_setting(self, data):
rospy.loginfo('please input the period of stop recording if there is no words coming')
rospy.set_param('~REG_NO_WORDS', data)
def Api_Key_setting(self, data):
rospy.loginfo('please input a Baidu API KEY')
rospy.set_param('~REG_Api_Key', data)
def Secrect_Key_setting(self, data):
rospy.loginfo('please input a Baidu Secrect Key')
rospy.set_param('~REG_secrect_Key', data)
def Grant_type_setting(self, data):
rospy.loginfo('please input Baidu Grant type')
rospy.set_param('~REG_Grant_type')
def Token_url_setting(self, data):
rospy.loginfo('please input Baidu Token url')
rospy.set_param('~REG_Token_url', data)