From cfd3a65385257d611e6ba787f7b032848883bf9b Mon Sep 17 00:00:00 2001 From: Andrea Palazzi Date: Sat, 26 Aug 2017 12:23:45 +0200 Subject: [PATCH] Update model_documentation.md --- project_11_path_planning/model_documentation.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/project_11_path_planning/model_documentation.md b/project_11_path_planning/model_documentation.md index 6901b3f..92f228c 100644 --- a/project_11_path_planning/model_documentation.md +++ b/project_11_path_planning/model_documentation.md @@ -45,3 +45,11 @@ Here's a bullet list of rubric points along with an explanation of how constrain Notice that these waypoints are created [using the `lane` variable](https://github.com/ndrplz/self-driving-car/blob/50adb2c54ac2e0d5c0878f4c3c73894275ab20c3/project_11_path_planning/src/main.cpp#L215-L218) to make sure that the `d` coordinate is just in the middle of the lane the car is currently on. In case a lane change is needed, the `lane` variable will already contain the coordinate of the future lane (see below). - **The car is able to change lanes** + + When it makes sense to do, the vehicle will try to change lane. This will happens if a slower moving car obstructs traffic lane. A simple **FSM** (Finite State Machine) able to deal with safe lane changing is implemented at [these lines](https://github.com/ndrplz/self-driving-car/blob/611428a30cc28b958dd38a2b3a837897b2a0c0b7/project_11_path_planning/src/main.cpp#L119-L182) of `main.cpp`. + + Basically, our car uses sensor fusion data to collect information about nearby vehicles. Vehicles which travel on our same lane are of [particular interest](https://github.com/ndrplz/self-driving-car/blob/611428a30cc28b958dd38a2b3a837897b2a0c0b7/project_11_path_planning/src/main.cpp#L133-L139), in particular when they get dangerously close. In this latter case, the vehicle attempts a lane change maneuver. + + The car has now entered the state `prepare_for_lane_change`. However, in order to safely change lane, the car has to check if at least another lane is sufficiently clear of traffic for allowing a safe lane change. This controls are implemented [here](https://github.com/ndrplz/self-driving-car/blob/611428a30cc28b958dd38a2b3a837897b2a0c0b7/project_11_path_planning/src/main.cpp#L143-L170). If at least one lane free is found, the flag [`ready_for_lane_change` is set](https://github.com/ndrplz/self-driving-car/blob/611428a30cc28b958dd38a2b3a837897b2a0c0b7/project_11_path_planning/src/main.cpp#L166-L167) to signal that a safe lane changing is now possible. + + The actual lane change happen by changing the `lane` variable to the new value. This takes place [here](https://github.com/ndrplz/self-driving-car/blob/611428a30cc28b958dd38a2b3a837897b2a0c0b7/project_11_path_planning/src/main.cpp#L172-L176). As we saw before, the `lane` variable is used for computing the next waypoints. This implies that the future trajectory will drive the car in the new lane.