Giter Site home page Giter Site logo

bdschrisk / carnd-mpc-project-p5 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 2.47 MB

Model Predictive Controller for use in waypoint navigation to drive a vehicle

CMake 1.84% Shell 0.18% C++ 83.12% C 2.03% Cuda 1.14% Fortran 11.50% Python 0.08% JavaScript 0.07% CSS 0.05%

carnd-mpc-project-p5's Introduction

CarND-Controls-MPC

Self-Driving Car Engineer Nanodegree Program


Overview

This project uses a Model-Predictive-Controller to drive a vehicle around a track using waypoint navigation. The MPC model uses inference over a discrete number of timesteps to accurately (and smoothly) drive the vehicle around the track. To account for latency in the solvers' computation time, the current state is forward projected using a global kinematic motion model to update the state prior to differentiation.

Optimisation

The model is optimised using automatic-differentiation (IpOpt library) using the following cost function:

  • Interpolation of states (i.e. state[t+1] - state[t])
  • Actuator loss (acceleration and throttle)
  • Reference state loss (cross-track, orientation and velocity errors)

The number of discrete timesteps used in optimisation is 2N + 1, which in this case is 11. This accounts for the forward projection of the initial state and the number of datapoints available at each prediction step.

Dependencies

  • cmake >= 3.5
  • All OSes: click here for installation instructions
  • make >= 4.1
  • gcc/g++ >= 5.4
  • uWebSockets == 0.14, but the master branch will probably work just fine
    • Follow the instructions in the uWebSockets README to get setup for your platform. You can download the zip of the appropriate version from the releases page. Here's a link to the v0.14 zip.
    • If you have MacOS and have Homebrew installed you can just run the ./install-mac.sh script to install this.
  • Ipopt
    • Mac: brew install ipopt --with-openblas
    • Linux
      • You will need a version of Ipopt 3.12.1 or higher. The version available through apt-get is 3.11.x. If you can get that version to work great but if not there's a script install_ipopt.sh that will install Ipopt. You just need to download the source from the Ipopt releases page or the Github releases page.
      • Then call install_ipopt.sh with the source directory as the first argument, ex: bash install_ipopt.sh Ipopt-3.12.1.
    • Windows: TODO. If you can use the Linux subsystem and follow the Linux instructions.
  • CppAD
    • Mac: brew install cppad
    • Linux sudo apt-get install cppad or equivalent.
    • Windows: TODO. If you can use the Linux subsystem and follow the Linux instructions.
  • Eigen. This is already part of the repo so you shouldn't have to worry about it.
  • Simulator. You can download these from the releases tab.

Basic Build Instructions

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

carnd-mpc-project-p5's People

Contributors

awbrown90 avatar bdschrisk avatar domluna avatar

Stargazers

 avatar

Watchers

 avatar

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.