yazuyang / CarND_T2_P2_Highway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CarND-Path-Planning-Project Write Up

This README.md is a write up for a project of Udcity Self-Driving Car Engineer Nanodegree "Path Planning"

This repository is consist of following files.

  • CMakeLists.txt
    • To complie with CMake, this file is used.
  • data/highway_map.csv
    • This csvfile includes map data.
  • src/
    • source code files.

Criteria(Compilation)

  • The code compiles correctly.
    • I confirmed that it is able to compile correctly with CMakeLists.txt contained in this repository.

Criteria(Valid Trajectories)

The program in this repository has been tested in a simulator for 30 minutes and confirmed to meet the following criteria.

  • The car is able to drive at least 4.32 miles without incident.
  • Max Acceleration and Jerk are not Exceeded.
  • Car does not have collisions.
  • The car stays in its lane, except for the time between changing lanes.
  • The car is able to change lanes

Reflection(How to generate paths)

This program is consist of the following 4 functions. All functions are coded in path_plan.cpp.

  • sense
    • This function uses sensor information to obtain the following information.
      • Is there a car ahead of the vehicle?
      • Can we change lanes for each lane?
      • Vehicle speed ahead of each lane.
  • select_lane
    • In this function, the driving lane is determined according to the following principles.
      • If there is no car ahead of the vehicle, it will stay in the current lane. In this case, the cost is the lowest because the speed is not constrained to other vehicles and there is no need to change lanes.
      • If there is a car ahead of the vehicle and lane change is not available, it will stay in the current lane and set a maximum speed to avoid collisions. In this case, the cost is not enough low. It is necessary to implement a method such as moving to a place where it is easy to change lanes, in order to make a better action decision.
      • If there is a car ahead of the vehicle and lane change is available, the highest speed lane is choosed as the driving lane. The speed of the lane is determined by the speed of the vehicle ahead. When the car ahead is far enough, the speed of the lane will be maximum. In this case, the lowest cost lane is chosen by calculating speed of lane.
  • get_data_for_spline
    • This function generates five waypoints to generate the trajectory to the selected lane. In order to generate a smooth trajectory, the yaw of the vehicle is used and the distance between waypoints is set to be wide enough.
  • make_path
    • In this function, first, a trajectory is generated by a spline function based on the waypoint obtained by the function "get_data_for_spline". And every cycle of 0.02 seconds generates a point that the vehicle should follow.

About

License:MIT License


Languages

Language:C++ 83.2%Language:Fortran 11.4%Language:C 2.0%Language:CMake 1.8%Language:Cuda 1.1%Language:Shell 0.2%Language:Python 0.1%Language:JavaScript 0.1%Language:Makefile 0.1%Language:CSS 0.0%