【滤波跟踪】基于四元数的松耦合15状态误差卡尔曼滤波器融合里程计和激光雷达的距离 - 角度测量实现机器人位姿估计与地标定位附matlab代码

简介: 【滤波跟踪】基于四元数的松耦合15状态误差卡尔曼滤波器融合里程计和激光雷达的距离 - 角度测量实现机器人位姿估计与地标定位附matlab代码

🌿 往期回顾可以关注主页,点击搜索

智能优化算法   神经网络预测    雷达通信        

无线传感器      电力系统          信号处理          

图像处理          路径规划         元胞自动机      

无人机            物理应用        机器学习系列      

车间调度系列    滤波跟踪系列   数据分析系列

图像处理系列

✅作者简介:热爱科研的Matlab仿真开发者,擅长毕业设计辅导、数学建模、数据处理、建模仿真、程序设计、完整代码获取、论文复现及科研仿真。

🍎 往期回顾关注个人主页:Matlab科研工作室

👇 关注我领取海量matlab电子书和数学建模资料

🍊个人信条:格物致知,完整Matlab代码获取及仿真咨询内容私信。

🔥 内容介绍

一、背景

(一)机器人位姿估计与地标定位的重要性

在机器人导航与自主探索任务中,准确的位姿估计(确定机器人在环境中的位置和姿态)以及地标定位(识别并确定环境中标志性物体的位置)至关重要。例如,在室内服务机器人场景下,机器人需要实时知晓自身位置与姿态,以便高效地完成清洁、配送等任务;同时,地标定位能帮助机器人构建环境地图,实现更好的路径规划与场景理解。在工业机器人领域,精确的位姿估计与地标定位是确保机器人准确执行装配、焊接等操作的基础。

(二)单一传感器的局限性

  1. 里程计:里程计通过测量机器人轮子的转动来推算机器人的位移和姿态变化。虽然它能够提供高频的位姿信息,但随着时间推移,其误差会逐渐累积。例如,轮子与地面的滑动、摩擦力变化等因素都会导致里程计的推算结果与实际位姿产生偏差,长时间运行后,这种偏差可能变得非常大,从而使机器人对自身位姿的估计严重偏离实际情况。
  2. 激光雷达:激光雷达通过发射激光束并测量反射光的时间来获取环境的距离信息,进而生成点云数据。它可以提供高精度的环境感知,用于地标定位以及辅助位姿估计。然而,激光雷达的数据采集频率相对较低,且在一些特殊环境下(如恶劣天气、镜面反射表面等),其测量精度会受到影响。此外,单纯依靠激光雷达进行位姿估计,在数据处理和计算上可能面临较大挑战,特别是在复杂环境中,点云数据的匹配和分析可能变得十分复杂。

(三)传感器融合的优势

为了克服单一传感器的局限性,将里程计和激光雷达数据进行融合是一种有效的解决方案。里程计的高频数据可以提供机器人位姿的短期变化趋势,而激光雷达的高精度测量能够修正里程计累积的误差。通过融合这两种传感器的数据,可以获得更准确、可靠的机器人位姿估计和地标定位结果,提高机器人在各种环境下的导航与探索能力。

⛳️ 运行结果

📣 部分代码

start_lon = gps_pos_lla(1,2)*ones(drl,1);

start_lat = gps_pos_lla(1,1)*ones(drl,1);


lla_east = (gps_pos_lla(:,2)-start_lon);

lla_north = (gps_pos_lla(:,1)-start_lat);


start_lon_est = pos_ins(1,2)*ones(drl,1);

start_lat_est = pos_ins(1,1)*ones(drl,1);


pos_east = (pos_ins(:,2)-start_lon_est);

pos_north = (pos_ins(:,1)-start_lat_est);



%   Plot Figure 7.2:   Attitude Estimates

figure; % ('rend','painters','pos',[10 150 900 600])

set(gcf,'Name','Trajectory Estimation ');

gps_alt = gps_pos_lla(:,3);

zmin=min(gps_alt);

zmax=max(gps_alt);

map=colormap;

color_steps=size(map,1);


colorbar('Ticks',[0,0.2,0.4,0.6,0.8,1],...

        'TickLabels',{strcat(num2str(zmin+(zmax-zmin)*0/10,3),' m'),...

                      strcat(num2str(zmin+(zmax-zmin)*2/10,3),' m')...

                     ,strcat(num2str(zmin+(zmax-zmin)*4/10,3),' m'),...

                      strcat(num2str(zmin+(zmax-zmin)*6/10,3),' m'),...

                       strcat(num2str(zmin+(zmax-zmin)*8/10,3),' m'),...

                     strcat(num2str(zmin+(zmax-zmin)*10/10,3),' m')}); hold on;


hold on

for i=1:color_steps

   ind=find(gps_alt<zmin+i*(zmax-zmin)/color_steps & gps_alt>=zmin+(i-1)*(zmax-zmin)/color_steps);

   plot((R_0/cos(start_lat(1)))*lla_east(ind),R_0*lla_north(ind),'o','Color',map(i,:));

end

text((R_0/cos(start_lat(1)))*lla_east(1),R_0*lla_north(1),'Start');

text((R_0/cos(start_lat(1)))*lla_east(end)+1,R_0*lla_north(end),'Stop');

xlabel('East/West (m)');ylabel('North/South (m)'); grid on; axis equal;

garyfyFigure



figure; %('rend','painters','pos',[10 150 900 600]);%(gcf+1)

set(gcf,'Name','NED position Estimation Comparison');

subplot(311)

h1 = plot(t,R_0*lla_north,'b-',t,R_0*pos_north,'r-');hold on;grid on;

xlabel('time (sec)');

ylabel('North/South (m)');

set(h1,'LineWidth',1);


subplot(312)

h1 = plot(t,(R_0/cos(start_lat(1)))*lla_east,'b-',t,(R_0/cos(start_lat(1)))*pos_east,'r-');hold on;grid on;

xlabel('time (sec)');

ylabel('East/West (m)');

set(h1,'LineWidth',1);


subplot(313)

h1 = plot(t,gps_pos_lla(:,3),'b-',t, pos_ins(:,3),'r-');hold on;grid on;

xlabel('time (sec)');

ylabel('altitude(m)');

set(h1,'LineWidth',1);


figure; %('rend','painters','pos',[10 150 900 600]);%(gcf+1)

set(gcf,'Name','NED position Error');

subplot(311)

h1 = plot(t,R_0*lla_north-R_0*pos_north,'r-');hold on;grid on;

xlabel('time (sec)');

ylabel('North/South (m)');

set(h1,'LineWidth',1);


subplot(312)

h1 = plot(t,(R_0/cos(start_lat(1)))*lla_east-(R_0/cos(start_lat(1)))*pos_east,'r-');hold on;grid on;

xlabel('time (sec)');

ylabel('East/West (m)');

set(h1,'LineWidth',1);


subplot(313)

h1 = plot(t,gps_pos_lla(:,3) - pos_ins(:,3),'r-');hold on;grid on;

xlabel('time (sec)');

ylabel('altitude(m)');

set(h1,'LineWidth',1);



figure; %('rend','painters','pos',[10 150 900 600]);%(gcf+1)

set(gcf,'Name','NED Velocity Estimation Comparison');

ax1 = subplot(311);

plot(t,gps_vel_ned(:,1),'k-',t,vel_ins(:,1),'r--','linewidth',2);

%legend('GPS measured','Estimate');


%xlabel('time (min)');

ylabel('V_N (m/s)');

grid on;

   

ax2 = subplot(312);

plot(t,gps_vel_ned(:,2),'k-',t,vel_ins(:,2),'r--','linewidth',2);

%legend('GPS measured','Estimate');


%xlabel('time (min)');

ylabel('V_E (m/s)');

grid on;


ax3 = subplot(313);

plot(t,gps_vel_ned(:,3),'k-',t,vel_ins(:,3),'r--','linewidth',2);

legend('True','Estimate');

ylim([-20 20]);

xlabel('time (sec)');

ylabel('V_D (m/s)');

grid on;

linkaxes([ax1,ax2,ax3],'x')


figure; %('rend','painters','pos',[10 150 900 600]);%(gcf+1)

set(gcf,'Name','NED Velocity Error');

ax1 = subplot(311);

plot(t,gps_vel_ned(:,1)-vel_ins(:,1),'r--','linewidth',2);

%legend('GPS measured','Estimate');


%xlabel('time (min)');

ylabel('V_N (m/s)');

grid on;

   

ax2 = subplot(312);

plot(t,gps_vel_ned(:,2)-vel_ins(:,2),'r--','linewidth',2);

%legend('GPS measured','Estimate');


%xlabel('time (min)');

ylabel('V_E (m/s)');

grid on;


ax3 = subplot(313);

plot(t,gps_vel_ned(:,3)-vel_ins(:,3),'r--','linewidth',2);

legend('Error');

ylim([-20 20]);

xlabel('time (sec)');

ylabel('V_D (m/s)');

grid on;

linkaxes([ax1,ax2,ax3],'x')


yaw_est_d = wrapTo180(eul_ins(:,3)*r2d);


figure;%('rend','painters','pos',[10 150 900 600]);

set(gcf,'Name','atitude Estimation Comparison');

subplot(311)

plot(t,roll,'k-',t,eul_ins(:,1)*r2d,'r--','linewidth',2);

%xlabel('time (min)');

ylabel('\phi (deg)');

grid on;

subplot(312)

plot(t,pitch,'k-',t,eul_ins(:,2)*r2d,'r--','linewidth',2);

%xlabel('time (min)');

ylabel('\theta (deg)');

grid on;

subplot(313)

plot(t,wrapTo180(yaw),'k-',t,wrapTo180(eul_ins(:,3)*r2d),'r--','linewidth',2);

legend('True','Estimate');

% title('Euler angle');

xlabel('time (sec)');

ylabel('\psi (deg)');

grid on;



figure; % ('rend','painters','pos',[10 150 900 600]);

set(gcf,'Name','atittude Estimation 3-\simga bound');

%temp = wrapTo180(eul_ins(:,3)*r2d)-wrapTo180(yaw);

temp = wrapTo180(eul_ins(:,3)*r2d-yaw);

%temp(find(abs(temp) > 20)) = NaN;

yaw_err = temp; clear temp;

subplot(311)

hold on;

plot(t,eul_ins(:,1)*r2d-roll,'r--','LineWidth',2);

h3 = plot(t,3*sqrt(Ppsi(:,1))*r2d,'k-','LineWidth',2);

h4 = plot(t,-3*sqrt(Ppsi(:,1))*r2d,'k-','LineWidth',2);

h3.Color(4) = 0.3;

h4.Color(4) = 0.3;

legend('\Delta \phi (deg)','3-\sigma bound'); grid on;  

ylim([-10 10]);

subplot(312)

hold on;

plot(t,eul_ins(:,2)*r2d-pitch,'r--','LineWidth',2);

h3 = plot(t,3*sqrt(Ppsi(:,2))*r2d,'k-','LineWidth',2);

h4 = plot(t,-3*sqrt(Ppsi(:,2))*r2d,'k-','LineWidth',2);

h3.Color(4) = 0.3;

h4.Color(4) = 0.3;

legend('\Delta \theta (deg)','3-\sigma bound'); grid on;  

ylim([-10 10]);

subplot(313)

hold on;

plot(t,yaw_err,'r--','LineWidth',2);

h3 = plot(t,3*sqrt(Ppsi(:,3))*r2d,'k-','LineWidth',2);

h4 = plot(t,-3*sqrt(Ppsi(:,3))*r2d,'k-','LineWidth',2);

h3.Color(4) = 0.3;

h4.Color(4) = 0.3;

legend('\Delta \psi (deg)','3-\sigma bound'); grid on;

ylim([-10 10]);xlabel('time (sec)');

%suptitle('Attitude Estimate error and its 3\sigma Bounds (deg)')


%   %  Plot Figure 7.3:   Sensor Bias Estimates


% Nav_accelBias = data.NavFilter.AccelBias_mss(:,timesection)';

% Nav_gyroBias  = data.NavFilter.GyroBias_rads(:,timesection)';

figure('rend','painters');

set(gcf,'Name','Accel and gyro bias Estimation');

subplot(321)

h1 = plot(t,accelBias(:,1)*(1000/g),'r',t,accel_bias_true(:,1)*(1000/g),'b');hold on;grid on;%estimate

title('Accelerometer Bias Estimates');

ylabel('b_{a_1}(milli-g)');

%axis([t(1)/60 14 -300 300]);

set(h1,'LineWidth',2);


subplot(323)

h2 = plot(t,accelBias(:,2)*(1000/g),'r',t,accel_bias_true(:,2)*(1000/g),'b');hold on;grid on;

ylabel('b_{a_2} (milli-g)');

%axis([t(1)/60 14 -300 300]);

set(h2,'LineWidth',2);


subplot(325)

h3 = plot(t,accelBias(:,3)*(1000/g),'r',t,accel_bias_true(:,3)*(1000/g),'b');hold on;grid on;

ylabel('b_{a_3} Bias(milli-g)');

xlabel('Time (sec)');

%axis([t(1)/60 14 -300 300]);

set(h3,'LineWidth',2);


subplot(322)

h4 = plot(t,gyroBias(:,1)*r2d,'r',t,gyro_bias_true(:,1)*r2d,'b');hold on;grid on;

title('Gyro Bias Estimates');

ylabel('b_{g_1} (deg/s)');

set(h4,'LineWidth',2);

%axis([t(1)/60 14 -10 10]);

subplot(324)

h5 = plot(t,gyroBias(:,2)*r2d,'r',t,gyro_bias_true(:,2)*r2d,'b');hold on;grid on;

ylabel('b_{g_2} (deg/s)');

set(h5,'LineWidth',2);

%axis([t(1)/60 14 -10 10]);


subplot(326)

h6 = plot(t,gyroBias(:,3)*r2d,'r',t,gyro_bias_true(:,3)*r2d,'b');hold on;grid on;

ylabel('b_{g_3} (deg/s)');

xlabel('Time (sec)');

set(h6,'LineWidth',2);

🔗 参考文献


🍅往期回顾扫扫下方二维码


相关文章
|
4月前
|
机器学习/深度学习 编解码 自动驾驶
行人细分目标检测数据集:3类别、4,000张图像 | 目标检测
本数据集含4000张真实道路图像,创新性地将行人细分为三类:pedestrian(行为行人)、ped(旁观人员)、people(人群),支持YOLO等模型训练,专为提升自动驾驶中行人语义理解与风险决策能力而设计。(239字)
317 1
|
关系型数据库 数据库 文件存储
|
设计模式 安全 Java
单例模式:饿汉模式、懒汉模式
单例模式:饿汉模式、懒汉模式
641 0
|
10月前
|
机器学习/深度学习 人工智能 编解码
工业织物缺陷目标检测数据集(1000+高精度标注样本)| AI训练适用于目标检测任务
工业织物瑕疵检测并非简单的目标检测问题,而是一个融合了弱特征感知、噪声抑制与细粒度识别的综合挑战。本文介绍的数据集,正是围绕这一核心难点构建,具备较高的工程与研究价值。 无论是用于工业落地,还是作为算法验证基准,该数据集都为复杂弱纹理场景下的智能视觉检测研究提供了可靠支撑。 随着更先进的模型结构与训练策略不断涌现,基于此类真实工业数据集的探索,将持续推动智能制造向更高精度、更高可靠性方向发展。
工业织物缺陷目标检测数据集(1000+高精度标注样本)| AI训练适用于目标检测任务
|
12月前
|
编译器 程序员 Linux
实用工具:VS Code 配置 Markdown 编译器全指南
本文介绍如何在VS Code中配置高效Markdown写作环境,通过启用内置预览、安装Markdown All in One与Markdown Preview Enhanced插件,并配置Princexml实现PDF等格式导出,全面提升编辑、预览与输出效率,适合程序员、学生及内容创作者使用。
7206 2
实用工具:VS Code 配置 Markdown 编译器全指南
|
机器学习/深度学习 算法 机器人
【PID】基于人工神经网络的PID控制器,用于更好的系统响应研究(Matlab&Simulink代码实现)
【PID】基于人工神经网络的PID控制器,用于更好的系统响应研究(Matlab&Simulink代码实现)
1596 16
|
10月前
|
人工智能 自然语言处理 安全
企业级智能客服系统建设方案(2026年2月最新)
工信部《白皮书(2026)》显示,智能客服在金融、电商、电信渗透率超72%,响应仅1.8秒,FCR达76.4%。瓴羊Quick Service融合通义大模型、知识图谱与情绪识别,支持15+渠道统一接入、多语言合规部署,助力企业实现高可用、可扩展、安全可控的智能客服升级。(239字)
|
人工智能 JavaScript 开发者
解决 AI 落地“最后一公里”:如何优雅地将 Gemini 深度内容无损转为 Word 文档?
本文探讨如何将Gemini生成的Markdown内容无损转换为Word文档,破解公式乱码、图表失效、格式错乱三大难题。对比Google Docs原生导出、Pandoc命令行工具与在线方案,从易用性、公式支持、图表渲染等维度评测,助你高效产出可编辑、高保真的专业文档,实现AI写作到办公交付的无缝衔接。
4478 0
解决 AI 落地“最后一公里”:如何优雅地将 Gemini 深度内容无损转为 Word 文档?
|
12月前
|
机器学习/深度学习 人工智能 运维
构建AI智能体:六十二、金融风控系统:基于信息熵和KL散度的异常交易检测
本文介绍了一种基于信息论的智能金融风控系统,通过KL散度、信息增益和熵等核心概念构建欺诈检测框架。系统首先生成模拟金融交易数据,区分正常与欺诈交易;然后计算各特征的数据熵和KL散度,量化分布差异;再训练随机森林模型进行预测,并创新性地结合概率和不确定性计算风险得分。实验表明,设备风险是最强欺诈指标,系统AUC达1.0,能有效识别典型欺诈模式(大额、深夜、高频交易)。该方法将抽象信息论转化为实用解决方案,在保持高性能的同时增强了模型可解释性,为智能风控提供了量化分析框架。
951 3
|
12月前
|
机器学习/深度学习 传感器 人工智能
小麦田间叶片病害目标检测数据集(2000 张已标注):面向目标检测的农业智能识别
本数据集包含2000张高分辨率小麦田间叶片图像,涵盖大麦黄矮病、叶锈病、白粉病及健康叶片四类,标注格式适配YOLO系列模型。数据源自无人机巡检与实地采样,覆盖多种气候与地貌环境,适用于农业病害智能识别、无人机巡检、数字农业平台构建及AI科研教学,助力实现小麦病害精准监测与智能化管理。
小麦田间叶片病害目标检测数据集(2000 张已标注):面向目标检测的农业智能识别