Пример #1
0
 def debug_cmd(self):
     if self.current_state == self.defense:
         return DebugCommandFactory().line(self.game_state.ball.position,
                                           self._best_target_into_goal(),
                                           timeout=0.1)
     elif self.current_state == self.intercept and self.last_intersection is not None:
         return DebugCommandFactory().line(self.game_state.ball.position,
                                           self.last_intersection,
                                           timeout=0.1)
     else:
         return []
Пример #2
0
 def debug_cmd(self):
     if self.wall_segment is None or self.player_number_in_formation != 0:
         return []
     return [DebugCommandFactory().line(self.wall_segment.p1,
                                        self.wall_segment.p2,
                                        timeout=0.1),
             DebugCommandFactory().line(self.center_formation,
                                        self.bisect_inter,
                                        timeout=0.1),
             DebugCommandFactory().line(self.game_state.ball_position,
                                        self.game_state.field.our_goal_line.p1,
                                        timeout=0.1),
             DebugCommandFactory().line(self.game_state.ball_position,
                                        self.game_state.field.our_goal_line.p2,
                                        timeout=0.1)
             ]
Пример #3
0
 def debug_cmd(self):
     cmds = []
     [
         cmds.extend(DebugCommandFactory().area(area, color=VIOLET))
         for area in self.forbidden_areas
     ]
     return cmds
Пример #4
0
 def _send_auto_state(self):
     if self.play_executor.ref_states:
         ref_state = self.play_executor.ref_states[-1]
         msg = DebugCommandFactory().auto_play_info(
             ref_state.info, ref_state.team_info,
             self.play_executor.auto_play.info,
             self.play_executor.autonomous_flag)
         self.ui_send_queue.put(msg)
Пример #5
0
    def _send_books(self):

        msg = DebugCommandFactory().books(
            strategy_book=self.play_state.strategy_book.strategies_roles,
            strategy_default=self.play_state.strategy_book.default_strategies,
            tactic_book=self.play_state.tactic_book.tactics_name,
            tactic_default=self.play_state.tactic_book.default_tactics)
        self.ui_send_queue.put(msg)
Пример #6
0
    def __init__(self,
                 game_state: GameState,
                 player: Player,
                 target: Pose = Pose(),
                 args: List[str] = None):
        super().__init__(game_state, player, target, args)
        self.current_state = self.get_behind_ball
        self.next_state = self.get_behind_ball
        self.debug_interface = DebugCommandFactory()
        self.move_action = self._generate_move_to()
        self.last_ball_position = self.game_state.ball_position
        self.charge_time = 0
        self.last_time = time.time()

        self.orientation_target = 0
        self.target = target