4 from Queue
import Queue, Empty
13 rospy.init_node(
"task_executor" )
15 super( FIFOTaskExecutor, self ).
__init__()
21 """ Called with a new task for the executor """
22 rospy.loginfo(
'Called with %s tasks' % len(tasks))
25 rospy.loginfo(
'Queued %s tasks' % len(tasks))
28 """ Called when a task is demanded. self.active_task is the demanded task (and is being executed) and previously_active_task was the task that was being executed (which could be None) """
29 if previously_active_task:
35 while not rospy.is_shutdown():
41 task = self.tasks.get(
False)
51 if __name__ ==
'__main__':
53 executor.run_executor()
def task_demanded(self, previously_active_task)
def add_tasks(self, tasks)
def advertise_services(self)
def execute_task(self, task)