In this project, you will implement two of the main components of a traditional hierarchical planner: The Behavior Planner and the Motion Planner. Both will work in unison to be able to:
- Avoid static objects (cars, bicycles and trucks) parked on the side of the road (but still invading the lane). The vehicle must avoid crashing with these vehicles by executing either a “nudge” or a “lane change” maneuver.
- Handle any type of intersection (3-way, 4-way intersections and roundabouts) by STOPPING in all of them (by default).
- Track the centerline on the traveling lane.
- Behavioral planning logic using Finite State Machines - FSM.
- Static objects collision checking.
- Path and trajectory generation using cubic spirals.
- Best trajectory selection though a cost function evaluation. This cost function will mainly perform a collision check and a proximity check to bring cost higher as we get closer or collide with objects but maintaining a bias to stay closer to the lane center line.
- behavior_planner_FSM.cpp
- cost_functions.cpp
- motion_planner.cpp
- velocity_profile_generator.cpp
Follow the series of the commands in the workspace to launch the CARLA simulator:
1. su - student
// Will say permission denied, ignore and continue
2. cd /opt/carla-simulator/
3. SDL_VIDEODRIVER=offscreen ./CarlaUE4.sh -opengl
4. git clone https://github.com/udacity/nd013-c5-planning-starter.git
5. cd nd013-c5-planning-starter/project
6. ./install-ubuntu.sh
7. cd starter_files/
8. cmake .
9. make
10. cd nd013-c5-planning-starter/project
11. ./run_main.sh
// This will silently fail
12. ctrl + C to stop
13. ./run_main.sh again
14. Go to desktop mode to see CARLA
// If error bind is already in use, or address already being used
ps -aux | grep carla
kill id
I tried the simulation with several configurations, this simulation ran using:
- P_NUM_PATHS = 5
- P_NUM_POINTS_IN_SPIRAL = 30
FIGURE 1: Starting the simulation.