Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Highway Driving

This project is to drive the vehicle in a simulated road without colliding with other vehicles while riding
with an acceleration without exceeding 10m.sec^2 and lateral jerk less than 10m/sec^3. Also, the
maximum speed of vehicle is limited to 50 MPH. The car sensor fusion and localization data is provided.
The car must avoid collision with slower vehicle in front either by changing the lane or slowing down.
Furthermore, the car must always run inside the road lanes unless while doing a lane change. The main
subsystems for highway driving includes prediction, behavior planning and trajectory generation.

Prediction
The prediction module predicts what actions other objects might take in the future. In our case we
assume only 3 lanes of 4 meters width and we check for vehicles ahead of us. We check for the
situations such as car ahead is too close, car on left is too close and car on right is too close.

Behavior Planning
Behavior planning decides how a vehicle must behave at each instances based on various occurrences.
In our project behavior planning gets input from route and predictions from previous step on how other
vehicles will move in the future. Here we are taking only lane change (right or left) or reduce speed
actions based on the situations discussed in prediction section.
Trajectory Generation
Trajectory Generation is the most complex area of this project. Based on the behavior plan from the
previous step, this step will plan for the best trajectory for the ego vehicle. The steps followed in this
section is as follows:

Define the reference x,y and yaw points

Check previous path size

If empty use car state to Generate 2 points along tangent of car based on angle of the car

If points available add 2 more points to it and update reference points

Now, add 3 future points after converting the car position from frenet coordinates to global coordinates.

For trajectory generation, we are using spline instead of polynomial method.

Then we add all previous points to next_x_vals and next_y_vals as it going to be the final control values
pass it to the simulator and it will helps to get a smooth transition to the new points that we calculate
later.

Now, find all spline points till the end of horizon (30 meters). The spacing of the spline points in this
horizon affects the speed of the vehicle.

The horizon y points (50 points) can be calculated from x points.

next_x_vals and next_y_vals now have all 50 points which consist of 3 future points and 47 previous
points.

You might also like