Code Monkey home page Code Monkey logo

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

Extended Kalman Filter Project

Writeup

Introduction

The goals/steps of this project are the following:

  • Utilize a Kalman filter to estimate the state of a moving object of interest
  • With noisy RADAR/LIDAR measurements
  • Obtaining RMSE values less than/equal to [.11, .11, 0.52, 0.52]

Environment

Minimum execution environment is undefined.

Project was developed using the following environment:

Category Item
OS Windows 10
CPU Intel i7/6800k
RAM 64GB
GPU nVidia GTX 1060
VRAM 6GB
Storage SATA SSD
IDE JetBrains CLion (and) Linux for Windows (Ubuntu)

Execution

This capability includes of the following source code files modified for this project:

  • FusionEKF.cpp implements sensor fusion functionality. Kalman filter initialization and prediction workflow code has been added here.
  • kamlan_filter.cpp implements the Kalman filter iteself. Update and prediction code has been added here.
  • tools.cpp implements support capabilities. RMSE and Jacobian matrix code has been added here.

Almost all additions have been derived from project source material.

This remainder of source code/configuration files were provided with the project template.

term2_sim.exe

A running Term 2 simulator is necessary for evaluation of this capability.

Obtaining

Obtain the Term 2 simulator via its Github repo.

Running

Once target environment perquisites are met, the simulator may be executed as a standalone application within the OS.

Once the simulator is running, select the "Project 1/2: EKF and UKF" scenario to prepare for evaluation.

Step #1

ExtendedKF

The capability is built from this project source code as a standalone application named "ExtendedKF".

Obtaining / Building

Obtain this capability via its Github repo.

Build using OS-specific cmake and make commands.

Windows build shown (via JetBrains CLion):

/usr/bin/cmake --build /mnt/[...]/CarND-Extended-Kalman-Filter-Project/cmake-build-debug --target ExtendedKF -- -j 6
Scanning dependencies of target ExtendedKF
[ 40%] Building CXX object CMakeFiles/ExtendedKF.dir/src/main.cpp.o
[ 60%] Building CXX object CMakeFiles/ExtendedKF.dir/src/tools.cpp.o
[ 80%] Building CXX object CMakeFiles/ExtendedKF.dir/src/FusionEKF.cpp.o
[ 80%] Building CXX object CMakeFiles/ExtendedKF.dir/src/kalman_filter.cpp.o
[100%] Linking CXX executable ExtendedKF
[100%] Built target ExtendedKF
Running

Once built, execute "ExtendedKF" from the command line.

Windows execution shown (via JetBrains CLion):

/mnt/[...]/CarND-Extended-Kalman-Filter-Project/cmake-build-debug/ExtendedKF
Listening to port 4567
Connected!!!

Once "ExtendedKF" is running and indicating connection, start the simulator run as shown: Step #2

Step #3

Video of the entire build/run cycle may be found here.


Rubric Points

Rubric Points are discussed individually with respect to the implementation.


1. Compiling

1.1 Your code should compile.

Code must compile without errors with cmake and make. Given that we've made CMakeLists.txt as general as possible, it's recommended that you do not change it unless you can guarantee that your changes will still compile on any platform.

See instructions and video, above.


2. Accuracy

2.1 px, py, vx, vy output coordinates must have an RMSE <= [0.11, 0.11, 0.52, 0.52] (...).

Your algorithm will be run against Dataset 1 in the simulator which is the same as "data/obj_pose-laser-radar-synthetic-input.txt" in the repository. We'll collect the positions that your algorithm outputs and compare them to ground truth data. Your px, py, vx, and vy RMSE should be less than or equal to the values [.11, .11, 0.52, 0.52].

Net accuracy as demonstrated is approximately [0.09, 0.09, 0.45, 0.44].


3. Follows the Correct Algorithm

3.1 Your Sensor Fusion algorithm follows the general processing flow (...).

While you may be creative with your implementation, there is a well-defined set of steps that must take place in order to successfully build a Kalman Filter. As such, your project should follow the algorithm as described in the preceding lesson.

main.cpp encapsulates the initialize, measure, predict, and repeat process described in preceding lessons as follows:

  1. Receives simulator data packets
  2. Demarshals from JSON
  3. Captures and tailors measurements according to source (RADAR, LIDAR)
  4. Updates Kalman filter and generates predictions
  5. Calculates RMSE based on prediction deviation from measurement

3.2 Your Kalman Filter algorithm handles the first measurements appropriately.

Your algorithm should use the first measurements to initialize the state vectors and covariance matrices.

Initialization is performed in the constructor and ProcessMeasurement methods found in FusionEKF.cpp. The is_initialized_ member variable is used to mediate this initialization.

3.3 Your Kalman Filter algorithm first predicts then updates.

Upon receiving a measurement after the first, the algorithm should predict object position to the current timestep and then update the prediction using the new measurement.

Updates to the state transition matrix are performed in the ProcessMeasurement method found in FusionEKF.cpp. Predictions are initiated there and performed in the Predict method found in kalman_filter.cpp. Updates are subsequently performed in the Update method also found in kalman_filter.cpp.

3.4 Your Kalman Filter can handle radar and lidar measurements.

Your algorithm sets up the appropriate matrices given the type of measurement and calls the correct measurement function for a given sensor type.

RADAR/LIDAR measurements are first discriminated by type in main.cpp, then in terms of prediction matrix and update preparation in the ProcessMeasurement method found in FusionEKF.cpp.


4. Code Efficiency

4.1 Your algorithm should avoid unnecessary calculations.

This is mostly a "code smell" test. Your algorithm does not need to sacrifice comprehension, stability, robustness or security for speed, however it should maintain good practice with respect to calculations (...).

This is mitigated by this project's constrained scope -- the structure of the codebase is predefined and core algorithm already developed during preceding lessons. That said, both the provided and developed code exclusively reflect the central use case and compiles, runs, and performs adequately in the target environment.

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.