Kalman-and-Bayesian-Filters-in-Python icon indicating copy to clipboard operation
Kalman-and-Bayesian-Filters-in-Python copied to clipboard

8.6 Detecting and Rejecting Bad Measurement

Open iassenev opened this issue 2 years ago • 0 comments


ValueError Traceback (most recent call last) in 8 for i in range(101): 9 kf.predict() ---> 10 kf.update(np.array([[i*.05, i*.05]])) # around 200 kph 11 12 p0 = kf.x[0:2] C:\pcloud\filterpy\filterpy\kalman\kalman_filter.py in update(self, z, R, H) 531 532 if H is None: --> 533 z = reshape_z(z, self.dim_z, self.x.ndim) 534 H = self.H 535

C:\pcloud\filterpy\filterpy\common\helpers.py in reshape_z(z, dim_z, ndim) 309 310 if z.shape != (dim_z, 1): --> 311 raise ValueError('z (shape {}) must be convertible to shape ({}, 1)'.format(z.shape, dim_z)) 312 313 if ndim == 1:

ValueError: z (shape (1, 2)) must be convertible to shape (1, 1)


NameError Traceback (most recent call last) in ----> 1 print('error = {:.1f} km, at a speed of {:.0f} kph'.format(np.linalg.norm(kf.y), dist*3600))

NameError: name 'dist' is not defined


IndexError Traceback (most recent call last) in 5 6 if y[0] > GATE_LIMIT * std_x or y[1] > GATE_LIMIT * std_y: ----> 7 print('discarding measurement, error is {:.0f} std, {:.0f} std'.format(y[0]/std_x, y[1]/std_y)) 8 9 print('y is', y)

IndexError: index 1 is out of bounds for axis 0 with size 1

iassenev avatar Mar 14 '23 12:03 iassenev