Skip to content

Basic behavior and motion planning tested in Carla. State machine-based behavior planning, motion planning using cubic spirals, velocity profile generation and cost-function based trajectory selection with static collision checking

License

Notifications You must be signed in to change notification settings

adamdivak/udacity_sd_planning

 
 

Repository files navigation

Project: Basic behavior and Motion planning using Carla

Udacity - Self-Driving Car NanoDegree

Overview

Given an existing skeleton of a planner code, fill in the missing parts to 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” 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.

Use the Carla simulator environment to verify the solution.

Solution

Finite state machine-based behavior planning for a minimal set of longitudinal cases: follow lane, decelerate to stop and stopped (at intersection).

Motion planning using cubic spirals. Multiple possible spirals are generated at different offsets from the lane center in order to ensure that at least some of them are feasible (both given the constraints and static collision checking).

Static object collision checking using multiple circles to cover the ego vehicle and obstacles.

Velocity generation for each spiral, taking into account stop positions at intersections and acceleration limits. Velocity generation uses a combination of linear velocity profiles (constant acceleration).

Selection of the best path using cost functions. The costs include collision checking, proximity to goal and proximity to lane center.

Unit tests were added to all parts of the code where I made changes.

In order to see all changes I made compare it to the last commit of the framework. All NOTE comments are by me (but TODO comments were already in the code).

Sample screen capture from project

(Video running at 4x speed of the simulation, though there is no technical reason why the simulation could not be made faster.)

Open higher quality video

About

Basic behavior and motion planning tested in Carla. State machine-based behavior planning, motion planning using cubic spirals, velocity profile generation and cost-function based trajectory selection with static collision checking

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.5%
  • C 0.8%
  • CMake 0.2%
  • Fortran 0.2%
  • Cuda 0.1%
  • CSS 0.1%
  • Other 0.1%