Exemplo n.º 1
0
    def condition(self):
        dst = self.get_bb().init_pos
        robot_pos = VecPos.from_vector3(self.get_bb().vision_info.robot_pos)
        dis = get_dis(dst, robot_pos)
        diff_angle = abs_angle_diff(dst.z - robot_pos.z)

        return dis < self.dis_tol and diff_angle < self.angle_tol
Exemplo n.º 2
0
    def condition(self):
        dst = self.get_bb().init_pos
        robot_pos = VecPos.from_vector3(self.get_bb().vision_info.robot_pos)
        dis = get_dis(dst, robot_pos)
        diff_angle = abs_angle_diff(dst.z - robot_pos.z)

        initial_entry_exit = dis >= self.dis_tol and diff_angle >= self.angle_tol
        in_enemy_field = (self.get_bb().param.attack_right and robot_pos.x > 10) or \
                         (not self.get_bb().param.attack_right and robot_pos.x < -10)
        return initial_entry_exit or in_enemy_field
Exemplo n.º 3
0
    def condition(self):
        dst = self.get_bb().init_pos
        robot_pos = VecPos.from_vector3(self.get_bb().vision_info.robot_pos)
        dis = get_dis(dst, robot_pos)
        diff_angle = abs_angle_diff(dst.z - robot_pos.z)
        if self.get_bb().param.attack_right:
            in_enemy_field = robot_pos.x >= 10
        else:
            in_enemy_field = robot_pos.x <= -10

        return dis >= self.dis_tol and \
               diff_angle <= self.angle_tol and \
               in_enemy_field