Assignment: GUI-Based EKF Localization Using Multiple Landmarks

Objective

In this assignment, you will develop a MATLAB graphical user interface that demonstrates 2D robot localization using an Extended Kalman Filter with multiple known landmarks.

Your GUI should combine the visualization style of the provided first Kalman filter GUI with the nonlinear EKF localization model from the provided one-landmark-based EKF script.

Background

A mobile robot moves in a 2D environment using the unicycle motion model:

x=[xyθ]x = \begin{bmatrix} x \\ y \\ \theta \end{bmatrix}

where xx and yy represent the robot position, and θ\theta is the robot heading angle.

The robot receives control inputs:

u=[vω]u = \begin{bmatrix} v \\ \omega \end{bmatrix}

where vv is the linear velocity and ω\omega is the angular velocity.

The environment contains multiple fixed landmarks at known positions. The robot measures its distance to each landmark using noisy range measurements.

Required Tasks

Students must implement a MATLAB GUI that simulates and visualizes EKF localization using multiple landmarks.

The GUI should include:

  1. A 2D plot showing:

  2. A Run Simulation button.

  3. A Reset button.

  4. User controls for:

  5. A live visualization of the robot motion and EKF estimate.

EKF Requirements

Students should implement the EKF prediction step using the nonlinear unicycle model:

xk+1=xk+vΔtcos(θk)x_{k+1} = x_k + v \Delta t \cos(\theta_k)

yk+1=yk+vΔtsin(θk)y_{k+1} = y_k + v \Delta t \sin(\theta_k)

θk+1=θk+ωΔt\theta_{k+1} = \theta_k + \omega \Delta t

They should also compute the motion Jacobian FkF_k.

For each landmark ii, the range measurement is:

zi=(xxLi)2+(yyLi)2z_i = \sqrt{(x-x_{L_i})^2 + (y-y_{L_i})^2}

For multiple landmarks, students should construct:

z=[z1z2zN]z = \begin{bmatrix} z_1 \\ z_2 \\ \vdots \\ z_N \end{bmatrix}

and the measurement Jacobian:

H=[xxL1r1yyL1r10xxL2r2yyL2r20xxLNrNyyLNrN0]H = \begin{bmatrix} \frac{x-x_{L_1}}{r_1} & \frac{y-y_{L_1}}{r_1} & 0 \\ \frac{x-x_{L_2}}{r_2} & \frac{y-y_{L_2}}{r_2} & 0 \\ \vdots & \vdots & \vdots \\ \frac{x-x_{L_N}}{r_N} & \frac{y-y_{L_N}}{r_N} & 0 \end{bmatrix}

The EKF update should use:

S=HPHT+RS = HPH^T + R

K=PHTS1K = PH^T S^{-1}

x=x+K(zz^)x = x + K(z-\hat{z})

P=(IKH)PP = (I-KH)P

Deliverables

Students must submit:

  1. MATLAB GUI file

  2. Simulation results

  3. Short report The report should include:

Submission Format

Submit a single compressed folder containing:

StudentName_EKF_GUI_Assignment/
│
├── main_GUI_file.m
├── helper_functions/
├── screenshots/
├── report.pdf
└── README.txt

The README.txt should briefly explain how to run the GUI.