More work on R and Q.

Added more examples and cleaned up explanations on modifying R
and Q. In particular, the filter setting for R was not the same
as the simulated noise for no obvious reason. Also, names were
bad R instead of R_var, for example.
This commit is contained in:
Roger Labbe 2014-11-19 23:50:11 -08:00
parent 60e31b890d
commit 66f20b745e
2 changed files with 157 additions and 235 deletions

File diff suppressed because one or more lines are too long

View File

@ -12,14 +12,14 @@ import math
class DogSensor(object):
def __init__(self, x0=0, velocity=1, noise=0.0):
def __init__(self, x0=0, velocity=1, noise_var=0.0):
""" x0 - initial position
velocity - (+=right, -=left)
noise - scaling factor for noise, 0== no noise
noise_var - noise variance, 0== no noise
"""
self.x = x0
self.velocity = velocity
self.noise = math.sqrt(noise)
self.noise = math.sqrt(noise_var)
def sense(self):
self.x = self.x + self.velocity