def recalculate(self):
    if ((self.receive_point == None) or (self.robot == None) or (self.target_point == None)):
        return
    ball = main.ball()
    if self.ball_kicked:
        self._pass_line = robocup.Line(ball.pos, (ball.pos + (ball.vel * 10)))
        target_angle_rad = self.adjust_angle((self.target_point - self.robot.pos).angle())
        self._kick_line = robocup.Line(self.robot.pos, robocup.Point((self.robot.pos.x + (math.cos(self.robot.angle) * 10)), (self.robot.pos.y + (math.sin(self.robot.angle) * 10))))
    else:
        self._pass_line = robocup.Line(ball.pos, self.receive_point)
        target_angle_rad = self.adjust_angle((self.target_point - self.robot.pos).angle(), (self.robot.pos - main.ball().pos).angle(), constants.Robot.MaxKickSpeed)
        target_angle_rad = ((target_angle_rad + (self.target_point - self.robot.pos).angle()) / 2)
        self._kick_line = robocup.Line(self.receive_point, self.target_point)
    self._angle_facing = target_angle_rad
    self.target_angle = target_angle_rad
    angle_rad = self.robot.angle
    self._angle_error = (target_angle_rad - angle_rad)
    if self.ball_kicked:
        receive_before_adjust = self._pass_line.nearest_point(self.robot.pos)
    else:
        receive_before_adjust = self.receive_point
    self._target_pos = (receive_before_adjust - robocup.Point((constants.Robot.Radius * math.cos(self.robot.angle)), (constants.Robot.Radius * math.sin(self.robot.angle))))
    self._x_error = (self._target_pos.x - self.robot.pos.x)
    self._y_error = (self._target_pos.y - self.robot.pos.y)
def recalculate(self):
    if ((self.receive_point == None) or (self.robot == None) or (self.target_point == None)):
        return
    ball = main.ball()
    if self.ball_kicked:
        self._pass_line = robocup.Line(ball.pos, (ball.pos + (ball.vel * 10)))
        target_angle_rad = self.adjust_angle((self.target_point - self.robot.pos).angle())
        self._kick_line = robocup.Line(self.robot.pos, robocup.Point((self.robot.pos.x + (math.cos(self.robot.angle) * 10)), (self.robot.pos.y + (math.sin(self.robot.angle) * 10))))
    else:
        self._pass_line = robocup.Line(ball.pos, self.receive_point)
        target_angle_rad = self.adjust_angle((self.target_point - self.robot.pos).angle(), (self.robot.pos - main.ball().pos).angle(), constants.Robot.MaxKickSpeed)
        target_angle_rad = ((target_angle_rad + (self.target_point - self.robot.pos).angle()) / 2)
        self._kick_line = robocup.Line(self.receive_point, self.target_point)
    self._angle_facing = target_angle_rad
    self.target_angle = target_angle_rad
    angle_rad = self.robot.angle
    self._angle_error = (target_angle_rad - angle_rad)
    if self.ball_kicked:
        receive_before_adjust = self._pass_line.nearest_point(self.robot.pos)
    else:
        receive_before_adjust = self.receive_point
    self._target_pos = (receive_before_adjust - robocup.Point((constants.Robot.Radius * math.cos(self.robot.angle)), (constants.Robot.Radius * math.sin(self.robot.angle))))
    self._x_error = (self._target_pos.x - self.robot.pos.x)
    self._y_error = (self._target_pos.y - self.robot.pos.y)