def __init__(self, name='PlayStop'): super(PlayStop, self).__init__(name) self.applicable = "STOP" self.done_aborted = "STOP" 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)) 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))
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(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(PlayOurPreKickoff, self).__init__('PlayOurPreKickoff') self.applicable = "OUR_PRE_KICKOFF" self.done_aborted = "OUR_PRE_KICKOFF" self.roles[1].clear_behavior() self.roles[1].behavior.add_child( TacticInterpose('TacticInterpose', self.roles[1].my_role, from_dist=0.2))
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))