diff --git a/filterpy/kalman/UKF.py b/filterpy/kalman/UKF.py index b96ee4f..28fffa8 100644 --- a/filterpy/kalman/UKF.py +++ b/filterpy/kalman/UKF.py @@ -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 @@ -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 @@ -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 @@ -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