highway lane change video -凯发k8网页登录
learn how to develop automated lane change maneuver (lcm) systems for highway driving scenarios using automated driving toolbox™ and navigation toolbox™. automated lcm systems enable self-driving vehicles to automatically move from one lane to another. discover how to design and integrate the following subsystems used in automated lcm systems:
- vehicle dynamics
- sensors and simulation environments
- path planning algorithm designs
- lane change controller designs
- metric assessments and visualizations
hello, everyone. i am mihir acharya, product manager for navigation toolbox at mathworks. and i work with robotics and autonomous systems applications. i'll be presenting this webinar today with pitambar.
hey, everyone. my name is pitambar dayal. i'm the product manager for automated driving toolbox at mathworks. and i'll be joining mihir here today to present this webinar.
all right, let's get started. in this session, you will learn how to design and simulate lane change maneuver system for an autonomous vehicle driving on a highway. we will see how you can develop virtual worlds for simulation, design a motion planner and controller, run simulation tests, and finally deploy the code on a hardware platform.
lane changing is one of the many complex processes for a self-driving vehicle. and in this session, we will show how you can use model-based design to build a lane change maneuver system. but before we jump into the specifics, i would like to share the bigger picture with you.
at mathworks, we pay special attention on the industry trends and how we can support our customers by providing algorithms and tools for these trends. the first trend we see now is the need for virtual worlds. the industry continues to do more with simulation in order to reduce vehicle testing, as well as explore scenarios that may be difficult or unsafe to reproduce in the real world. mathworks provides tools that allow you to design and simulate scenes, scenarios, sensors, and dynamics.
the second trend driving mathworks investments is the need for multidisciplinary skills. developing an autonomous system application requires a variety of skills that includes perception algorithms for object detecting or tracking, localization and pulse estimation, and algorithms for motion planning and controls. now you could be an expert in one of these or multiple of these areas, but also want to use out-of-the-box solution for the other pieces of the puzzle.
now mathworks provides dedicated toolboxes to help you learn and apply these disciplines. these toolboxes include metrics and analysis capabilities that you can use throughout your development process. the third trend driving investments is the need for software. our investments here are focused on strengthening our platform tools to enable you to design, deploy, and test embedded software. today, we will illustrate the planning and control capabilities along with the other pieces of this workflow. now let's take a look at the lane change maneuver example.
we use this simulating test bench model for the highway lane change maneuver system. let's see a quick glimpse of the simulation output. a level 2 or level 3 highway driving automation requires a motion planner and a robust controller for lane change maneuvers. in this simulation, the blue car is called the ego vehicle or ego actor. and the vehicle in front of this ego vehicle is called the lead or target vehicle. when the lead vehicle slows, down the planner generates an optimal trajectory for the ego vehicle to change the lane. this example also shows how to perform collision checking using dynamic capsule-based objects.
this test bench includes six major subsystems-- scenario and environment, lane change planner and planner configuration, lane change controller, vehicle dynamics, metric assessment, and visualization. from left to right, we will walk you through each subsystem of this model, i will now hand it over to pitambar to walk us through the scenario and planner subsystems of this model.
here, we have our test bench model. and the first subsystem that will look at is the scenario and environment block. this subsystem reads map data from the base workspace. and it outputs information about lanes and reference path. so let's click in and take a look.
now, there's two main blocks here-- the scenario reader block and the vehicle to world block. let's start with this first one. so the scenario reader block reads in a driving scenario from the workspace. you can see the parameters of this block that you can change over here. we're going to be using a pre-loaded scenario, which you saw in the demo earlier.
now let me close out of this. and this block will take an ego vehicle information to perform a closed loop simulation. and it outputs ground truth about actors and lane boundaries in ego vehicle coordinates.
so the other block we have is the vehicle to world block. this converts target vehicle positions from vehicle coordinates to world coordinates. now, we see the outputs of this subsystem on the right. let's go back to our test bench and see what these outputs map to.
we can see that system time, map info, and target actors world, all map to our next subsystem, which is the highway lane change planner. our lane boundaries and our target actors ego map to our metrics assessment. and target actors world also maps to the visualization.
so that brings us to the next subsystem, which is the highway lane change planner. now i'll click in here, and you'll see that this is a pretty complex subsystem. so before i dive into the different blocks we see here, i'll use a schematic to show what's going on.
ok, now let's go through how the motion planner works at a high level. and then we'll map it back to the subsystem that we just saw. so the main operations of the motion planner are driven by three functions-- there's the dynamiccapsulelist, which is used for collision checking. there's the referencepathfrenet. this handles coordinate transforms. we have global2frenet and frenet2global. and the third one we have is trajectorygeneratorfrenet, which we'll get to in a minute.
but first, here, we have a map. and the waypoints are defined to reach the destination by mission planner. now the mission planner is out of the scope of today's topic. so we just assumed that the waypoints are given for a driving scenario.
the first thing we do is execute a coordinate transform from global2frenet space for the ego vehicle and surrounding most important objects, or mios. now with the surrounding traffic conditions and map information, the terminal state sampler defines terminal states for cruise control, lead car following, and lane change.
the trajectorygeneratorfrenet generates multiple candidate trajectories the ego vehicle can take to meet the terminal states. we perform a cost evaluation and feasibility checks for each candidate trajectory to find feasible candidates that have a minimum cost value. now in the meantime, we also predict target trajectories for each surrounding target. so each candidate ego trajectory is checked for collisions against these target trajectories.
and finally, we can determine a collision-free optimal trajectory. so we conduct the trajectory generation and motion prediction in the frenet space. now let's go to the next slide and see how some of these items map to our subsystem.
all right, here we see how that schematic maps to our subsystem. we see that these first two blocks transform the ego and mio to frenet coordinates. then we see the terminal state sampler, motion prediction, and motion planner as well. so let's go into some more detail on the terminal state sampler and the motion planner.
we'll start with the terminal state sampler. the terminal state sampler defines terminal states for trajectory generation, based on surrounding traffic conditions and map information. so the terminal state sampler reads ego and surrounding mios frenet states, along with map information, and finds a preferred lane. it generates terminal states for three different driving maneuver modes-- cruise control, lead car following, and lane change.
for example, here we have three different traffic situations. first, we identify which target is safe and which target is unsafe based on time-to-collision analysis. if the current ego lane is safe and the unsafe targets are detected in both left and right lane, then the preferred lane would be the current ego lane. in this case, the desired maneuver would be either cruise control or lead car following mode.
we would determine the terminal frenet states for each mode. if the current lane is unsafe and either the left or right lane is safe, the desired maneuver should be the lane change mode. so again, we define the terminal frenet states according to the direction of the lane change.
now let's take a look at the motion planner block. in this block, we evaluate cost values for all terminal states. the terminal states are sorted by cost and fed into the trajectorygeneratefrenet. this function generates multiple candidate ego trajectories. we remove some of the candidates through a feasibility check-- for example, an excessive curvature or yaw rate would give us reason to remove some trajectories.
now, we check each feasible candidate for collisions against predicted target trajectories. and finally, we can determine a collision-free optimal trajectory. so here's an example for finding an optimal trajectory.
in this driving situation, first we identify which target is safe and which target is unsafe. we predict the target trajectory and check a collision against it. the red colored ones show colliding trajectories. the white lines mean that the candidate trajectories have a high cost. and the light blue dashed lines indicate and infeasible trajectory due to an excessive curvature or yaw rate.
so the green line is what we're looking for. it represents a collision-free optimal trajectory. if the current lane becomes unsafe, the preferred lane is change to the next lane. so the right lane change becomes the optimal trajectory with minimum cost in this case.
now let's go back to the simulink model and show how the outputs of the motion planner feed into the next subsystem. all right, here we have the planner subsystem. i'll go back, and we see that we have two outputs. the first output refpointonpath, feeds into our lane change controller.
the second output is related to visualization. and we'll see this in the visualization subsystem later. so now, i'll pass it off to mihir, who will talk about the lane change controller.
thanks, pitambar. as pitambar showed, we have the collision-free optimal trajectory coming as an input from the lane change planner subsystem. now we need a lane change controller to follow this reference trajectory.
the input to the controller is a reference point on path. another input coming from the vehicle dynamic subsystems is the longitudinal velocity. the output from the controller feeds into the vehicle dynamics, which makes this a closed loop system.
now let's look inside the lane change controller subsystem. the path following controller block keeps the vehicle traveling within a marked lane of a highway while maintaining a user-set velocity. now let's see how it works.
the input from planner consists of several parameters. out of these parameters, we need reference velocity, reference curvature, relative yaw angle, and lateral offset deviation. we consider the trajectories
provided by the planner as virtual lanes. the virtual lane center subsystem creates a virtual lane from the path points.
the controller needs to know the lateral deviation and relative yaw angle in reference with the virtual lane. the preview curvature subsystem converts trajectory to curvature input. this is required because the ego vehicle needs to track the curvature while its longitudinal velocity is also changing. so the preview curvature block merges the curvature, curvature derivative, and the longitudinal velocity to convert the trajectory into curvature input required by the path following controller block.
now let's learn more about the path following controller block. path following for lane change first needs lateral control that keeps the ego vehicle traveling along the center line of its lane by adjusting the steering of the ego vehicle. individually, this task is also called lane keeping assist.
secondly, longitudinal control maintains a user-set velocity of the ego vehicle. you may also call it as cruise control. the path following control combines the lateral and length longitudinal control using adaptive model predictive control. you can generate the longitudinal acceleration and steering angle outputs using this out-of-the-box simulink block.
now you may think that, why can't i use other control methods such as a pid controller. the reason is during the pid controller for larger systems like these becomes challenging. mpc or model predictive control has many advantages over pid. some other reasons i would highlight here-- it can handle multiple input, multiple output, allowing the controller to respond to data from various sensors. and it can take into account the constraints from these sensors such as slowing down the vehicle if a corner or stop sign is detected in advance. this is also called a preview capability, which is really important in these kind of situations.
now let's see how the path following controller block follows a center line of a lane. when the ego vehicle moves away from the center lane, the lateral deviation and relative yaw angle changes. the lateral control keeps the ego car traveling along the center lane of the lanes on the road by adjusting the front steering angle of the ego car. the goal for lane keeping control is to drive both lateral deviation and relative yaw angle close to 0.
we saw how we get the previewed lane curvature earlier. now these three inputs complete the lateral control part of the path following controller block. the longitudinal control tracks of velocity set by the user and maintains a safe distance from the lead vehicle by adjusting the longitudinal acceleration of the illegal vehicle, from which it takes the longitudinal velocity as input from the vehicle dynamics block. that, we will learn about later. the goal here is to compute optimal control actions while satisfying safe distance, velocity, and acceleration constraints.
now i would like to highlight here if it was only one of the two either lateral or longitudinal control that we needed to do, we could just use a model predictive controller. but we want to autonomously steer a car whose lateral vehicle dynamics is changing with time due to varying longitudinal velocity. a traditional model predictive controller is not effective at handling the varying dynamics, as it uses a constant internal planned model. and that's why we used adaptive model predictive control.
now let's take a look inside the path following controller block. going back to our simulink model, we can click inside the path following controller block. and here, we see there are three tabs. the parameter tabs provides the bicycle model parameters. you can enable or disable distance keeping using the spacing control checkbox.
the controller tab includes actuator limits such as minimum and maximum steering angles and longitudinal acceleration. it also includes the embassy settings that allows you to tune the controllers performance. the last tab includes an interesting piece. here you can create your own subsystem of the controller and customize it according to your application. this type of customization and flexibility is what i love about these tools.
all right, so we talked about the lane change controller subsystem that included the path following controller block. i mentioned that we will talk about the vehicle dynamics block later. and now is the time. so i'll hand it over to pitambar to discuss about the vehicle dynamics block.
thanks, mihir. now let's talk about our next subsystem, which is vehicle dynamics. and the main block that we're going to focus on here is this one. this is the vehicle body 3 degrees of freedom block. it calculates the longitudinal, lateral, and yaw motion for a rigid, two-axle vehicle model.
so in this example, we're using a simple bicycle model which takes force inputs. the input values come from the steering angle and the acceleration, which undergo transforms to feed into this model. now, before i get to the outputs, i want to talk briefly about the vehicle dynamics blocks set.
the 3 degrees of freedom bicycle model that we used is a simple model that works well for scenarios where roll, pitch, and bounce aren't that important. but when you do care about those effects, we have other models in vehicle dynamics block set that can help you capture them with higher fidelity. so now let's jump into what else vehicle dynamics blocks set has to offer.
vehicle dynamics block set has in open and documented library of component and subsystem models. it has pre-built vehicle models that you can parameterized and customize, fast running models that are ready for hardware in the loop deployment, and in interface to unreal engine. so if you're interested in exploring more about vehicle dynamics and you have this toolbox, this is something to look into.
so now let's go back to our subsystem. i want to talk a little bit about the outputs. we have three of them-- the ego actor, the longitudinal velocity, and the lateral velocity. the ego actor contains information about many aspects of the ego vehicle. we see this pack ego block here, which contains information about position, velocity, yaw, yaw rate, and the ego actor id. all of this gets packaged into a struct called ego actor.
now let's go back to our test bench and see how these outputs feed into other models. we can see that the ego actor feeds into many of the subsystems in our test bench. the lateral velocity feeds into our metrics assessment. and the longitudinal velocity feeds into our metrics, as well as our lane change controller. so speaking of metrics, i'm now going to pass it back to mihir, who's going to talk about metrics and visualization
thanks, pitambar. now we have all the pieces in our test bench in place. our ego vehicle is able to follow and change lanes. but what happens when we don't monitor our speed while driving on a highway? i don't need to answer that, right?
with an autonomous vehicle, we need to monitor a lot of metrics that we do very naturally in manual driving. the metrics assessment block helps us monitor various metrics that we'll see in a bit. this subsystem takes the longitudinal velocity, lateral velocity, and ego actor dynamics as inputs from the vehicle dynamics subsystem. and it takes the lane boundaries and target actors as inputs from the scenario and environment subsystem.
it then generates a dashboard that shows all these metrics while the simulation is running. but first, let's take a look inside the subsystem and what different metrics are recollecting. so we have to detect
collusion and detect lead vehicle blocks here. the detect collision block detect the collision of the vehicle with other vehicles and halts the simulation if a collision is detected. the detect lead vehicle block computes the headway between the ego and lead vehicles, which is used for computing the time gap as well.
the time gap is calculated using the distance to the lead vehicle or headway, and the longitudinal velocity of the ego vehicle. the longitudinal jerk is calculated using the longitudinal velocity. the lateral jerk value is calculated using the lateral velocity.
when we run the simulation, we can see the lane change visualization and the metrics dashboard side by side. notice how the ego acceleration readings on the dashboard are varying when the lane change maneuver is executed. now you must be thinking, how do we generate this kind of visualization that we have been seeing in this presentation. and that brings me to the last part of this test bench. that is visualization.
now unlike most other subsystems in this test bench, the visualization block here is a matlab function. this block creates a matlab plot using the inputs from the scenario and environment, as well as the planner subsystems. the matlab source code gives you the flexibility of changing any visualization parameters. the high level block of this matlab function gives you the control of quickly changing the view settings.
you can enable or disable the capsule objects or the trajectories. and then you can see just the lane change operation without any other highlighted trajectories or objects. next, we will see how we can use this test bench to analyze and test the lane change maneuver system.
for the analysis and test purposes, we created 15 different test scenarios that you can edit programmatically. the example scenarios include straight roads, curved roads, and imported from the hd map. we can select the desired test scenarios using the setup function. let me show you an example of simulation with scenario number 14 from that list.
we added a couple of dashboard blocks to visualize the planner behavior during the simulation. we can monitor the current maneuver mode and preferred lane. the test bench model automatically determines the preferred lane depending on the surrounding traffic conditions. the driver can override the preferred lane decision at any time.
the current driving maneuver mode is cruise control in this video. when a slow-moving lead car is detected, the preferred lane is switched from the second to third lane as we can see here. and maneuver mode is change from cruise control to lane change mode. now the driver overrides the current preferred lane and changes to the fourth lane. then the vehicle moves to the fault line accordingly.
another slow moving lead car is detected and it changes the lane back to third. now, a disabled car is detected in the current ego lane. and it changes the lane to avoid a collision. however, the distance to the orange car is too close, and it changes the lane again to the first lane. so we can see it's quite a complicated situation. however, the planner and controller were able to handle these situations.
the following example shows a closed loop system simulation from another scenario. during the simulation, you can see the curvature for the reference trajectory. the lateral deviation and relative yaw angle showed the trajectory following performance. the steering angle is the control action to follow the reference trajectory. finally, you will see the lateral and longitudinal jerk as well. the assessment block continuously monitor these jerks if it exceeds the limits.
you'll notice that during the lane change, the reference curvature changes, and the lateral jerk increases. now we have seen various simulation scenarios. and what if we like to deploy this code on a target hardware? so once we feel confident after testing these algorithms and simulation, we can deploy them on target hardware or test them in software in the loop using the generated c code.
this shipping example that comes with our product walks you through the co-generation process for the lane change planner. you can configure the lane change planner model to generate c code for real-time implementation of the model. this snippet shows a list of model configuration parameters. you can apply common optimizations on the generated code, and also create a report to explore the generated code.
after generating c code for the highway lane change planner, you can access the code functionality using software in the loop simulation. it provides early insight to use software in the loop. and you can know the behavior of a deployed application. you can compare the outputs from normal simulation mode and software-in-the-loop simulation mode. you can plot and verify if the differences between these runs are within the tolerance limits.
during the software-in-the-loop simulation, you can log the execution time metrics for the generated code. this is a code execution profiling report we are seeing here that provides metrics based on data collected from a software-in-the-loop execution. you can see a summary with profile sections of the code and cpu utilization. you can plot the execution time taken for the step function of highway change planner model. and we do this by using a helper function provided in the example.
this plot can be an early indicator of the performance of the generated code. for accurate execution time measurements, you can profile degenerated code when it is integrated into the external environment. now you can also generate c code for the lane change controller. and similar to the planner example, there is a dedicated shipping example to show how you can generate the code and report as this functionality and execution time for the controller. now i'll hand it over to pitambar to summarize what we have learned today.
so let's go ahead and do a quick recap of the entire test bench. we talked about the scenario and environment subsystem. we talked about the lane change planner, the lane change controller. we went over the vehicle dynamics, the metric assessment, and finally the visualization. now i want to bring this full circle to some of the slides you saw in the beginning.
so we talked about how there's several industry trends that are driving mathworks investment in automated driving systems. there's the need for virtual worlds. so the industry continues to do more with simulation in order to reduce vehicle testing, as well as explore scenarios that might be difficult or unsafe to reproduce in the real world. so we saw this in our model with this scenario an environment subsystem, as well as the vehicle dynamic subsystem.
the second thing is the need for multidisciplinary skills. developing an automated driving application requires a variety of skills, from planning and controls to perception disciplines like detection, localization, tracking, and fusion. in our particular example, we focused on the planning decisions and controls. and the third trend driving investments is the need for software. so here we saw aspects of designing, testing, and deploying our highway lane change system.
so to wrap up, let's go over some of the key takeaways. first of all, we closely followed this example from the dock called highway lane change. so if this is something you want to try out, you'll need automated driving tool box, navigation tool box, and model predictive control toolbox.
and in this example, we covered a couple of things. first, we talked about developing virtual worlds for simulation. we did this with the scenario and environment subsystem as well as the vehicle dynamics subsystem. then we talked about designing a motion planner and a controller. and mihir and i went into quite a bit of detail on how this was done for this example.
and finally, we ran simulation tests and deployed code. so before we end this session, i'll leave you with a couple of additional resources. on the left here, we have the automated driving solutions page. this talks about how you can use mathworks tools for various automated driving application.
in the middle, we have a motion planning e-book. and finally, on the right hand side, we have a model predictive control video series. so if these are resources that you're interested in, you can scan these qr codes, and it'll take you to that page. and that's how we'll conclude this video. so i'll leave this page up for a couple of seconds. but thanks for tuning in.
featured product
automated driving toolbox
up next:
related videos:
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 mathworks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- (español)
- (english)
- (english)
欧洲
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
亚太
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)