Skip to content

docs: Explain the equations and references in the EKF localizer - #155

Open
bh-official wants to merge 1 commit into
ShisatoYano:mainfrom
bh-official:docs/ekf-localizer-math
Open

bh-official wants to merge 1 commit into
ShisatoYano:mainfrom
bh-official:docs/ekf-localizer-math

Conversation

@bh-official

Copy link
Copy Markdown

Closes #97

What

The EKF localizer only had labels like # predict state and # kalman gain. This adds the equations next to the code that implements them, so a beginner can match each step to an equation.

Changes (comments and docstrings only, no behavior change)

  • Class docstring: notation, predict/update equations, references (Thrun, Burgard, Fox, "Probabilistic Robotics", chapter 3; Kalman 1960; PythonRobotics).
  • Constructor docstring: all noise arguments with units (standard deviations, m/s^2, deg/s, m).
  • update(): equation comments for state prediction, covariance prediction, predicted observation, innovation covariance, Kalman gain, state and covariance update. Notes that P - K S K^T equals (I - K H) P.
  • _jacobian_F, _jacobian_G, JACOB_H, _observation_model: where each Jacobian comes from (derivatives of State.motion_model).
  • Documents two things the code does that differ from the textbook, without changing them: the input noise is scaled by the variance matrix instead of the standard deviation, and F and G are evaluated at the predicted state instead of the last state. If you prefer to change either, I can do that in a separate PR.
  • Fixed the typo "extimated".

Checked

pytest -q test/test_ekf_localization_path_tracking.py test/test_ekf_vs_ukf_comparison.py test/test_ekf_ukf_pf_comparison.py
3 passed (before and after)

git diff shows only comment/docstring lines added, plus the typo fix in one docstring line.

Write the predict and update equations next to the code that implements
them, describe where the Jacobians F, G and H come from, and document the
noise arguments with their units. Add textbook references.

Also note two details of the existing code: the input noise is scaled by
the variance instead of the standard deviation, and F and G are evaluated
at the predicted state. Behavior is unchanged.

Fix the typo extimated.

Closes ShisatoYano#97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explain the EKF localizer with equations and references

1 participant