def __init__(self): super(PlayOurPrePenalty, self).__init__('PlayOurPrePenalty') self.applicable = "OUR_PRE_PENALTY" self.done_aborted = "OUR_PRE_PENALTY" keep_x = -constants.FieldHalfX + constants.RobotRadius * 2.0 self.roles[0].loop_enable = True self.roles[0].behavior.add_child( TacticGoalie('TacticGoalie', self.roles[0].my_role, keep_x=keep_x, range_high = constants.GoalHalfSize, range_low = -constants.GoalHalfSize) ) self.roles[1].loop_enable = True self.roles[1].behavior.add_child( TacticInterpose('TacticInterpose', self.roles[1].my_role, from_dist = 0.2) ) for i in range(2,6): x = -3.0 + 0.3*i y = 2.0 theta = -math.pi * 0.5 self.roles[i].loop_enable = True self.roles[i].behavior.add_child( TacticPosition('TacticPosition', self.roles[i].my_role, x, y ,theta))
def __init__(self): super(PlayTheirPenaltyStart, self).__init__('PlayTheirPenaltyStart') self.applicable = "THEIR_PENALTY_START" self.done_aborted = "THEIR_PENALTY_START" pose_x = -constants.FieldHalfX + 0.05 pose_y = constants.GoalHalfSize - constants.RobotRadius pose1 = Pose(pose_x, pose_y, 0) pose2 = Pose(pose_x, -pose_y, 0) self.roles[0].loop_enable = True self.roles[0].behavior.add_child( TacticLookIntersection('TacticLookIntersection', self.roles[0].my_role, target='Threat_0', pose1 = pose1, pose2= pose2) ) for i in range(1,6): x = -3.0 + 0.3*i y = 2.0 theta = -math.pi * 0.5 self.roles[i].loop_enable = True self.roles[i].behavior.add_child( TacticPosition('TacticPosition', self.roles[i].my_role, x, y ,theta))
def __init__(self): super(PlayTheirPreKickoff, self).__init__('PlayTheirPreKickoff') self.applicable = "THEIR_PRE_KICKOFF" self.done_aborted = "THEIR_PRE_KICKOFF" keep_x = -constants.FieldHalfX + constants.RobotRadius * 2.0 self.roles[0].loop_enable = True self.roles[0].behavior.add_child( TacticGoalie('TacticGoalie', self.roles[0].my_role, keep_x=keep_x, range_high=constants.GoalHalfSize, range_low=-constants.GoalHalfSize)) self.roles[1].loop_enable = True self.roles[1].behavior.add_child( TacticInterpose('TacticInterpose', self.roles[1].my_role, from_dist=0.5)) for i in range(2, 6): x = -3.0 y = 0.45 - 0.3 * (i - 2) theta = 0 self.roles[i].loop_enable = True self.roles[i].behavior.add_child( TacticPosition('TacticPosition', self.roles[i].my_role, x, y, theta))
def __init__(self): super(Test1, self).__init__('Test1') self.applicable = "TEST1" self.done_aborted = "TEST1" self.assignment_type = "CLOSEST_BALL" self.roles[0].loop_enable = True self.roles[0].behavior.add_child( TacticHalt('TacticHalt', self.roles[0].my_role)) self.roles[1].loop_enable = True self.roles[1].behavior.add_child( TacticPosition('TacticPosition1', self.roles[1].my_role, 0.0, 2.0, math.pi * 0.5)) self.roles[1].behavior.add_child( TacticPosition('TacticPosition2', self.roles[1].my_role, 0.0, -2.0, math.pi * 0.5)) for i in range(2, 6): self.roles[i].loop_enable = True self.roles[i].behavior.add_child( TacticHalt("TacticHalt", self.roles[i].my_role))
def __init__(self): super(PlayInPlayOurDefence, self).__init__('PlayInPlayOurDefence') self.applicable = "BALL_IN_OUR_DEFENCE" self.done_aborted = "BALL_IN_OUR_DEFENCE" self.roles[0].loop_enable = True self.roles[0].behavior.add_child( TacticClear('TacticClear', self.roles[0].my_role)) self.roles[1].loop_enable = True self.roles[1].behavior.add_child( TacticPosition('TacticPosition', self.roles[1].my_role, 0, 0, 0)) self.roles[2].loop_enable = True self.roles[2].behavior.add_child( TacticInterpose('TacticInterpose', self.roles[2].my_role, to_dist=1.5)) range_y = constants.FieldHalfY - 0.7 self.roles[3].loop_enable = True self.roles[3].behavior.add_child( TacticKeep('TacticKeep', self.roles[3].my_role, keep_x=-2.0, range_high=range_y, range_low=0.5)) self.roles[4].loop_enable = True self.roles[4].behavior.add_child( TacticKeep('TacticKeep', self.roles[4].my_role, keep_x=-2.0, range_high=-0.5, range_low=-range_y)) pose1 = Pose(-2.5, range_y, 0) pose2 = Pose(-2.5, -range_y, 0) self.roles[5].loop_enable = True self.roles[5].behavior.add_child( TacticIntersection('TacticIntersection', self.roles[5].my_role, pose1=pose1, pose2=pose2))