Giter Club home page Giter Club logo

carnd-extended-kalman-filter-project-master's Introduction

Extended Kalman Filter Project Starter Code

Self-Driving Car Engineer Nanodegree Program: My 6th Self Driving Car ND Project, 1st Project at Term 2. The main goal of this project is to apply (extended) kalman filter from Lidar and Radar sensors of a self driving car using C++ language.


Dependencies

  • Specifically, I followed instruction at this link using dmg file for CMake.

Contents of this repo

src a directory with the cpp codes:

  • main.cpp- reads in data, calls a function to run the Kalman filter, calls a function to calculate RMSE
  • FusionEKF.cpp- reads in data, calls a function to run the Kalman filter, calls a function to calculate RMSE
  • kalman_filter.cpp- reads in data, calls a function to run the Kalman filter, calls a function to calculate RMSE
  • tools.cpp- function to calculate RMSE and the Jacobian matrix

data folder:

  • obj_pose-laser-radar-synthetic-input.txt: data file containing Lidar and Radar data. The columns are
    • For a row containing radar data, the columns are: sensor_type, rho_measured, phi_measured, rhodot_measured, timestamp, x_groundtruth, y_groundtruth, vx_groundtruth, vy_groundtruth, yaw_groundtruth, yawrate_groundtruth
    • For a row containing lidar data, the columns are: sensor_type, x_measured, y_measured, timestamp, x_groundtruth, y_groundtruth, vx_groundtruth, vy_groundtruth, yaw_groundtruth, yawrate_groundtruth.

results a directory containing output and log files, as well as ekf visualization plot.

Docs a directory with data file structure description

Visualization a directory with python script to visualize the ekf C++ output file.

Results

alt text

Accuracy (RMSE): [0.0972256, 0.0853761, 0.450855, 0.439588]. And it is less than the requirement. Project Requirement: [0.11, 0.11, 0.52, 0.52]

Lesson learnt

  • When converting cartesian coordinates to polar coordinates, we should use atan2(y,x) instead of atan(y/x) as the later could only do first and fourth quadrant (π/2 ~ π/2) while atan2 returns (-π ~ π), covering all four quadrants.
  • When calculating phi in `y = z - h(x)` for radar measurements, the resulting angle phi in the y vector should be adjusted so that it is between -pi and pi. The Kalman filter is expecting small angle values between the range -pi and pi. So when working in radians, we should add 2π or subtract 2π until the angle is within the desired range.

How to run the code

  1. Clone this repo.
  2. Make a build directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run it: ./ExtendedKF ../data/obj_pose-laser-radar-synthetic-input.txt obj_output.txt > obj_input.log.

To have a detailed description of the project requirements, please see this repo.

carnd-extended-kalman-filter-project-master's People

Contributors

alexxucui avatar amintahmasbi avatar andrewpaster avatar cameronwp avatar deniskrut avatar kylesf avatar minmingzhao avatar mleonardallen avatar vatavua avatar wolfgangsteiner 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.