selfdrive/controls/lib/lane_planner.py
def _get_camera_position(self):
    """
    Returns the position of the camera in the lane as a percentage. left to right: [0, 1]; 0.5 is centered
    You MUST verify that either left or right polys and lane width are accurate before calling this function.
    """
    left_line_pos = self.l_poly[3] + self.camera_offset  # polys have not been offset yet
    right_line_pos = self.r_poly[3] + self.camera_offset
    cam_pos_left = left_line_pos / self.lane_width_estimate  # estimated position of car in lane based on left line
    cam_pos_right = 1 - abs(right_line_pos) / self.lane_width_estimate  # estimated position of car in lane based on right line

    # find car's camera position using weighted average of lane poly certainty
    # if certainty of both lines are high, then just average ~equally
    l_prob = self.l_prob / (self.l_prob + self.r_prob)  # this and next line sums to 1
    r_prob = self.r_prob / (self.l_prob + self.r_prob)
    # be biased towards position found from most probable lane line
    return cam_pos_left * l_prob + cam_pos_right * r_prob

    Returns the position of the camera in the lane as a percentage. left to right: [0, 1]; 0.5 is centered
    You MUST verify that either left or right polys and lane width are accurate before calling this function.
    
Returns the position of the camera in the lane as a percentage. left to right: [0, 1]; 0.5 is centered
You MUST verify that either left or right polys and lane width are accurate before calling this function.
Returns the position of the camera in the lane as a percentage . left to right : [ 0 1 ] ; 0 . 5 is centered You MUST verify that either left or right polys and lane width are accurate before calling this function .
def _get_camera_position(self):
    left_line_pos = self.l_poly[3] + self.camera_offset  
    right_line_pos = self.r_poly[3] + self.camera_offset
    cam_pos_left = left_line_pos / self.lane_width_estimate  
    cam_pos_right = 1 - abs(right_line_pos) / self.lane_width_estimate  
    l_prob = self.l_prob / (self.l_prob + self.r_prob)  
    r_prob = self.r_prob / (self.l_prob + self.r_prob)
    return cam_pos_left * l_prob + cam_pos_right * r_prob
def _get_camera_position ( self ) : left_line_pos = self . l_poly [ 3 ] + self . camera_offset right_line_pos = self . r_poly [ 3 ] + self . camera_offset cam_pos_left = left_line_pos / self . lane_width_estimate cam_pos_right = 1 - abs ( right_line_pos ) / self . lane_width_estimate l_prob = self . l_prob / ( self . l_prob + self . r_prob ) r_prob = self . r_prob / ( self . l_prob + self . r_prob ) return cam_pos_left * l_prob + cam_pos_right * r_prob
Returns the position of the camera in the lane as a percentage.
Returns the position of the camera in the lane as a percentage .
"""
    Returns the position of the camera in the lane as a percentage. left to right: [0, 1]; 0.5 is centered
    You MUST verify that either left or right polys and lane width are accurate before calling this function.
    """ # polys have not been offset yet # estimated position of car in lane based on left line # estimated position of car in lane based on right line # find car's camera position using weighted average of lane poly certainty # if certainty of both lines are high, then just average ~equally # this and next line sums to 1 # be biased towards position found from most probable lane line
self