diff --git a/entities/coach/larc2021.py b/entities/coach/larc2021.py index c547e52f..eaffaa0f 100644 --- a/entities/coach/larc2021.py +++ b/entities/coach/larc2021.py @@ -16,20 +16,30 @@ def __init__(self, match): penalty_play = plays.larc2021.PenaltyPlay(self) goalkick_play = plays.larc2021.GoalKickPlay(self) + defend_penalty_play = plays.larc2021.DefendPenaltyPlay(self) + penalty_trigger = plays.OnPenaltyKick(self.match.game.referee, self.match.team_color) - seven_seconds_trigger = plays.WaitForTrigger(7) + penalty_seconds_trigger = plays.WaitForTrigger(12) + goalkick_seconds_trigger = plays.WaitForTrigger(9) + defendpenalty_seconds_trigger = plays.WaitForTrigger(9) goalkick_trigger = plays.OnGoalKick(self.match.game.referee, self.match.team_color) + + defend_penalty_trigger = plays.OnPenaltyKick(self.match.game.referee, self.match.opposite_team_color) self.playbook.add_play(main_play) self.playbook.add_play(penalty_play) self.playbook.add_play(goalkick_play) + self.playbook.add_play(defend_penalty_play) main_play.add_transition(penalty_trigger, penalty_play) - penalty_play.add_transition(seven_seconds_trigger, main_play) + penalty_play.add_transition(penalty_seconds_trigger, main_play) main_play.add_transition(goalkick_trigger, goalkick_play) - goalkick_play.add_transition(seven_seconds_trigger, main_play) + goalkick_play.add_transition(goalkick_seconds_trigger, main_play) + + main_play.add_transition(defend_penalty_trigger, defend_penalty_play) + defend_penalty_play.add_transition(defendpenalty_seconds_trigger, main_play) self.playbook.set_play(main_play) diff --git a/entities/plays/larc2021/__init__.py b/entities/plays/larc2021/__init__.py index e9c6a99c..065fa854 100644 --- a/entities/plays/larc2021/__init__.py +++ b/entities/plays/larc2021/__init__.py @@ -1,3 +1,5 @@ from entities.plays.larc2021.mainPlay import MainPlay from entities.plays.larc2021.penaltyPlay import PenaltyPlay -from entities.plays.larc2021.goalKickPlay import GoalKickPlay \ No newline at end of file +from entities.plays.larc2021.goalKickPlay import GoalKickPlay + +from entities.plays.larc2021.defendPenaltyPlay import DefendPenaltyPlay \ No newline at end of file diff --git a/entities/plays/larc2021/goalKickPlay.py b/entities/plays/larc2021/goalKickPlay.py index 4a09866d..ddf14ea0 100644 --- a/entities/plays/larc2021/goalKickPlay.py +++ b/entities/plays/larc2021/goalKickPlay.py @@ -32,9 +32,9 @@ def get_positions(self, foul, team_color, foul_color, quadrant): replacements.append( { "robot_id": 0, - "x": -field_size[0]/2 + 0.05, + "x": -field_size[0]/2 + 0.1, "y": 0.2, - "orientation": 45 + "orientation": 60 } ) else: diff --git a/main.py b/main.py index 42f78403..aa38465d 100644 --- a/main.py +++ b/main.py @@ -59,7 +59,7 @@ def update(self): } for r in commands ] self.comm.send(commands) - + if self.referee.get_foul() != "STOP" and self.referee.get_foul() != 7 and self.referee.get_foul() != None: if self.match.coach.get_positions( self.referee.get_foul(), self.match.team_color.upper(), self.referee.get_color(), self.referee.get_quadrant() ): self.referee.send_replacement(