def give_avoid_status(self, robot_request): task = Task() if self.robotManager.should_robot_avoid(robot_request.workerID): if DEBUG: print("sending avoid task to robot with ID:") print(robot_request.workerID) task.make_avoid_task(Pose(), robot_request.workerID) return task.to_service_format() else: if DEBUG: print("sending safe task to robot with ID:") print(robot_request.workerID) task.make_safe_task(robot_request.workerID) return task.to_service_format()
def give_cleaning_task(self, robot_request): if len(self.cleaningManager.cleaningTasks) > 0: print("giving cleaning task") task = self.cleaningManager.cleaningTasks.pop() self.cleaningManager.completed_tasks.append(task) print("task is " + str(task.zone.id)) print("tasks remaining: " + str(len(self.cleaningManager.cleaningTasks))) task.workerID = robot_request.workerID return task.to_service_format() else: print("no cleaning Task") task = Task() task.make_safe_task(robot_request.workerID) return task.to_service_format()