【无人机路径规划】基于视觉 SLAM 算法的粒子群优化无人机路径规划附matlab复现
✅作者简介:热爱数据处理、建模、算法设计的Matlab仿真开发者。
🍎更多Matlab代码及仿真咨询内容点击 🔗:Matlab科研工作室
🍊个人信条:格物致知。
🔥 内容介绍
我们使用最先进的视觉同步定位和建图(VSLAM)方法来追踪无人机位姿,同时逐步构建周围环境的增量地图。在这方面,首先使用单目视觉方法来绘制感兴趣区域的地图。构建的地图被处理为优化算法的输入手段,以规划多架无人机的最佳路径。我们设计了一个基于粒子群优化(PSO)的路径规划器,并提出了一个基于区域敏感性(RS)的路径更新机制,以避免在执行最终路径时检测到危险事件时的敏感区域。此外,我们提出了一个动态适应度函数(DFF),以评估路径规划器的规划策略,同时考虑各种优化参数,如飞行风险估计、能量消耗和操作完成时间。所提出的规划器获得了较高的适应度值,并安全地到达目的地,同时遵循最短路径,避免所有意外的危险事件和限制区域,这验证了我们提出的 PSO-VSLAM 系统的有效性,如仿真结果所示。**避开了所有意外的危险事件和限制区域,这验证了我们提出的 PSO-VSLAM 系统的有效性,如仿真结果所示。
📣 部分代码
function [isLoopClosed, mapPoints, vSetKeyFrames] = helperAddLoopConnections(...mapPoints, vSetKeyFrames, loopCandidates, currKeyFrameId, currFeatures, currPoints, intrinsics)%helperAddLoopConnections add connections between the current key frame and% the valid loop candidate key frames. A loop candidate is valid if it has% enough covisible map points with the current key frame.% This is an example helper function that is subject to change or removal% in future releases.% Copyright 2019 The MathWorks, Inc.scaleFactor = 1.2;imageSize = [480, 640];% Minimum number of matched features for loop edgeminNumMatches = 60;numCandidates = size(loopCandidates,1);loopConnections = [];[index3d1, index2d1] = getProjectionIndexPair(mapPoints, currKeyFrameId);validFeatures1 = currFeatures.Features(index2d1, :);validPoints1 = currPoints(index2d1).Location;for k = numCandidates : -1 : 1[index3d2, index2d2] = getProjectionIndexPair(mapPoints, loopCandidates(k));allFeatures2 = vSetKeyFrames.Views.Features{loopCandidates(k)};validFeatures2 = allFeatures2(index2d2, :);allPoints2 = vSetKeyFrames.Views.Points{loopCandidates(k)};validPoints2 = allPoints2(index2d2);indexPairs = matchFeatures(binaryFeatures(validFeatures1), binaryFeatures(validFeatures2), ...'Unique', true, 'MaxRatio', 0.9, 'MatchThreshold', 90);% Check if all the candidate key frames have strong connection with the% current keyframeif size(indexPairs, 1) < minNumMatchesisLoopClosed = false;returnend% Estimate the relative pose of the current key frame with respect to the% loop candidate keyframe with the highest similarity scoreif k == 1worldPoints = mapPoints.Locations(index3d2(indexPairs(:,2)),:);matchedImagePoints = cast(validPoints1(indexPairs(:,1),:), 'like', worldPoints);[worldOrientation, worldLocation] = estimateWorldCameraPose(matchedImagePoints, worldPoints, intrinsics, ...'Confidence', 90, 'MaxReprojectionError', 6, 'MaxNumTrials', 1e4);cameraPose = rigid3d(worldOrientation, worldLocation);[R, t] = cameraPoseToExtrinsics(cameraPose.Rotation, cameraPose.Translation);xyzPoints = mapPoints.Locations(index3d2,:);projectedPoints = worldToImage(intrinsics, R, t, xyzPoints);isInImage = find(projectedPoints(:,1)<imageSize(2) & projectedPoints(:,1)>0 & ...projectedPoints(:,2)< imageSize(1) & projectedPoints(:,2)>0);minScales = validPoints2.Scale(isInImage)/scaleFactor;maxScales = validPoints2.Scale(isInImage)*scaleFactor;r = 3;searchRadius = r*validPoints2.Scale(isInImage);matchedIndexPairs = helperMatchFeaturesInRadius(validFeatures2(isInImage,:), currFeatures.Features, ...validPoints2(isInImage), currPoints, projectedPoints(isInImage,:), searchRadius, minScales, maxScales);matchedIndexPairs(:,1) = isInImage(matchedIndexPairs(:,1));visiblePointsIndex = index3d2(matchedIndexPairs(:,1));validWorldPoints = mapPoints.Locations(visiblePointsIndex, :);matchedImagePoints = currPoints.Location(matchedIndexPairs(:,2),:);% Refine the posecameraPose = bundleAdjustmentMotion(validWorldPoints, matchedImagePoints, ...cameraPose, intrinsics, 'PointsUndistorted', true, 'AbsoluteTolerance', 1e-7,...'RelativeTolerance', 1e-15, 'MaxIteration', 50);% Fuse covisible map points[matchedIndex2d1, ia1, ib1] = intersect(index2d1, matchedIndexPairs(:,2), 'stable');matchedIndex3d1 = index3d1(ia1);matchedIndex3d2 = index3d2(matchedIndexPairs(ib1,1));matchedIndex2d2 = index2d2(matchedIndexPairs(ib1,1));mapPoints = updateLocation(mapPoints, mapPoints.Locations(matchedIndex3d2, :), matchedIndex3d1);% Add connection between the current key frame and the loop key framepose1 = vSetKeyFrames.Views.AbsolutePose(loopCandidates(k));pose2 = cameraPose;relPose = rigid3d(pose2.Rotation*pose1.Rotation', (pose2.Translation-pose1.Translation)*pose1.Rotation');matches = [matchedIndex2d2, matchedIndex2d1];vSetKeyFrames = addConnection(vSetKeyFrames, loopCandidates(k), currKeyFrameId, relPose, 'Matches', matches);disp(['Loop edge added between keyframe: ', num2str(loopCandidates(k)), ' and ', num2str(currKeyFrameId)]);% Add connections between the current key frame and the connected% key frames of the loop key frameneighborViews = connectedViews(vSetKeyFrames, loopCandidates(k));for m = 1:numel(neighborViews.ViewId)neighborViewId = neighborViews.ViewId(m);[index3d3, index2d3] = getProjectionIndexPair(mapPoints, neighborViewId);[covPointsIndices, ia2, ib2] = intersect(index3d3, matchedIndex3d2, 'stable');if numel(covPointsIndices) > minNumMatchespose1 = neighborViews.AbsolutePose(m);pose2 = cameraPose;relPose = rigid3d(pose2.Rotation*pose1.Rotation', (pose2.Translation-pose1.Translation)*pose1.Rotation');matches = [index2d3(ia2), matchedIndex2d1(ib2)];if ~hasConnection(vSetKeyFrames, neighborViewId, currKeyFrameId)vSetKeyFrames = addConnection(vSetKeyFrames, neighborViewId, currKeyFrameId, relPose, 'Matches', matches);enddisp(['Loop edge added between keyframe: ', num2str(neighborViewId), ' and ', num2str(currKeyFrameId)]);endendisLoopClosed = true;endendend
⛳️ 运行结果


🔗 参考文献
[1] Mughal U A , Ahmad I , Pawase C J ,et al.UAVs Path Planning by Particle Swarm Optimization Based on Visual-SLAM Algorithm[J]. 2022.DOI:10.1007/978-981-19-1292-4_8.
🎈 部分理论引用网络文献,若有侵权联系博主删除
🎁 关注我领取海量matlab电子书和数学建模资料
👇 私信完整代码和数据获取及论文数模仿真定制
1 各类智能优化算法改进及应用
生产调度、经济调度、装配线调度、充电优化、车间调度、发车优化、水库调度、三维装箱、物流选址、货位优化、公交排班优化、充电桩布局优化、车间布局优化、集装箱船配载优化、水泵组合优化、解医疗资源分配优化、设施布局优化、可视域基站和无人机选址优化、背包问题、 风电场布局、时隙分配优化、 最佳分布式发电单元分配、多阶段管道维修、 工厂-中心-需求点三级选址问题、 应急生活物质配送中心选址、 基站选址、 道路灯柱布置、 枢纽节点部署、 输电线路台风监测装置、 集装箱船配载优化、 机组优化、 投资优化组合、云服务器组合优化、 天线线性阵列分布优化
2 机器学习和深度学习方面
2.1 bp时序、回归预测和分类
2.2 ENS声神经网络时序、回归预测和分类
2.3 SVM/CNN-SVM/LSSVM/RVM支持向量机系列时序、回归预测和分类
2.4 CNN/TCN卷积神经网络系列时序、回归预测和分类
2.5 ELM/KELM/RELM/DELM极限学习机系列时序、回归预测和分类
2.6 GRU/Bi-GRU/CNN-GRU/CNN-BiGRU门控神经网络时序、回归预测和分类
2.7 ELMAN递归神经网络时序、回归\预测和分类
2.8 LSTM/BiLSTM/CNN-LSTM/CNN-BiLSTM/长短记忆神经网络系列时序、回归预测和分类
2.9 RBF径向基神经网络时序、回归预测和分类
2.10 DBN深度置信网络时序、回归预测和分类
2.11 FNN模糊神经网络时序、回归预测
2.12 RF随机森林时序、回归预测和分类
2.13 BLS宽度学习时序、回归预测和分类
2.14 PNN脉冲神经网络分类
2.15 模糊小波神经网络预测和分类
2.16 时序、回归预测和分类
2.17 时序、回归预测预测和分类
2.18 XGBOOST集成学习时序、回归预测预测和分类
方向涵盖风电预测、光伏预测、电池寿命预测、辐射源识别、交通流预测、负荷预测、股价预测、PM2.5浓度预测、电池健康状态预测、用电量预测、水体光学参数反演、NLOS信号识别、地铁停车精准预测、变压器故障诊断
2.图像处理方面
图像识别、图像分割、图像检测、图像隐藏、图像配准、图像拼接、图像融合、图像增强、图像压缩感知
3 路径规划方面
旅行商问题(TSP)、车辆路径问题(VRP、MVRP、CVRP、VRPTW等)、无人机三维路径规划、无人机协同、无人机编队、机器人路径规划、栅格地图路径规划、多式联运运输问题、 充电车辆路径规划(EVRP)、 双层车辆路径规划(2E-VRP)、 油电混合车辆路径规划、 船舶航迹规划、 全路径规划规划、 仓储巡逻
4 无人机应用方面
无人机路径规划、无人机控制、无人机编队、无人机协同、无人机任务分配、无人机安全通信轨迹在线优化、车辆协同无人机路径规划
5 无线传感器定位及布局方面
传感器部署优化、通信协议优化、路由优化、目标定位优化、Dv-Hop定位优化、Leach协议优化、WSN覆盖优化、组播优化、RSSI定位优化
6 信号处理方面
信号识别、信号加密、信号去噪、信号增强、雷达信号处理、信号水印嵌入提取、肌电信号、脑电信号、信号配时优化
7 电力系统方面
微电网优化、无功优化、配电网重构、储能配置、有序充电
8 元胞自动机方面
交通流 人群疏散 病毒扩散 晶体生长 金属腐蚀
9 雷达方面
卡尔曼滤波跟踪、航迹关联、航迹融合
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)