本文整理汇总了Python中filterpy.kalman.KalmanFilter.x[0]方法的典型用法代码示例。如果您正苦于以下问题:Python KalmanFilter.x[0]方法的具体用法?Python KalmanFilter.x[0]怎么用?Python KalmanFilter.x[0]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类filterpy.kalman.KalmanFilter
的用法示例。
在下文中一共展示了KalmanFilter.x[0]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enumerate
# 需要导入模块: from filterpy.kalman import KalmanFilter [as 别名]
# 或者: from filterpy.kalman.KalmanFilter import x[0] [as 别名]
diffs = []
for idx, e in enumerate(measure_errors):
r.move(dt, 0)
kf.predict()
priors.append(kf.x_prior)
z = r.cur_state[0] + e
noised.append(z)
kf.update(r.cur_state[0] + e)
diff = kf.x_post - kf.x_prior
if abs(diff[1]) > .5: # speed diff
suppressed_diff = diff[1] / np.linalg.norm(diff[1]) * .5
kf.x[1] = kf.x_prior[1] + suppressed_diff
if abs(diff[0]) > 3:
suppressed_diff = diff[0] / np.linalg.norm(diff[0]) * 3
kf.x[0] = kf.x_prior[0] + suppressed_diff
gts.append(r.cur_state)
posts.append(kf.x)
errors.append(kf.x_prior - r.cur_state)
vars.append(kf.P)
diffs.append(kf.x - kf.x_prior)
ts = r.history_ts[1:]
gts = np.array(gts).squeeze()
posts = np.array(posts).squeeze()
priors = np.array(priors).squeeze()
noised = np.array(noised).squeeze()
var_conds = np.array([np.linalg.cond(p) for p in vars])
diffs = np.array(diffs).squeeze()