Code Monkey home page Code Monkey logo

model_predictive_control's Introduction

CarND-Controls-MPC

Self-Driving Car Engineer Nanodegree Program


Model Description

###Kinetic Model: In this project, the state of vehicle is described by a simple kenetic bicycle model. The state variables are

  • x: x coordinate
  • y: y coordinate
  • $\psi$: direction angle of the vehicle
  • v: linear velocity of the vehicle

The control variables are

  • a: linear accelaration, usually related to throttle
  • $ \delta$: steering angle.

Here's the state transfer equation of the vehicle in our model: alt text

Trajectory planning

We will receive the reference waypoints from the simulator. Our goal is to find the optimal sequence of control signals [$a_1$,$\psi_1$,$a_2$,$\psi_2$ ...$a_n$,$\psi_n$] so that the trajectory of our vehicle is close to the reference waypoints. In short, at each time step, our controller will:

  • receive reference trajectory
  • find the optimal steer and accelaration to miminize cost
  • actuate steer and accelaration for the first step

alt text

Results

Here's the result of running the controller on the simulator. We can see the centrifugal cost forces the car to slow down when making turns. This enables car to drive at peak velocity of 85mph while stay in the center of the lane.

Dependencies

Basic Build Instructions

  1. Clone this repo.
  2. Make a build directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run it: ./mpc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.