class PreQualGlobalTask(Task): """ Task to complete prequalifying run by moving to global poses """ POSE1 = [0, 0, 0, 0, 0, 0] POSE2 = [0, 0, 0, 0, 0, 0] POSE3 = [0, 0, 0, 0, 0, 0] POSE4 = [0, 0, 0, 0, 0, 0] POSE5 = [0, 0, 0, 0, 0, 0] def __init__(self): super(PreQualGlobalTask, self).__init__() self.list_task = ListTask([ MoveToPoseGlobalTask(*self.POSE1), MoveToPoseGlobalTask(*self.POSE2), MoveToPoseGlobalTask(*self.POSE3), MoveToPoseGlobalTask(*self.POSE4), MoveToPoseGlobalTask(*self.POSE5) ]) def _on_task_run(self): self.list_task.run() if self.list_task.finished: self.finish()
def __init__(self): super(PreQualLocalTask, self).__init__() self.list_task = ListTask([ MoveToPoseLocalTask(*self.POSE1), MoveToPoseLocalTask(*self.POSE2), MoveToPoseLocalTask(*self.POSE3), MoveToPoseLocalTask(*self.POSE4), MoveToPoseLocalTask(*self.POSE5) ])
def __init__(self, *args, **kwargs): super(PreQualGlobalTask, self).__init__(*args, **kwargs) self.list_task = ListTask([ MoveToPoseGlobalTask(*self.POSE1), MoveToPoseGlobalTask(*self.POSE2), MoveToPoseGlobalTask(*self.POSE3), MoveToPoseGlobalTask(*self.POSE4), MoveToPoseGlobalTask(*self.POSE5) ])
class CompetitionTask(Task): """ High level competition level task, contains a list of tasks for each competition task. """ def __init__(self, *args, **kwargs): super(CompetitionTask, self).__init__(*args, **kwargs) self.list_task = ListTask([MoveToPoseGlobalTask(-7, 0, 0, 0, 0, 0)]) def _on_task_run(self): self.list_task.run() if self.list_task.finished: self.finish()
def __init__(self, *args, **kwargs): super(CompetitionTask, self).__init__(*args, **kwargs) self.list_task = ListTask([MoveToPoseGlobalTask(-7, 0, 0, 0, 0, 0)]) # self.list_task = ListTask([MoveToPoseLocalTask(2, 0, 0, 0, 0, 0)]) # self.list_task = ListTask([HoldPositionTask()]) # self.list_task = ListTask([LogTask("FATAL", "This is falal")]) # self.list_task = ListTask([SimulTask([LogTask("WARN", "Warning"), MoveToPoseGlobalTask(30,0,0,0,0,0)])]) self.prequal_task = PreQualGlobalTask()
def __init__(self, *args, **kwargs): super(CompetitionTask, self).__init__(*args, **kwargs) self.list_task = ListTask([MoveToPoseGlobalTask(-7, 0, 0, 0, 0, 0)])