Skip to content

Commit

Permalink
Issue rlabbe#13. Remove unused parameter
Browse files Browse the repository at this point in the history
The residual paramter was not being used by batch_filter.
  • Loading branch information
rlabbe committed Sep 10, 2016
1 parent 1b298ff commit 98a7df0
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions filterpy/kalman/UKF.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def update(self, z, R=None, UT=None, hx_args=()):
self.P = self.P - dot3(self.K, Pz, self.K.T)


def batch_filter(self, zs, Rs=None, residual=None, UT=None):
def batch_filter(self, zs, Rs=None, UT=None):
""" Performs the UKF filter over the list of measurement in `zs`.
Parameters
Expand All @@ -357,13 +357,6 @@ def batch_filter(self, zs, Rs=None, residual=None, UT=None):
covariance; a value of None in any position will cause the filter
to use `self.R` for that time step.
residual : function (z, z2), optional
Optional function that computes the residual (difference) between
the two measurement vectors. If you do not provide this, then the
built in minus operator will be used. You will normally want to use
the built in unless your residual computation is nonlinear (for
example, if they are angles)
UT : function(sigmas, Wm, Wc, noise_cov), optional
Optional function to compute the unscented transform for the sigma
points passed through hx. Typically the default function will
Expand Down Expand Up @@ -396,10 +389,6 @@ def batch_filter(self, zs, Rs=None, residual=None, UT=None):
assert len(z) == self._dim_z, 'each element in zs must be a' \
'1D array of length {}'.format(self._dim_z)


if residual is None:
residual = np.subtract

z_n = np.size(zs, 0)
if Rs is None:
Rs = [None] * z_n
Expand All @@ -414,8 +403,8 @@ def batch_filter(self, zs, Rs=None, residual=None, UT=None):
covariances = zeros((z_n, self._dim_x, self._dim_x))

for i, (z, r) in enumerate(zip(zs, Rs)):
self.predict()
self.update(z, r)
self.predict(UT=UT)
self.update(z, r, UT=UT)
means[i,:] = self.x
covariances[i,:,:] = self.P

Expand Down

0 comments on commit 98a7df0

Please sign in to comment.