Skip to content

Udacity Self driving car nano degree project 11: Path Planning

License

Notifications You must be signed in to change notification settings

akrost/CarND-PathPlanning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CarND-Path-Planning-Project

Car holding lane

Simulator.

The Simulator can be downloaded here.

To run the simulator on Mac/Linux, first make the binary file executable with the following command:

sudo chmod u+x {simulator_file_name}

Basic Build Instructions

  1. Clone this repo.
  2. Make a build directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run it: ./path_planning.

Dependencies

Components

DriveController

The DriveController (DC) is the main component of the path planner. It creates a trajectory based on the current environment state.

When the class is initialized, the Map class and the Car class are stored in the DC:

Map highway_map = Map();
Car car = Car();
DriveController drive_controller = DriveController(&car, &highway_map);

The sensor fusion data (positions of the cars surrounding the ego car) has to be updated every cycle:

drive_controller.update_environment(sensor_fusion);

The same applies for the current car status:

drive_controller.car->setX(j[1]["x"]);
drive_controller.car->setY(j[1]["y"]);
drive_controller.car->setS(j[1]["s"]);
drive_controller.car->setD(j[1]["d"]);
drive_controller.car->setYaw(j[1]["yaw"]);
drive_controller.car->setSpeed(j[1]["speed"]);

After the current environment and the car status are updated, the DC can generate a trajectory. To do that, the plan_path() function is called.

vector<vector<double>> next_vals = drive_controller.plan_path(previous_path_x.size());

It handles acceleration, checks if lanes are safe and performs lane changes.

Then, the trajectory is generated in the vector<vector<double>> DriveController::create_trajectory(int prev_size) function. It generates 5 anchor points (in car centered coordinate system) and then creates a spline using the anchor points. Using the spline, a set number of trajectory points can be generated. Finally, the points have to be transformed back into a global coordinate system. The spline is used to smooth the trajectory in order to stay in the jerk boundaries.

Car

The Car class is a data class that stores the current position, speed and lane of the ego car.

Map

The Map class is a data class that stores the map attributes (x, y, s, dx, dy).

Car changing lanes

About

Udacity Self driving car nano degree project 11: Path Planning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages