Attachment 'my_stats.py'
Download 1 #!/usr/bin/python
2
3 import random
4 import rospy
5 from pal_statistics import StatisticsRegistry
6
7
8 def get_my_var():
9 return random.random()
10
11
12 def publish_callback(event):
13 registry.publish()
14
15
16 rospy.init_node("my_stats_node")
17
18 registry = StatisticsRegistry("/my_statistics_topic")
19
20 registry.registerFunction("my_var", get_my_var)
21
22 rospy.Timer(rospy.Duration(0.01), publish_callback)
23
24 rospy.spin()
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.