Kalman Filter Animation

29
11

The covariance matrices represent ellipses.

So the example application on Wikipedia can be visualized like this:

Sample animation

I've been working on the code for a while,

The code is now on github

and I've uploaded the image to wikipedia.

asked 29 Feb '12, 08:01

suki's gravatar image

suki
6924912
accept rate: 20%

edited 28 Apr '12, 12:16

Gundega's gravatar image

Gundega ♦♦
44.1k70170315

OMG, that is awesome! Answers the questions that came up here.

(29 Feb '12, 10:50) Shimniok Shimniok's gravatar image

The vertical grid lines are skewed during the update. Does this represent anything except a visualization glitch?

Is there anyway to slow down or pause an animated GIF display?

(29 Feb '12, 18:24) William Rutiser William%20Rutiser's gravatar image

@wrutiser :
The skew is intentional, I was just trying to show how the whole space is sheared by the update, and the ellipse shears with with the space.

Slow it down? If you have a mac handy "preview" lets you browse animations frame by frame. I'll look into making a slower version.

(29 Feb '12, 18:34) suki suki's gravatar image

@wrutiser: ok I slowed it down a bit (1.5s per frame instead of 1.0)

(04 Mar '12, 15:53) suki suki's gravatar image

this job is awesome. But I have a question. after the measurement, the product of the sensor-offered Gaussian and the predicted Gaussian should be a Gaussian with smaller variance which should be indicated with a smaller eclipse, I believe. So in your graph the pink ones are those enlarged by noise?

(04 Mar '12, 20:32) kata he-1 kata%20he-1's gravatar image

@Hexangon

Yes, I am adding noise in this example.

I add the noise ellipses in two places:

first to the actual state, as part of the simulation (see how the star moves a little when I draw the red ellipse)

and to the blue ellipse, to make the pink one, accounting for how the actual state may have moved.

(05 Mar '12, 07:05) suki suki's gravatar image

One Answer:

That's a really excellent visualization, and I see what you are trying to do with the skewed grid lines. If you already pretty much know what you're looking for, the lines really let you see how after a change in time, dt, every possible state has evolved in the way it would have if the object really were in that state. That is, every point (x,v) in this state-space moves to the point (x+v*dt, v).

The thing that is confusing about the grid lines, though, is that in the update frame, the numbers on the position axis still represent the position that the state would have been in at a time dt ago. The position of where it is now would still be given by the grid lines as drawn in rest of the frames. Perhaps it would be useful to indicate this distinction somehow. You could draw either the new or (as I would probably prefer) the old axes lines and numbers in a different color, and then give an indication in the legend that the slanted lines represent the old position of the states that they intersect. And then show that the time has advanced.

Also, it's possible that the confusion is made worse by the inclusion of negative velocities on the plot. The result of doing this is that the axes numbers are moving in the negative position direction, while almost all of the region corresponding to the states we are interested in is moving in the positive position direction. (Although I guess there is some value in including zero velocity states, since those are the fixed points. And if you stopped at 0, then it would be harder to add the distinction in times I was looking talking about before.)

Finally, and related to the first point, it would probably be nice to have some labels on both of the axes. That's just the middle-school math teacher coming out in me.

Again, really nice work. I'm so glad somebody made this!

link

answered 01 Mar '12, 09:45

Joshua%20Schoenfield's gravatar image

Joshua Schoe...
4562410

thanks for the input

(04 Mar '12, 20:27) suki suki's gravatar image
Your answer
Question text:

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5,188
×323
×140
×101
×61
×57

Asked: 29 Feb '12, 08:01

Seen: 1,585 times

Last updated: 28 Apr '12, 12:16