def get_lane_mean_x(lane):
    """Get mean x of the lane.

    :param lane: target lane
    :type lane: list
    :return: the mean value of x
    :rtype: float
    """
    x_pos_list = []
    for pt in lane:
        x_pos_list.append(pt.x)
    x_mean = 0
    if len(x_pos_list) == 1:
        x_mean = x_pos_list[0]
    elif len(x_pos_list) > 1:
        x_mean = (x_pos_list[0] + x_pos_list[-1]) / 2
    return x_mean