Simply put, the function of changing lanes is to select one of the reference lines from the reference lines to be selected. line, for use by Planning’s subsequent modules.
#It should be noted that the open source lane changing code provided by Apollo has been greatly deleted, and only a simple frame. Many functions, such as active lane changing, passive lane changing (due to obstacles), relatively complete state machine, lane changing window and Gap selection, etc. are missing. This technical article only shows content on the existing framework. Regarding the content of other lane changing functions, please look forward to the follow-up articles
Apollo’s current lane changing state machine is as follows:
There are a few points worth noting about the state machine:
The path where the relevant code is located: modules/planning/tasks/deciders/lane_change_decider/http://lane_change_decider.cc
reference_line_info
is empty. reckless_change_lane
is true
, then directly Update Reference Line.prev_status
. When you first enter the program, there may be no status information in prev_status
(!prev_status-> has_status()
), at this time it is directly considered that the lane change is completed. reference_line_info
is 1 (that is, has_change_lane
is false
), indicating that the vehicle is in the patrol state. The lane where the vehicle is currently located has a unique lane line and there are no variable lanes around it, so you can directly update the lane change status. ChangeLaneStatus::IN_CHANGE_LANE
: If the Lane where the car was in the previous frame and the Lane where the car is in this frame If the same, it means that the vehicle is still walking towards the target lane. On the contrary, if the Lane where the vehicle was in the previous frame is different from the Lane where it is in this frame, it means that the vehicle is already in the target lane and the switch has been completed.ChangeLaneStatus::CHANGE_LANE_FAILED
: If the lane changing fails, the state will be frozen for a period of time, and then switched to the lane changing state to prepare for the next lane changing.ChangeLaneStatus::CHANGE_LANE_FINISHED
: After the lane change is successful, it will also freeze for a period of time, and then switch to the lane changing state to prepare for the next lane change. The purpose of freezing the time here is to avoid frequent lane changes.IsClearToChangeLane
Determine whether the lane change is safe.
IsChangeLanePath
, use the projection relationship calculated above to ignore obstacles outside the lane of the target reference line
Determine whether the obstacle is traveling in the same direction as the vehiclesame_direction. Calculate the forward direction based on the relationship between the obstacle and the vehicle's traveling direction and speed relationship. Safety distance and backward safety distance
<span>Input:</span>
is_prioritize_change_lane
. If is_prioritize_change_lane
is true
, then find the target reference line to switch to. . On the other hand, if is_prioritize_change_lane
is
reference_line_info->splice(reference_line_info-> begin(),*reference_line_info, iter)
;Put the reference line pointed to by iter
found in step 1 at the front of the linked list. Since Planning subsequent modules use reference_line_info( ).front(), so the front of the linked list indicates that the frame is the reference line used.
The above is the detailed content of An in-depth analysis of Apollo's lane changing strategy and its practical application. For more information, please follow other related articles on the PHP Chinese website!