43 rospy.init_node(
'param_talker')
53 global_example = rospy.get_param(
"/global_example")
54 rospy.loginfo(
"%s is %s", rospy.resolve_name(
'/global_example'), global_example)
57 utterance = rospy.get_param(
'utterance')
58 rospy.loginfo(
"%s is %s", rospy.resolve_name(
'utterance'), utterance)
61 topic_name = rospy.get_param(
'~topic_name')
62 rospy.loginfo(
"%s is %s", rospy.resolve_name(
'~topic_name'), topic_name)
65 default_param = rospy.get_param(
'default_param',
'default_value')
66 rospy.loginfo(
'%s is %s', rospy.resolve_name(
'default_param'), default_param)
69 gains = rospy.get_param(
'gains')
70 p, i, d = gains[
'P'], gains[
'I'], gains[
'D']
71 rospy.loginfo(
"gains are %s, %s, %s", p, i, d)
74 rospy.loginfo(
'setting parameters...')
75 rospy.set_param(
'list_of_floats', [1., 2., 3., 4.])
76 rospy.set_param(
'bool_True',
True)
77 rospy.set_param(
'~private_bar', 1+2)
78 rospy.set_param(
'to_delete',
'baz')
79 rospy.loginfo(
'...parameters have been set')
82 if rospy.has_param(
'to_delete'):
83 rospy.delete_param(
'to_delete')
84 rospy.loginfo(
"deleted %s parameter"%rospy.resolve_name(
'to_delete'))
86 rospy.loginfo(
'parameter %s was already deleted'%rospy.resolve_name(
'to_delete'))
89 param_name = rospy.search_param(
'global_example')
90 rospy.loginfo(
'found global_example parameter under key: %s'%param_name)
93 pub = rospy.Publisher(topic_name, String, queue_size=10)
94 while not rospy.is_shutdown():
95 pub.publish(utterance)
96 rospy.loginfo(utterance)
99 if __name__ ==
'__main__':
102 except rospy.ROSInterruptException:
pass