Example #1
0
    def calculate_properties(self, *args):
        if self.visible:
            ball_position = args[0]
            BaseRobot.calculate_properties(self, ball_position)
            if self.desired_position is not None:
                self.direction["desired_position"] = Util.get_direction(self.position, self.desired_position)

            if self.enemy1.visible:
                self.direction["enemy1"] = Util.get_direction(self.position, self.enemy1.position)
            if self.enemy2.visible:
                self.direction["enemy2"] = Util.get_direction(self.position, self.enemy2.position)
            if self.enemy1.visible and self.enemy2.visible:
                self.intercept_line = [self.enemy1.position, self.enemy2.position]

            if self.facing_attacking_goal:
                if self.enemy1.visible and self.enemy2.visible and self.ally.visible:
                    list_of_robots = [self.ally, self.enemy1, self.enemy2]
                    self.can_score = Util.can_score(self.attacking_goal, self, list_of_robots)
                else:
                    return True
            else:
                self.can_score = False

            self.direction['attacking goal'] = Util.get_direction(self.position,
                                                                  Util.get_midpoint(self.attacking_goal_line))
Example #2
0
    def calculate_properties(self, *args):
        if self.visible:
            ball_position = args[0]
            BaseRobot.calculate_properties(self, ball_position)
            if self.desired_position is not None:
                self.direction["desired_position"] = Util.get_direction(self.position, self.desired_position)

            if self.enemy1.visible:
                self.direction["enemy1"] = Util.get_direction(self.position, self.enemy1.position)
            if self.enemy2.visible:
                self.direction["enemy2"] = Util.get_direction(self.position, self.enemy2.position)
            if self.enemy1.visible and self.enemy2.visible:
                self.intercept_line = [self.enemy1.position, self.enemy2.position]
Example #3
0
    def __init__(self, name, role):
        BaseRobot.__init__(self, name, role)
        self.has_ball_sensor = False

        self.desired_position = None
        self.direction["desired position"] = None
        self.direction["enemy1"] = None
        self.direction["enemy2"] = None

        self.enemy1 = None
        self.enemy2 = None

        self.intercept_line = None
Example #4
0
    def __init__(self, name, role):
        BaseRobot.__init__(self, name, role)
        self.desired_position = None
        self.direction['desired position'] = None
        self.desired_heading = None

        # properties for the subtask
        self.required_bearing = 180
        self.required_heading = 180
        self.required_grabbing = 0
        self.required_kicking = 0

        self.grabbingTimeout = time.time()
        self.kickTries = 0

        self.intercept_line = None
        self.enemy1 = None
        self.enemy2 = None

        self.has_ball_sensor = False