Merge pull request #372 from ernstklrb/typos-unscented-kf
Typos kalman-filter-math and unscented kf
This commit is contained in:
commit
e43520fafc
@ -1008,7 +1008,7 @@
|
||||
"$$\\mathbf P = (\\mathbf I-\\mathbf {KH})\\mathbf{\\bar P}(\\mathbf I-\\mathbf{KH})^\\mathsf T + \\mathbf{KRK}^\\mathsf T$$\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"I frequently get emails and/or GitHub issues raised, claiming the implementation is a bug. It is not a bug, and I use it for several reasons. First, the subtraction $(\\mathbf I - \\mathbf{KH})$ can lead to nonsymmetric matrices results due to floating point errors. Covariances must be symmetric, and so becoming nonsymmetric usually leads to the Kalman filter diverging, or even for the code to raise an exception because of the checks built into `NumPy`.\n",
|
||||
"I frequently get emails and/or GitHub issues raised, claiming the implementation is a bug. It is not a bug, and I use it for several reasons. First, the subtraction $(\\mathbf I - \\mathbf{KH})$ can lead to nonsymmetric matrix results due to floating point errors. Covariances must be symmetric, and so becoming nonsymmetric usually leads to the Kalman filter diverging, or even for the code to raise an exception because of the checks built into `NumPy`.\n",
|
||||
"\n",
|
||||
"A traditional way to preserve symmetry is the following formula:\n",
|
||||
"\n",
|
||||
@ -1023,7 +1023,7 @@
|
||||
"\\mathbf P = (\\mathbf P + \\mathbf P^\\mathsf T) / 2$$\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"Let's just derive the equation from first principles. It's not too bad, and you need to understand the derivation to understand the purpose of the equation, and, more importantly, diagnose issues if you filter diverges due to numerical instability. This derivation comes from Brown[4].\n",
|
||||
"Let's just derive the equation from first principles. It's not too bad, and you need to understand the derivation to understand the purpose of the equation, and, more importantly, diagnose issues if your filter diverges due to numerical instability. This derivation comes from Brown[4].\n",
|
||||
"\n",
|
||||
"First, some symbology. $\\mathbf x$ is the true state of our system. $\\mathbf{\\hat x}$ is the estimated state of our system - the posterior. And $\\mathbf{\\bar x}$ is the estimated prior of the system. \n",
|
||||
"\n",
|
||||
|
@ -2948,7 +2948,7 @@
|
||||
"\n",
|
||||
"With that done we are now ready to implement the UKF. I want to point out that when I designed this filter I did not just design all of functions above in one sitting, from scratch. I put together a basic UKF with predefined landmarks, verified it worked, then started filling in the pieces. \"What if I see different landmarks?\" That lead me to change the measurement function to accept an array of landmarks. \"How do I deal with computing the residual of angles?\" This led me to write the angle normalization code. \"What is the *mean* of a set of angles?\" I searched on the internet, found an article on Wikipedia, and implemented that algorithm. Do not be daunted. Design what you can, then ask questions and solve them, one by one.\n",
|
||||
"\n",
|
||||
"You've seen the UKF implemention already, so I will not describe it in detail. There are two new thing here. When we construct the sigma points and filter we have to provide it the functions that we have written to compute the residuals and means.\n",
|
||||
"You've seen the UKF implemention already, so I will not describe it in detail. There are two new things here. When we construct the sigma points and filter we have to provide it the functions that we have written to compute the residuals and means.\n",
|
||||
"\n",
|
||||
"```python\n",
|
||||
"points = SigmaPoints(n=3, alpha=.00001, beta=2, kappa=0, \n",
|
||||
@ -2959,7 +2959,7 @@
|
||||
" residual_x=residual_x, residual_z=residual_h)\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"Next, we need to pass extra data into our `f(x, dt)` and `h(x)` functions. We want to use `move(x, dt, u, wheelbase)` for `f(x, dt)`, and `Hx(x, landmarks)` for `h(x)`. We can do this, we just have to pass the extra parameters into `predict()` and `update()` as keyword argument,s like so:\n",
|
||||
"Next, we need to pass extra data into our `f(x, dt)` and `h(x)` functions. We want to use `move(x, dt, u, wheelbase)` for `f(x, dt)`, and `Hx(x, landmarks)` for `h(x)`. We can do this, we just have to pass the extra parameters into `predict()` and `update()` as keyword arguments like so:\n",
|
||||
"\n",
|
||||
"```python\n",
|
||||
" ukf.predict(u=u, wheelbase=wheelbase) \n",
|
||||
@ -3086,7 +3086,7 @@
|
||||
"source": [
|
||||
"### Steering the Robot\n",
|
||||
"\n",
|
||||
"The steering simulation in the run above is not realistic. The velocity and steering angles never changed, which doesn't pose much of a problem for the Kalman filter. We could implement a complicated PID controlled robot simulation, but I will just generate varying steering commands using NumPy's `linspace` method. I'll also add more landmarks as the robot will be traveling much further than in the first example."
|
||||
"The steering simulation in the run above is not realistic. The velocity and steering angles never changed, which doesn't pose much of a problem for the Kalman filter. We could implement a complicated PID controlled robot simulation, but I will just generate varying steering commands using NumPy's `linspace` method. I'll also add more landmarks as the robot will be traveling much farther than in the first example."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user