def give_zones_handler(robo_id): """ Service for giving cleaning zones to smallvot amd distrivuting IDs to new smallvots :param robo_id: ID of the small rovot requesting a clean Task :return: fields for a clean Task """ latestTask = Task(3) latestTask.workerID = robo_id.workerID start = Pose() start.position.x = 30 # ['isActive', 'isComplete', 'workerID', 'type', 'zone', 'startingPoint'] return [True, False, latestTask.workerID, "clean", 123, start]
def parse_task(self, taskResponse): """ Takes a service response and combines all the fields into a Task :param taskResponse: response received from a service :return: a Task """ zone = Zone(taskResponse.zoneCorners, taskResponse.zoneID) task = Task(zone, taskResponse.type) task.isActive = taskResponse.isActive task.isComplete = taskResponse.isComplete task.workerID = taskResponse.workerID task.start_point = taskResponse.startingPoint return task