本文整理汇总了Python中filterpy.kalman.UnscentedKalmanFilter.R[0,0]方法的典型用法代码示例。如果您正苦于以下问题:Python UnscentedKalmanFilter.R[0,0]方法的具体用法?Python UnscentedKalmanFilter.R[0,0]怎么用?Python UnscentedKalmanFilter.R[0,0]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类filterpy.kalman.UnscentedKalmanFilter
的用法示例。
在下文中一共展示了UnscentedKalmanFilter.R[0,0]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: UKF
# 需要导入模块: from filterpy.kalman import UnscentedKalmanFilter [as 别名]
# 或者: from filterpy.kalman.UnscentedKalmanFilter import R[0,0] [as 别名]
kf = UKF(2, 2, dt=0.1, hx=hx, fx=fx, kappa=2.)
kf.x = np.array([100, 100.])
kf.P *= 40
hx.p = kf.x - np.array([50,50])
d = ((kf.x[0] - hx.p[0])**2 + (kf.x[1] - hx.p[1])**2)**.5
stats.plot_covariance_ellipse(
kf.x, cov=kf.P, axis_equal=True,
facecolor='y', edgecolor=None, alpha=0.6)
plt.scatter([100], [100], c='y', label='Initial')
kf.R[0,0] = radians (1)**2
kf.R[1,1] = 2.**2
kf.predict()
kf.update(np.array([radians(45), d]))
print(kf.x)
print(kf.P)
stats.plot_covariance_ellipse(
kf.x, cov=kf.P, axis_equal=True,
facecolor='g', edgecolor=None, alpha=0.6)
plt.scatter([100], [100], c='g', label='45 degrees')
示例2: BaseballPath
# 需要导入模块: from filterpy.kalman import UnscentedKalmanFilter [as 别名]
# 或者: from filterpy.kalman.UnscentedKalmanFilter import R[0,0] [as 别名]
y = 1.
x = 0.
theta = 35. # launch angle
v0 = 50.
ball = BaseballPath(x0=x, y0=y, launch_angle_deg=theta,
velocity_ms=v0, noise=[.3,.3])
kf = UKF(dim_x=4, dim_z=2, dt=dt, hx=hx, fx=fx, kappa=0)
#kf.R *= r
kf.R[0,0] = 0.1
kf.R[1,1] = radians(0.2)
omega = radians(omega)
vx = cos(omega) * v0
vy = sin(omega) * v0
kf.x = array([x, vx, y, vy])
kf.R*= 0.01
#kf.R[1,1] = 0.01
kf.P *= 10
f1 = kf
t = 0
xs = []