task_event_printer.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import rospy
4 from task_executor import task_routine, task_query
5 from strands_executive_msgs.msg import *
6 from random import random
7 from dateutil.tz import *
8 from datetime import *
9 
10 def on_event(task_event):
11  rostime_now = rospy.get_rostime()
12  now = datetime.fromtimestamp(rostime_now.to_sec(), tzlocal())
13  rospy.loginfo('task %s\t%s\t%s\t%s\t%s' %
14  (task_event.task.task_id, task_event.task.action, task_event.task.start_node_id, task_query.task_event_string(task_event.event), now.strftime('%d/%m/%y %H:%M:%S')))
15 
16 
17 if __name__ == '__main__':
18  rospy.init_node('task_event_printer')
19  rospy.Subscriber('/task_executor/events', TaskEvent, on_event)
20  rospy.spin()
def on_event(task_event)


task_executor
Author(s): Nick Hawes
autogenerated on Tue Mar 17 2015 20:08:13