【滤波跟踪】不变扩展卡尔曼滤波器对装有惯性导航系统和全球定位系统IMU+GPS进行滤波跟踪【含Matlab源码 2232期】

✅博主简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,Matlab项目合作可私信。
🍎个人主页:海神之光
🏆代码获取方式:
海神之光Matlab王者学习之路—代码获取方式
⛳️座右铭:行百里者,半于九十。

更多Matlab仿真内容点击👇
Matlab图像处理(进阶版)
路径规划(Matlab)
神经网络预测与分类(Matlab)
优化求解(Matlab)
语音处理(Matlab)
信号处理(Matlab)
车间调度(Matlab)

⛄一、简介

针对室内定位中的非视距(Non-Line-of-Sight,NLOS)现象,提出一个新型算法进行识别,同时有效缓解其影响.主要通过超宽带(Ultra-Wideband,UWB)定位系统与惯性导航系统(Inertial Navigation System,INS)的信息修正非视距误差,获得较高的定位精度.首先,在离线阶段获得不同障碍物下的NLOS误差概率分布曲线;其次,利用惯性测量单元(Inertial Measurement Unit,IMU)的预测位置及NLOS误差概率曲线修正测量距离;最后,利用卡尔曼滤波(Kalman Filtering,KF)融合步行者航迹推算(Pedestrian Dead Reckoning,PDR)的INS位置和经过改进最小二乘法(Least Square,LS)处理后UWB定位系统的位置,并更新NLOS误差获得更准确的位置估计.通过仿真和实验证实了提出的定位算法可以有效缓解NLOS误差,提升定位性能,实现在NLOS影响下的高精度定位.

⛄二、部分源代码

clear; close all;
addpath(‘filters’);
addpath(‘helper’);
addpath(‘thirdparty/shadedErrorBar’);

% Load / process data
[T_X, omega, accel, accel_b, T_GPS, XYZ_GPS] = loadPoseGPS();
test_N = length(omega); % Sets the number of IMU readings

meas_used = T_GPS <= t_x(end);
t_gps = T_GPS(meas_used,:);
xyz_gps = XYZ_GPS(meas_used,:);

% -------------------------------------------------------------------------
% Initialize filter

skew = @(u) [0 -u(3) u(2);
u(3) 0 -u(1);
-u(2) u(1) 0];

ekf = EKF();
inekf = LIEKF();

% Get first observation that happens after a prediction
obsid = 1;
while(t_gps(obsid) < t_x(1))
obsid = obsid + 1;
end

for i = 2:test_N
if i == 1
dt = t_x;
else
dt = t_x(i) - t_x(i - 1);

    %Assume gyro/IMU are basically synchronous
    ekf.prediction(w(i,:)',a(i,:)',dt);
    inekf.prediction(w(i,:)',a(i,:)',dt);
    
    
    %Measurement update
    if(i < test_N)
        if(t_gps(obsid) > t_x(i) && t_x(i+1) > t_gps(obsid))
            gps = [xyz_gps(obsid,1); xyz_gps(obsid,2); xyz_gps(obsid,3)];
            ekf.correction(gps);
            inekf.correction(gps);
            obsid = min(obsid + 1, length(t_gps));
        end
  
    
    pos_inekf(:,i) = inekf.mu(1:3,5);
    vars = sqrt(diag(inekf.sigma_cart));
    std_inekf(:,i) = vars(7:9);
    
    if(mod(i,1000)==0)
       fprintf('Iteration: %d/%d\n',i,test_N); 
    end
end

end

meas_used = T_GPS <= t_x(end);

% load gt
[~, ~, ~, ~, ~, x_gt, ~, y_gt, ~, z_gt] = loadGroundTruthAGL();
x_gt = x_gt - x_gt(1); y_gt = y_gt - y_gt(1); z_gt = z_gt - z_gt(1);
t_gt = linspace(0,T_X(end),length(x_gt));

% -------------------------------------------------------------------------
% traj plot
figure(‘DefaultAxesFontSize’,14)
hold on;
plot3(XYZ_GPS(:,1), XYZ_GPS(:,2), XYZ_GPS(:,3),‘b’,‘LineWidth’, 2);
plot3(x_gt, y_gt, z_gt,‘–k’,‘LineWidth’, 4);
plot3(pos_ekf(1,:), pos_ekf(2,:), pos_ekf(3,:),‘g’,‘LineWidth’, 2);
plot3(pos_inekf(1,:), pos_inekf(2,:), pos_inekf(3,:),‘r’,‘LineWidth’, 2);
legend(‘gps’, ‘gt’, ‘EKF’, ‘InEKF’, ‘location’, ‘southeast’)
hold off;
axis equal;

figure(‘DefaultAxesFontSize’,14)
hold on;
plot3(XYZ_GPS(:,1), XYZ_GPS(:,2), XYZ_GPS(:,3),‘b’,‘LineWidth’, 2);
plot3(x_gt, y_gt, z_gt,‘–k’,‘LineWidth’, 4);
plot3(pos_inekf(1,:), pos_inekf(2,:), pos_inekf(3,:),‘r’,‘LineWidth’, 2);
legend(‘gps’, ‘gt’, ‘InEKF’, ‘location’, ‘southeast’)
hold off;
axis equal;

% -------------------------------------------------------------------------
% axis plot
figure;
subplot(3,1,1);
hold on;
plot(t_gps, XYZ_GPS(meas_used,1), ‘b’, ‘LineWidth’, 1);
plot(t_gt, x_gt, ‘k–’, ‘LineWidth’, 2);
shadedErrorBar(T_X(1:test_N), pos_ekf(1,:), 3std_ekf(1,:), ‘lineProps’, {‘g’, ‘LineWidth’, 1})
shadedErrorBar(T_X(1:test_N), pos_inekf(1,:), 3
std_inekf(1,:), ‘lineProps’, {‘r’, ‘LineWidth’, 1})
legend(‘X_{GPS}’,‘X_{GT}’,‘X_{EKF}’, ‘X_{InEKF}’, ‘Location’, ‘eastoutside’);
axis([0,T_X(test_N),-200,200])
%
subplot(3,1,2);
hold on;
plot(t_gps, XYZ_GPS(meas_used,2), ‘b’, ‘LineWidth’, 1);
plot(t_gt, y_gt, ‘k–’, ‘LineWidth’, 2);
shadedErrorBar(T_X(1:test_N), pos_ekf(2,:), 3std_ekf(2,:), ‘lineProps’, {‘g’, ‘LineWidth’, 1})
shadedErrorBar(T_X(1:test_N), pos_inekf(2,:), 3
std_inekf(2,:), ‘lineProps’, {‘r’, ‘LineWidth’, 1})
legend(‘Y_{GPS}’,‘Y_{GT}’,‘Y_{EKF}’, ‘Y_{InEKF}’, ‘Location’, ‘eastoutside’);
axis([0,T_X(test_N),-250,350])
%
subplot(3,1,3);
hold on;
plot(t_gps, XYZ_GPS(meas_used,3), ‘b’, ‘LineWidth’, 1);
plot(t_gt, z_gt, ‘k–’, ‘LineWidth’, 2);
shadedErrorBar(T_X(1:test_N), pos_ekf(3,:), 3std_ekf(3,:), ‘lineProps’, {‘g’, ‘LineWidth’, 1})
shadedErrorBar(T_X(1:test_N), pos_inekf(3,:), 3
std_inekf(3,:), ‘lineProps’, {‘r’, ‘LineWidth’, 1})
legend(‘Z_{GPS}’,‘Z_{GT}’,‘Z_{EKF}’, ‘Z_{InEKF}’, ‘Location’, ‘eastoutside’);
axis([0,T_X(test_N),-30,60])

function u = unskew(ux)
u(1,1) = -ux(2,3);
u(2,1) = ux(1,3);
u(3,1) = -ux(1,2);
end

function w = Log®
w = unskew(logm®);
end

⛄三、运行结果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

⛄四、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1] 周军,魏国亮,田昕,王甘楠,融合UWB和IMU数据的新型室内定位算法[J].小型微型计算机系统. 2021,42(08)

3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除

🍅 仿真咨询
1 各类智能优化算法改进及应用

生产调度、经济调度、装配线调度、充电优化、车间调度、发车优化、水库调度、三维装箱、物流选址、货位优化、公交排班优化、充电桩布局优化、车间布局优化、集装箱船配载优化、水泵组合优化、解医疗资源分配优化、设施布局优化、可视域基站和无人机选址优化

2 机器学习和深度学习方面
卷积神经网络(CNN)、LSTM、支持向量机(SVM)、最小二乘支持向量机(LSSVM)、极限学习机(ELM)、核极限学习机(KELM)、BP、RBF、宽度学习、DBN、RF、RBF、DELM、XGBOOST、TCN实现风电预测、光伏预测、电池寿命预测、辐射源识别、交通流预测、负荷预测、股价预测、PM2.5浓度预测、电池健康状态预测、水体光学参数反演、NLOS信号识别、地铁停车精准预测、变压器故障诊断

3 图像处理方面
图像识别、图像分割、图像检测、图像隐藏、图像配准、图像拼接、图像融合、图像增强、图像压缩感知

4 路径规划方面
旅行商问题(TSP)、车辆路径问题(VRP、MVRP、CVRP、VRPTW等)、无人机三维路径规划、无人机协同、无人机编队、机器人路径规划、栅格地图路径规划、多式联运运输问题、车辆协同无人机路径规划、天线线性阵列分布优化、车间布局优化

5 无人机应用方面
无人机路径规划、无人机控制、无人机编队、无人机协同、无人机任务分配

6 无线传感器定位及布局方面
传感器部署优化、通信协议优化、路由优化、目标定位优化、Dv-Hop定位优化、Leach协议优化、WSN覆盖优化、组播优化、RSSI定位优化

7 信号处理方面
信号识别、信号加密、信号去噪、信号增强、雷达信号处理、信号水印嵌入提取、肌电信号、脑电信号、信号配时优化

8 电力系统方面
微电网优化、无功优化、配电网重构、储能配置

9 元胞自动机方面
交通流 人群疏散 病毒扩散 晶体生长

10 雷达方面
卡尔曼滤波跟踪、航迹关联、航迹融合

  • 23
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值