5 from random
import random
10 if len(task.action) > 0:
11 if len(task.start_node_id) > 0:
12 return '%s @ %s (task %s)' % (task.action, task.start_node_id, task.task_id)
14 return '%s (task %s)' % (task.action, task.task_id)
16 return 'just navigation to %s (task %s)' % (task.start_node_id, task.task_id)
19 return datetime.fromtimestamp(task.execution_time.secs)
22 rospy.loginfo(
"\n\n\n\n\n\n");
24 if data.currently_executing:
25 rospy.loginfo(
"Currently executing %s",
pretty(data.execution_queue[0]))
26 rospy.loginfo(
"Task started at %s",
start_time(data.execution_queue[0]))
27 elif len(data.execution_queue) > 0:
28 rospy.loginfo(
"Waiting to execute %s",
pretty(data.execution_queue[0]))
29 rospy.loginfo(
"Execution to start at %s",
start_time(data.execution_queue[0]))
31 if len(data.execution_queue) > 0:
32 rospy.loginfo(
"A further %s tasks queued for execution", len(data.execution_queue) - 1)
35 if __name__ ==
'__main__':
36 rospy.init_node(
'schedule_status_printer')
37 rospy.Subscriber(
'/current_schedule', ExecutionStatus, callback)