GithubHelp home page GithubHelp logo

2d-localization's Introduction

2D Localization

This is an interactive simulation to visualize 2D Simulation using SDL graphic library. This project was developed mainly as a way for me to wrap my head around different techiniques in robotic localization, and what is more beginner-friendly that starting things off in 2D?

I have also compiled this project into WebAssembly and deployed it on Github, which is available here: hungdche.github.io/2D-Localization

Prerequisites

  • SDL2: Make sure to have installed SDL2 Version at least 2.0.20. Visit https://wiki.libsdl.org/SDL2/Installation for installation instruction. It is recommded that you install from source instead of libsdl2-dev from apt, since SDL version on apt is 2.0.10.
  • Eigen: If you want to build with Emscripten, clone this repo recursively.
  • yaml-cpp: Instruction on how to download is here: https://github.com/jbeder/yaml-cpp

Installation

    git clone https://github.com/hungdche/Localization-Simulation.git
    cd 2D-Localization
    mkdir build && cd build 
    cmake ..
    make -j

Features

In this simulation, a vehicle (grey square). is equipped with a camera, IMU, and Lidar. To replicate the real world scenario, IMU and Lidar data is infused with additive zero-mean Gaussian noise, modal as below. (Camera are mostly for direction visualization, and does not affect localization).
The task is to use each or a combination of sensors to try and localize the vehicle using Kalman Filter and its derivative. The cyan square indicated the estimated pose of the vehicle.

The basic movements are:

  • Left, Right button: steer left/right
  • Up button to accelerate in the positive direction
  • Down button to accelerate in the negative direction
  • n to reset the predicted pose
  • l to switch between editting mode and simulating mode
  • Space to brake
  • Enter to randomly spawn obstacles of random sizes, can be drag around

You can specify things like max speed, noises and biases for sensors, and noise covariance matrices in configs/config.yaml. You can add more parameters by modifying include/core/parser.hpp

Method

The state vector that we always want to estimate is $\mathbf{x} = \left[ x,y,\theta \right]^T$, where $[x,y]$ is the location, and $\theta$ is the angle with respect to the y axis.

IMU Simulation Model

To try and replicate real-world IMU data, both the accelerometer and gyroscope are influenced by additive white noise and random walk.

  • $\tilde{a}(t) = a(t) + b_a(t) + n_a(t)$ and $\tilde{w}(t) = w(t) + b_w(t) + n_w(t)$
    • noise can be simulated as follows: $n[k] = \sigma_{d}w[k]$
      • where $w[k] \sim \mathcal{N}(0,1)$ and $\sigma_{d} = \sigma \dfrac{1}{\sqrt{\Delta t}}$
    • bias can be simulated as follows: $b[k] = b[k-1] + \sigma_{d}w[k]$
      • where $w[k] \sim \mathcal{N}(0,1)$ and $\sigma_{d} = \sigma \sqrt{\Delta t}$

For more information, refer here:

2d-localization's People

Contributors

hungdche avatar

Stargazers

 avatar  avatar  avatar  avatar  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.