• Stars
    star
    306
  • Rank 136,456 (Top 3 %)
  • Language
    C++
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Create a path planner that is able to navigate a car safely around a virtual highway

CarND-Path-Planning-Project

Self-Driving Car Engineer Nanodegree Program

Simulator.

You can download the Term3 Simulator which contains the Path Planning Project from the [releases tab (https://github.com/udacity/self-driving-car-sim/releases/tag/T3_v1.2).

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

sudo chmod u+x {simulator_file_name}

Goals

In this project your goal is to safely navigate around a virtual highway with other traffic that is driving +-10 MPH of the 50 MPH speed limit. You will be provided the car's localization and sensor fusion data, there is also a sparse map list of waypoints around the highway. The car should try to go as close as possible to the 50 MPH speed limit, which means passing slower traffic when possible, note that other cars will try to change lanes too. The car should avoid hitting other cars at all cost as well as driving inside of the marked road lanes at all times, unless going from one lane to another. The car should be able to make one complete loop around the 6946m highway. Since the car is trying to go 50 MPH, it should take a little over 5 minutes to complete 1 loop. Also the car should not experience total acceleration over 10 m/s^2 and jerk that is greater than 10 m/s^3.

The map of the highway is in data/highway_map.txt

Each waypoint in the list contains [x,y,s,dx,dy] values. x and y are the waypoint's map coordinate position, the s value is the distance along the road to get to that waypoint in meters, the dx and dy values define the unit normal vector pointing outward of the highway loop.

The highway's waypoints loop around so the frenet s value, distance along the road, goes from 0 to 6945.554.

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.

Here is the data provided from the Simulator to the C++ Program

Main car's localization Data (No Noise)

["x"] The car's x position in map coordinates

["y"] The car's y position in map coordinates

["s"] The car's s position in frenet coordinates

["d"] The car's d position in frenet coordinates

["yaw"] The car's yaw angle in the map

["speed"] The car's speed in MPH

Previous path data given to the Planner

//Note: Return the previous list but with processed points removed, can be a nice tool to show how far along the path has processed since last time.

["previous_path_x"] The previous list of x points previously given to the simulator

["previous_path_y"] The previous list of y points previously given to the simulator

Previous path's end s and d values

["end_path_s"] The previous list's last point's frenet s value

["end_path_d"] The previous list's last point's frenet d value

Sensor Fusion Data, a list of all other car's attributes on the same side of the road. (No Noise)

["sensor_fusion"] A 2d vector of cars and then that car's [car's unique ID, car's x position in map coordinates, car's y position in map coordinates, car's x velocity in m/s, car's y velocity in m/s, car's s position in frenet coordinates, car's d position in frenet coordinates.

Details

  1. The car uses a perfect controller and will visit every (x,y) point it recieves in the list every .02 seconds. The units for the (x,y) points are in meters and the spacing of the points determines the speed of the car. The vector going from a point to the next point in the list dictates the angle of the car. Acceleration both in the tangential and normal directions is measured along with the jerk, the rate of change of total Acceleration. The (x,y) point paths that the planner recieves should not have a total acceleration that goes over 10 m/s^2, also the jerk should not go over 50 m/s^3. (NOTE: As this is BETA, these requirements might change. Also currently jerk is over a .02 second interval, it would probably be better to average total acceleration over 1 second and measure jerk from that.

  2. There will be some latency between the simulator running and the path planner returning a path, with optimized code usually its not very long maybe just 1-3 time steps. During this delay the simulator will continue using points that it was last given, because of this its a good idea to store the last points you have used so you can have a smooth transition. previous_path_x, and previous_path_y can be helpful for this transition since they show the last points given to the simulator controller with the processed points already removed. You would either return a path that extends this previous path or make sure to create a new path that has a smooth transition with this last path.

Tips

A really helpful resource for doing this project and creating smooth trajectories was using http://kluge.in-chemnitz.de/opensource/spline/, the spline function is in a single hearder file is really easy to use.


Dependencies

Editor Settings

We've purposefully kept editor configuration files out of this repo in order to keep it as simple and environment agnostic as possible. However, we recommend using the following settings:

  • indent using spaces
  • set tab width to 2 spaces (keeps the matrices in source code aligned)

Code Style

Please (do your best to) stick to Google's C++ style guide.

Project Instructions and Rubric

Note: regardless of the changes you make, your project must be buildable using cmake and make!

Call for IDE Profiles Pull Requests

Help your fellow students!

We decided to create Makefiles with cmake to keep this project as platform agnostic as possible. Similarly, we omitted IDE profiles in order to ensure that students don't feel pressured to use one IDE or another.

However! I'd love to help people get up and running with their IDEs of choice. If you've created a profile for an IDE that you think other students would appreciate, we'd love to have you add the requisite profile files and instructions to ide_profiles/. For example if you wanted to add a VS Code profile, you'd add:

  • /ide_profiles/vscode/.vscode
  • /ide_profiles/vscode/README.md

The README should explain what the profile does, how to take advantage of it, and how to install it.

Frankly, I've never been involved in a project with multiple IDE profiles before. I believe the best way to handle this would be to keep them out of the repo root to avoid clutter. My expectation is that most profiles will include instructions to copy files to a new location to get picked up by the IDE, but that's just a guess.

One last note here: regardless of the IDE used, every submitted project must still be compilable with cmake and make./

How to write a README

A well written README file can enhance your project and portfolio. Develop your abilities to create professional README files by completing this free course.

More Repositories

1

self-driving-car

The Udacity open source self-driving car project
Jupyter Notebook
6,072
star
2

deep-learning-v2-pytorch

Projects and exercises for the latest Deep Learning ND program https://www.udacity.com/course/deep-learning-nanodegree--nd101
Jupyter Notebook
4,963
star
3

deep-reinforcement-learning

Repo for the Deep Reinforcement Learning Nanodegree program
Jupyter Notebook
4,528
star
4

deep-learning

Repo for the Deep Learning Nanodegree Foundations program.
Jupyter Notebook
3,940
star
5

machine-learning

Content for Udacity's Machine Learning curriculum
Jupyter Notebook
3,825
star
6

self-driving-car-sim

A self-driving car simulator built with Unity
C#
3,810
star
7

Sunshine-Version-2

The official repository for Developing Android Apps
Java
2,886
star
8

ud851-Exercises

Java
2,048
star
9

ud851-Sunshine

Java
2,014
star
10

ud120-projects

Starter project code for students taking Udacity ud120
DIGITAL Command Language
1,586
star
11

cs344

Introduction to Parallel Programming class code
Cuda
1,227
star
12

frontend-nanodegree-resume

This repository is used for one of the projects in Udacity's Front-End Web Developer Nanodegree program. Learn how to become a Front-End Developer today with line-by-line code reviewed projects and get a job with career services!
JavaScript
1,183
star
13

course-collaboration-travel-plans

CSS
1,162
star
14

DSND_Term2

Contains files related to content and project of DSND Term 2
Jupyter Notebook
1,095
star
15

CarND-LaneLines-P1

Lane Finding Project for Self-Driving Car ND
Jupyter Notebook
779
star
16

CVND_Exercises

Exercise notebooks for CVND.
Jupyter Notebook
744
star
17

ud777-writing-readmes

Supplemental material for Udacity's "Writing READMEs" course
698
star
18

ud839_Miwok

Java
696
star
19

ud867

Course code repository for Gradle for Android and Java
Java
664
star
20

artificial-intelligence-for-trading

Content for Udacity's AI in Trading NanoDegree.
Jupyter Notebook
646
star
21

ud862-samples

Java
585
star
22

AIPND

Code and associated files for the AI Programming with Python Nanodegree Program
Jupyter Notebook
541
star
23

ud891

Google and Udacity course on Accessibility.
JavaScript
505
star
24

create-your-own-adventure

This is example repo illustrates the concept of a "Pull Request", created as part of the course How to Use Git and GitHub
Shell
503
star
25

CarND-Term1-Starter-Kit

Python
497
star
26

Just-Java

The official repository for the second Android Development for Beginners App : Just Java
Java
497
star
27

sagemaker-deployment

Code and associated files for the deploying ML models within AWS SageMaker
Jupyter Notebook
468
star
28

CarND-Advanced-Lane-Lines

Shell
454
star
29

private-ai

Repo for Udacity's Secure & Private AI course
Jupyter Notebook
449
star
30

artificial-intelligence

Python
441
star
31

ud839_CustomAdapter_Example

Java
439
star
32

Advanced_Android_Development

Repo for the Advanced Android App Development course
Java
429
star
33

CarND-Behavioral-Cloning-P3

Starting files for the Udacity CarND Behavioral Cloning Project
Python
425
star
34

cn-deep-learning

Jupyter Notebook
421
star
35

Full-Stack-Foundations

Solution Code to Full Stack Foundations (ud088)
Python
400
star
36

fullstack-nanodegree-vm

Python
372
star
37

CarND-Traffic-Sign-Classifier-Project

Classify Traffic Signs.
Jupyter Notebook
362
star
38

DL_PyTorch

Code for the Deep Learning with PyTorch lesson
Jupyter Notebook
358
star
39

ML_SageMaker_Studies

Case studies, examples, and exercises for learning to deploy ML models using AWS SageMaker.
Jupyter Notebook
355
star
40

ud843-QuakeReport

Discover earthquake activity around the world.
Java
350
star
41

frontend-nanodegree-mobile-portfolio

JavaScript
344
star
42

ud615

Course code for Scalable Microservices with Kubernetes
Go
338
star
43

cs291

Interactive 3D Graphics class code
JavaScript
319
star
44

CarND-Extended-Kalman-Filter-Project

Self-Driving Car Nanodegree Program Starter Code for the Extended Kalman Filter Project
C++
315
star
45

SFND_Lidar_Obstacle_Detection

C++
307
star
46

and-nd-firebase

Course code repository for Firebase in a Weekend by Google: Android
Java
299
star
47

robot_pose_ekf

The robot_pose_ekf ROS package applies sensor fusion on the robot IMU and odometry values to estimate its 3D pose.
C++
293
star
48

frontend-nanodegree-arcade-game

JavaScript
284
star
49

fend

General Front End Nanodegree Content Resources
CSS
276
star
50

FSND

Public repository for the Full-Stack Nanodegree program.
Python
272
star
51

devops-intro-project

Project files for Intro to DevOps class
Shell
269
star
52

rl-cheatsheet

RL Notation and Pseudocode for Udacity's MLND program
TeX
269
star
53

Court-Counter

The official repository for the third Android Development for Beginners App : CourtCounter
Java
264
star
54

Android_Me

App that lets you style your own Android! This uses Fragments to create a flexible and responsive UI.
Java
260
star
55

APIs

Code Repo for API course in Fullstack ND
Python
257
star
56

CarND-Vehicle-Detection

Vehicle Detection Project
Shell
252
star
57

reactnd-project-myreads-starter

Starter Code for the React MyReads Project
JavaScript
251
star
58

CarND-MPC-Project

CarND Term 2 Model Predictive Control (MPC) Project
C++
251
star
59

nd064_course_1

Python
248
star
60

DSND_Term1

Contains files related to content and project of DSND
Jupyter Notebook
247
star
61

ud845-Pets

Java
243
star
62

data-analyst

Content for Udacity's Data Analyst curriculum
HTML
240
star
63

AIND-NLP

Coding exercises for the Natural Language Processing concentration, part of Udacity's AIND program.
Jupyter Notebook
239
star
64

P1_Facial_Keypoints

First project for CVND: facial keypoint detection.
Jupyter Notebook
220
star
65

frontend-nanodegree-styleguide

Official FEND style guides
HTML
220
star
66

dermatologist-ai

Python
208
star
67

NLP-Exercises

Jupyter Notebook
198
star
68

nd1309-work-code

Include for each Part in the ND Program the applications code.
JavaScript
193
star
69

CarND-Camera-Calibration

Images and notebook for camera calibration
Jupyter Notebook
192
star
70

frontend-nanodegree-styleguide-zh

优达学城(Udacity)前端样式指南
HTML
192
star
71

nd9991-c2-Infrastructure-as-Code-v1

Repository for starter code and supporting material
Shell
191
star
72

andfun-kotlin-android-trivia

Kotlin
189
star
73

CarND-Capstone

CMake
188
star
74

ud864

Public repository for code examples used in Udacity's Google Maps APIs course (https://www.udacity.com/course/google-maps-apis--ud864).
HTML
188
star
75

CarND-Semantic-Segmentation

Python
186
star
76

dog-project

Jupyter Notebook
182
star
77

DevOps_Microservices

Supporting material and projects for a course on Cloud DevOps: Microservices.
Jupyter Notebook
181
star
78

ud811

Course materials for Udacity's Intro to Progressive Web Apps course at https://www.udacity.com/course/intro-to-progressive-web-apps--ud811
JavaScript
178
star
79

ShoppingListPlusPlus

ShoppingListPlusPlus is the companion Android app for the Udacity course Firebase Essentials : Build a Collaborative Shopping List App. https://www.udacity.com/course/firebase-essentials-for-android--ud009
Java
176
star
80

CppND-Route-Planning-Project

C++
173
star
81

reactnd-contacts-complete

Code-along project for the Contacts app
JavaScript
171
star
82

ud405

Code supporting the free Udacity class 2D Game Development with LibGDX.
Java
171
star
83

course-git-blog-project

Sample repo of a blog for the Git course
HTML
170
star
84

ud859

Course code for Building Scalable Apps with Google App Engine class
Java
170
star
85

ios-nd-networking

Resources for Udacity's iOS Networking with Swift course.
Swift
168
star
86

intro-to-ml-tensorflow

Projects and exercises for the Udacity Intro to Machine Learning with TensorFlow course
Jupyter Notebook
159
star
87

course-JS-and-the-DOM

JavaScript
158
star
88

CarND-Mercedes-SF-Utilities

Tools for Sensor Fusion processing.
Jupyter Notebook
158
star
89

AIND-Sudoku

Python
156
star
90

didi-competition

Resources for the Udacity/Didi $100k competition
Python
153
star
91

exoplanet-explorer

Learn more about Exoplanets! (built for Promises course)
HTML
146
star
92

ud989-cat-clicker-premium-vanilla

ud989-cat-clicker-premium-vanilla
JavaScript
146
star
93

ud989-retain

JavaScript
146
star
94

CVND---Image-Captioning-Project

Jupyter Notebook
145
star
95

JDND

Public repository for the Java Developer Nanodegree program.
Java
144
star
96

nd9991-c2-Infrastructure-as-Code-v1-Exercises_Solution

This repository contains the solution to the exercises given in the last concept of each Lesson 1 to Lesson 5.
142
star
97

nd027-c3-data-lakes-with-spark

Python
142
star
98

AdvancedAndroid_Emojify

Java
141
star
99

CppND-Capstone-Snake-Game

A 2D Snake game using C++ and SDL
C++
139
star
100

cloudflare-typescript-workers

Types and mocks for building a tested Typescript Cloudflare Worker, generates three NPM packages
TypeScript
139
star