


An in-depth analysis of Apollo's lane changing strategy and its practical application
1. Introduction
1.1. The function of changing lanes
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
1.2. Lane changing state machine
Apollo’s current lane changing state machine is as follows:
There are a few points worth noting about the state machine:
- The IN_CHANGE_LANE here includes both the lane change execution and lane change preparation stages. Under normal circumstances It should be distinguished. Apollo adopts the method of first switching the reference line and then performing the lane change action, while some friends will adopt the method of first performing the lane change action and then switching the reference line (the advantage is that in the frame when the reference line is switched, the lateral direction of the own car The distance is close to 0).
- The current code does not reflect when the lane change will fail. There is also reason to believe that it is caused by deleting the relevant code.
- The complete lane change status should At least include: lane change preparation, lane change execution, lane change maintenance, lane change cancellation, lane change completion and other statuses.
2. Code analysis
2.1. Overall process
The path where the relevant code is located: modules/planning/tasks/deciders/lane_change_decider/http://lane_change_decider.cc
- Handle the exception when
reference_line_info
is empty. - If forced lane change is configured
reckless_change_lane
istrue
, then directly Update Reference Line. - Get the lane changing status of the previous frame
prev_status
. When you first enter the program, there may be no status information inprev_status
(!prev_status-> has_status()
), at this time it is directly considered that the lane change is completed. - If the number of
reference_line_info
is 1 (that is,has_change_lane
isfalse
), 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. - Switch lane change The state machine
- The previous frame was in the lane change state
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. - The previous frame was in the lane changing failed state
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. - The previous frame was in the lane change completed state
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.
2.2. Safety check
IsClearToChangeLane
Determine whether the lane change is safe.
- This safety judgment method does not consider virtual obstacles (Virtual Obstacles) and static obstacles (Static Obstacles).
- Calculate the projection of dynamic obstacles on the Reference Line. The geometric meaning of the projection As shown below:
- If the vehicle is changing lanes
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
- .If the distance between the vehicle and the obstacle is greater than the safety distance calculated above, it is considered that it is safe to change lanes.
2.3. Update Reference Line
-
<span>Input:</span>
is_prioritize_change_lane
. Ifis_prioritize_change_lane
istrue
, then find the target reference line to switch to. . On the other hand, ifis_prioritize_change_lane
is false - , then find the reference line of the Lane where the current position of the vehicle is located.
reference_line_info->splice(reference_line_info-> begin(),*reference_line_info, iter)
;Put the reference line pointed to byiter
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. For detailed instructions on the use of splice - , see C Basics.Output:
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!

In John Rawls' seminal 1971 book The Theory of Justice, he proposed a thought experiment that we should take as the core of today's AI design and use decision-making: the veil of ignorance. This philosophy provides a simple tool for understanding equity and also provides a blueprint for leaders to use this understanding to design and implement AI equitably. Imagine that you are making rules for a new society. But there is a premise: you don’t know in advance what role you will play in this society. You may end up being rich or poor, healthy or disabled, belonging to a majority or marginal minority. Operating under this "veil of ignorance" prevents rule makers from making decisions that benefit themselves. On the contrary, people will be more motivated to formulate public

Numerous companies specialize in robotic process automation (RPA), offering bots to automate repetitive tasks—UiPath, Automation Anywhere, Blue Prism, and others. Meanwhile, process mining, orchestration, and intelligent document processing speciali

The future of AI is moving beyond simple word prediction and conversational simulation; AI agents are emerging, capable of independent action and task completion. This shift is already evident in tools like Anthropic's Claude. AI Agents: Research a

Rapid technological advancements necessitate a forward-looking perspective on the future of work. What happens when AI transcends mere productivity enhancement and begins shaping our societal structures? Topher McDougal's upcoming book, Gaia Wakes:

Product classification, often involving complex codes like "HS 8471.30" from systems such as the Harmonized System (HS), is crucial for international trade and domestic sales. These codes ensure correct tax application, impacting every inv

The future of energy consumption in data centers and climate technology investment This article explores the surge in energy consumption in AI-driven data centers and its impact on climate change, and analyzes innovative solutions and policy recommendations to address this challenge. Challenges of energy demand: Large and ultra-large-scale data centers consume huge power, comparable to the sum of hundreds of thousands of ordinary North American families, and emerging AI ultra-large-scale centers consume dozens of times more power than this. In the first eight months of 2024, Microsoft, Meta, Google and Amazon have invested approximately US$125 billion in the construction and operation of AI data centers (JP Morgan, 2024) (Table 1). Growing energy demand is both a challenge and an opportunity. According to Canary Media, the looming electricity

Generative AI is revolutionizing film and television production. Luma's Ray 2 model, as well as Runway's Gen-4, OpenAI's Sora, Google's Veo and other new models, are improving the quality of generated videos at an unprecedented speed. These models can easily create complex special effects and realistic scenes, even short video clips and camera-perceived motion effects have been achieved. While the manipulation and consistency of these tools still need to be improved, the speed of progress is amazing. Generative video is becoming an independent medium. Some models are good at animation production, while others are good at live-action images. It is worth noting that Adobe's Firefly and Moonvalley's Ma

ChatGPT user experience declines: is it a model degradation or user expectations? Recently, a large number of ChatGPT paid users have complained about their performance degradation, which has attracted widespread attention. Users reported slower responses to models, shorter answers, lack of help, and even more hallucinations. Some users expressed dissatisfaction on social media, pointing out that ChatGPT has become “too flattering” and tends to verify user views rather than provide critical feedback. This not only affects the user experience, but also brings actual losses to corporate customers, such as reduced productivity and waste of computing resources. Evidence of performance degradation Many users have reported significant degradation in ChatGPT performance, especially in older models such as GPT-4 (which will soon be discontinued from service at the end of this month). this


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
