main content

highway lane change -凯发k8网页登录

this example shows how to perceive surround-view information and use it to design an automated lane change maneuver system for highway driving scenarios.

introduction

an automated lane change maneuver (lcm) system enables the ego vehicle to automatically move from one lane to another lane. an lcm system models the longitudinal and lateral control dynamics for an automated lane change. lcm systems scan the environment for most important objects (mios) using onboard sensors, identify an optimal trajectory that avoids these objects, and steer the ego vehicle along the identified trajectory.

this example shows how to create a test bench model to test the sensor fusion, planner, and controller components of an lcm system. this example uses five vision sensors and one radar sensor to detect other vehicles from the surrounding view of the ego vehicle. it uses a joint probabilistic data association (jpda) based tracker to track the fused detections from these multiple sensors. the lane change planner then generates a feasible trajectory for the tracks to negotiate a lane change that is executed by the lane change controller. in this example, you:

  • partition the algorithm and test bench — the model is partitioned into lane change algorithm models and a test bench model. the algorithm models implement the individual components of the lcm system. the test bench includes the integration of the algorithm models and testing framework.

  • explore the test bench model — the test bench model contains the testing framework, which includes the sensors and environment, ego vehicle dynamics model, and metrics assessment using ground truth.

  • explore the algorithm models — algorithm models are reference models that implement the sensor fusion, planner, and controller components to build the lane change application.

  • simulate and visualize system behavior — simulate the test bench model to test the integration of sensor fusion and tracking with planning and controls to perform lane change maneuvers on a curved road with multiple vehicles.

  • explore other scenarios — these scenarios test the system under additional conditions.

you can apply the modeling patterns used in this example to test your own lcm system.

partition algorithm and test bench

the model is partitioned into separate algorithm models and a test bench model.

  • algorithm models — algorithm models are reference models that implement the functionality of individual components.

  • test bench model — the highway lane change test bench specifies the stimulus and environment for testing the algorithm models.

explore test bench model

in this example, you use a system-level simulation test bench model to explore the behavior of a probabilistic sensor-based lcm system.

to explore the test bench model, open a working copy of the project example files. matlab® copies the files to an example folder so you can edit them.

addpath(fullfile(matlabroot,"toolbox","driving","drivingdemos"));
helperdrivingprojectsetup("highwaylanechange.zip",workdir=pwd);

open the system-level simulation test bench model.

open_system("highwaylanechangetestbench")

opening this model runs the helperslhighwaylanechangesetup function, which initializes the road scenario using the object in the base workspace. it also configures the sensor configuration parameters, tracker design parameters, planner configuration parameters, controller design parameters, vehicle model parameters, and the simulink® bus signals required for defining the inputs and outputs for the highwaylanechangetestbench model.

the test bench model contains these subsystems:

  • scenario and environment — subsystem that specifies the scene, vehicles, sensors, and map data used for simulation. this example uses five vision sensors, one radar sensor, and an ins sensor.

  • surround vehicle sensor fusion — subsystem that fuses the detections from multiple sensors to produce tracks.

  • planner configuration parameters — subsystem that specifies the configuration parameters required for the planner algorithm.

  • highway lane change planner — subsystem that implements the lane change planner algorithm for highway driving.

  • lane change controller — subsystem that specifies the path-following controller that generates control commands to steer the ego vehicle along the generated trajectory.

  • vehicle dynamics — subsystem that specifies the dynamic model for the ego vehicle.

  • metrics assessment — subsystem that specifies metrics to assess system-level behavior.

the highway lane change planner, lane change controller, and metrics assessment subsystems are the same as those in the example. however, whereas the lane change planner in the highway lane change planner and controller example, uses ground truth information from the scenario to detect mios, the lane change planner in this example uses tracks from surround vehicle sensor fusion to detect the mios. the vehicle dynamics subsystem models the ego vehicle using a bicycle model block, and updates its state using commands received from the lane change controller subsystem.

the scenario and environment subsystem uses the block to provide road network and vehicle ground truth positions. this block also outputs map data required for the highway lane change planner algorithm. this subsystem outputs the detections from the vision sensors, clusters from the radar sensor, and ego-estimated position from the ins sensor required for the sensor fusion and tracking algorithm. open the scenario and environment subsystem.

open_system("highwaylanechangetestbench/scenario and environment")

  • the block configures the driving scenario and outputs actor poses, which control the positions of the target vehicles.

  • the block converts actor poses from the coordinates of the ego vehicle to the world coordinates.

  • the block simulates object detections using a camera sensor model.

  • the block simulates object detections based on a statistical model. it also outputs clustered object detections for further processing.

  • the block models the measurements from the inertial navigation system and global navigation satellite system and outputs the fused measurements. it outputs the noise-corrupted position, velocity, and orientation of the ego vehicle.

the subsystem configures five vision sensors and a radar sensor to capture the surround view of the vehicle. these sensors are mounted on different locations on the ego vehicle to capture a 360-degree view.

the bird's-eye scope displays sensor coverage using a cuboid representation. the radar coverage area and detections are in red. the vision coverage area and detections are in blue.

the vehicle dynamics subsystem uses a bicycle model block to model the ego vehicle. for more details on the vehicle dynamics subsystem, see the highway lane following example. open the vehicle dynamics subsystem.

open_system("highwaylanechangetestbench/vehicle dynamics");

the bicycle model block implements a rigid two-axle single-track vehicle body model to calculate longitudinal, lateral, and yaw motion. the block accounts for body mass, aerodynamic drag, and weight distribution between the axles due to acceleration and steering. for more details, see (automated driving toolbox).

the metric assessment subsystem enables system-level metric evaluations using the ground truth information from the scenario. open the metrics assessment subsystem.

open_system("highwaylanechangetestbench/metrics assessment")

  • the collision detection subsystem detects the collision of the ego vehicle with other vehicles and halts the simulation if it detects a collision. the subsystem also computes the timegap parameter using the distance to the lead vehicle (headway) and the longitudinal velocity of the ego vehicle. this parameter is evaluated against prescribed limits.

  • the jerk metrics subsystem computes the longitudinaljerk and lateraljerk parameters using longitudinal velocity and lateral velocity, respectively. these parameters are evaluated against prescribed limits.

for more details on how to validate the metrics automatically using simulink test, see the automate testing for highway lane change example.

explore algorithm models

the lane change system is developed by integrating the surround vehicle sensor fusion, lane-change planner, and lane-following controller components.

the surround vehicle sensor fusion algorithm model fuses vehicle detections from cameras and radar sensors and tracks the detected vehicles using the central-level tracking method. open the surround vehicle sensor fusion algorithm model.

open_system("surroundvehiclesensorfusion")

the surround vehicle sensor fusion model takes the vehicle detections from vision sensors and clusters from the radar sensor as inputs.

  • the vision detection concatenation block concatenates the vision detections.

  • the delete velocity from vision block is a matlab function block that deletes velocity information from vision detections.

  • the vision and radar detection concatenation block concatenates the vision and radar detections.

  • the add localization information block is a matlab function block that adds localization information for the ego vehicle to the concatenated detections using an estimated ego vehicle pose from the ins sensor. this enables the tracker to track in the global frame, and minimizes the effect on the tracks of lane change maneuvers by the ego vehicle.

  • the helperjpdatracker block performs fusion and manages the tracks of stationary and moving objects. the tracker fuses the information contained in the concatenated detections and tracks the objects around the ego vehicle. it estimates tracks in the frenet coordinate system. it uses mapinfo from the scenario to estimate the tracks in frenet coordinate system. the tracker then outputs a list of confirmed tracks. these tracks are updated at a prediction time driven by a digital clock in the scenario and environment subsystem.

for more details on the algorithm, see the example.

the highway lane change planner is a fundamental component of a highway lane change system. this component is expected to handle different driving behaviors to safely navigate the ego vehicle from one point to another point. the highway lane change planner algorithm model contains a terminal state sampler, motion planner, and motion prediction module. the terminal state sampler samples terminal states based on the planner parameters and the current state of both the ego vehicle and other vehicles in the scenario. the motion prediction module predicts the future motion of mios. the motion planner samples trajectories and outputs an optimal trajectory. open the highway lane change planner algorithm model.

open_system("highwaylanechangeplanner")

the algorithm model implements the main algorithm for the highway lane change system. the reference model reads map data, actor poses (in world coordinates), and planner parameters from the scenario and environment subsystem to perform trajectory planning. the model uses the frenet coordinate system to find the mios surrounding the ego vehicle. then, the model samples terminal states for different behaviors, predicts the motion of target actors, and generates multiple trajectories. finally, the model evaluates the costs of generated trajectories and checks for the possibility of collision and kinematic feasibility to estimate the optimal trajectory. for more details, see the example.

the lane change controller reference model simulates a path-following control mechanism that keeps the ego vehicle traveling along the generated trajectory while tracking a set velocity. open the lane change controller reference model.

open_system("lanechangecontroller");

the controller adjusts both the longitudinal acceleration and front steering angle of the ego vehicle to ensure that the ego vehicle travels along the generated trajectory. the controller computes optimal control actions while satisfying velocity, acceleration, and steering angle constraints using adaptive model predictive control (mpc). for more details on the integration of the highway lane change planner and controller, see the example.

simulate and visualize system behavior

set up and run the highwaylanechangetestbench simulation model to visualize the behavior of the system during a lane change. the visualization block in the model creates a matlab figure that shows the chase view and top view of the scenario and plots the ego vehicle, tracks, sampled trajectories, capsule list, and other vehicles in the scenario.

disable the mpc update messages.

mpcverbosity("off");

configure the highwaylanechangetestbench model to use the scenario_lc_15_stopngo_curved scenario.

helperslhighwaylanechangesetup(scenariofcnname="scenario_lc_15_stopngo_curved");
sim("highwaylanechangetestbench");

during the simulation, the model logs signals to the base workspace as logsout. you can analyze the simulation results and debug any failures in the system behavior using the helperanalyzelcsimulationresults object. the visualizesimulationdata function of the method creates a matlab figure and plots a chase view of the scenario along with detections and tracks. for more details on this figure, see the example. run the function and explore the plot.

visualizatonobj = helperanalyzelcsimulationresults(logsout);
visualizatonobj.visualizesimulationdata()

explore other scenarios

in this example, you have explored the system behavior for the scenario_lc_15_stopngo_curved scenario, but you can use the same test bench model to explore other scenarios. this is a list of scenarios that are compatible with the highwaylanechangetestbench model.

scenario_lc_01_slowmoving
scenario_lc_02_slowmovingwithpassingcar
scenario_lc_03_disabledcar
scenario_lc_04_cutinwithbrake
scenario_lc_05_singlelanechange
scenario_lc_06_doublelanechange
scenario_lc_07_rightlanechange
scenario_lc_08_slowmovingcar_curved
scenario_lc_09_cutinwithbrake_curved
scenario_lc_10_singlelanechange_curved
scenario_lc_11_mergingcar_highwayentry
scenario_lc_12_cutincar_highwayentry
scenario_lc_13_disabledcar_ushape
scenario_lc_14_doublelanechange_ushape
scenario_lc_15_stopngo_curved [default]

each of these scenarios have been created using the driving scenario designer and exported to a scenario file. examine the comments in each file for more details on the road and vehicles in each scenario. you can configure the highwaylanechangetestbench model and workspace to simulate these scenarios using the helperslhighwaylanechangesetup function. for example, you can configure the simulation for a curved road scenario using this command.

helperslhighwaylanechangesetup(scenariofcnname="scenario_lc_10_singlelanechange_curved");

conclusion

in this example, you designed and simulated a highway lane change maneuver system using information perceived from surround view. this example showed how to integrate sensor fusion, planner, and controller components to simulate a highway lane change system in a closed-loop environment. the example also demonstrated various evaluation metrics to validate the performance of the designed system. if you have a simulink coder™ license and embedded coder™ license, you can generate ready-to-deploy code of the algorithm models for an embedded real-time target (ert).

enable the mpc update messages again.

mpcverbosity("on");

see also

(navigation toolbox)

related topics

网站地图