我正在尝试使用无味卡尔曼滤波器,但它显示此错误。
文件“ plotter.py”,第15行,在 (filtered_state_means,filtered_state_covariances)= ukf.filter(measurements)
TypeError:“ numpy.int64”对象不可调用
import pandas as pd
from matplotlib.pyplot import plot
from numpy import array,asarray
from pykalman import UnscentedKalmanFilter
data = pd.read_csv('imu.csv')
F = array([[1.0,-0.006],[0,1]])
H = array([[1,0]])
Q = array([[1 ,0],[0 ,1]])
R = 10
measurements = asarray([data.Acc_X])
ukf = UnscentedKalmanFilter(transition_functions =
F,observation_functions = H,transition_covariance = Q,
observation_covariance = R,initial_state_mean =
array([0,0]),initial_state_covariance = array([[10,0],[0,10]]))
(filtered_state_means, filtered_state_covariances) =
ukf.filter(measurements)
(smoothed_state_means, smoothed_state_covariances) =
ukf.smooth(measurements)
plot(data.Number,smoothed_state_means[:,1])
raw_input()