本文整理汇总了Python中filterpy.kalman.KalmanFilter.H[0,0]方法的典型用法代码示例。如果您正苦于以下问题:Python KalmanFilter.H[0,0]方法的具体用法?Python KalmanFilter.H[0,0]怎么用?Python KalmanFilter.H[0,0]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类filterpy.kalman.KalmanFilter
的用法示例。
在下文中一共展示了KalmanFilter.H[0,0]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_filter
# 需要导入模块: from filterpy.kalman import KalmanFilter [as 别名]
# 或者: from filterpy.kalman.KalmanFilter import H[0,0] [as 别名]
def init_filter(dt):
states = 18 # number of states, first and second order derivatives
obs = 6 # observations
filter = KalmanFilter(dim_x=states,dim_z=obs)
filter.x = np.zeros([1,states]).T
transition_mat = np.eye(9)
for i in range(0,9):
id_vel = i + 3
id_acc = i + 6
if id_vel < 9:
transition_mat[i,id_vel] = dt
if id_acc < 9:
transition_mat[i,id_acc] = 0.5 * dt * dt
zero_mat = np.zeros([9,9])
tmp1 = np.hstack([transition_mat,zero_mat])
tmp2 = np.hstack([zero_mat,transition_mat])
filter.F = np.vstack([tmp1,tmp2])
filter.H = np.zeros([obs,states])
filter.H[0,0] = 1
filter.H[1,1] = 1
filter.H[2,2] = 1
filter.H[3,9] = 1
filter.H[4,10] = 1
filter.H[5,11] = 1
filter.Q = np.eye(states) * 1e-4; # process noise
filter.R = np.eye(obs) * 0.01 # measurement noise
filter.P = np.eye(states) * 1e-4 # covariance post
filter.u = 0.
return filter