1 概述
无人机现在利用最佳搜索策略,使用PRISM模型检查器生成,以寻找目标。本文设计并编写了一种对抗性模式搜索算法来比较性能。
四旋翼无人机由于具有可悬停,可垂直起降,在设计速度范围内向任意方向飞行的运动特点,以及结构简单,构造容易,成本低廉等特点,被广泛运用于巡检、救灾、农业植保等各个领域。对于四旋翼无人机来说,运动规划就是在给定的障碍环境中,从无人机当前的未知到给定摘要未知找到一条安全的无人机可以执行的轨迹,而在未知环境下进行运动规划是无人机执行复杂任务的关键能力。本文以此为应用研究背景,从软件系统设计层面,本文的研究主要包括三个关键方面:路径规划、轨迹规划以及在未知环境下整个运动规划系统控制问题。本文首先针对四旋翼无人机的硬件平台及飞行系统,对未知环境下的运动规划应用进行了分析,将整个应用分成了:地图表示、运动规划、安全检测、状态管理四个关键组成。确立了以运动规划问题为主要研究对象,并结合运动规划问题的评价标准,使用路径规划加轨迹规划来解决运动规划问题。对于路径规划问题,本文采用确定性算法,采用路径搜索的思想在真实环境下规划出一条最短路径。使用状态栅格算法,基于四旋翼无人机的运动学,通过离散控制空间的方法构建搜索图并使用图搜素算法找到最优路径,并对状态栅格算法进行了改进,通过解决最优边界值问题基于运动学重新设计了算法的启发式函数,提高了图搜素过程的速度,并通过仿真实验对结果进行了验证。
2 运行结果
3 部分Matlab代码实现
% Monte Carlo simulation script based on RunSimSingle.
% Runs 1000 instances of the simulation recording run time and mission
% status.
close all
clearvars -except h GlobalTime Count Run Runs SaveFile
clc
fprintf('-----------------------------------------------------\n')
fprintf('Monte Carlo Simulation of UAV\n')
fprintf('Douglas H Fraser\n')
fprintf('March 2019\n')
fprintf('-----------------------------------------------------\n\n')
SimTime = tic;
NumSims = 100;
fprintf('Running %d simulations...\n\n', NumSims)
results = ["Sim #","Time","Status","Battery Used","Remaining Objects","Initial Search Mode","Final Search Mode","Details"];
% Simulation Loop --------------------------------------------------
for simNum = 1:NumSims
close all
clearvars -except h GlobalTime row results simNum NumSims Count Run Runs SaveFile
% Initialize controller and environment for simulation.
DecisionsFile = 'ControllerV2/scenario3b_5x5_1'; % Initial state: 303
[States, Transitions] = LoadDecisions(DecisionsFile);
Environment = cEnvironment('Grid size',[5, 5]);
Agents.Quad = cQuadrotor('Quad',Environment,'Pose',[0 0 0 0 0 0]',...
'States', States, 'Transitions', Transitions);
% Targets
NumTargets = 3;
Shapes = {'Cube','Ball','Pyramid'};
for i = 1:NumTargets
Agents.Target(i) = cTarget(Shapes{i},Environment);
end
% Simulation properties
t = 0; % Initialise time (s)
tfin = 500; % End time (s)
dt = 0.002; % Solver increment (s)
tsamp = dt; % Sample increment (s)
tsamp = 0.05;
% Initialise blackbox
Data = cBlackBox;
% Initialise
Sim = cSimEngine(Data,Environment,Agents,t,tfin,dt,tsamp);
% Simulation loop
fprintf('Running instance #%d of %d\n', simNum, NumSims)
Data = Sim.SimLoop;
fprintf('\nInstance #%d of %d complete\n', simNum, NumSims)
fprintf('Time taken: %.2f s\n\n',Sim.Time)
%fprintf('Mission Status:', ,'\n\n',toc(SimTime))
Quad = Sim.Agents.Quad;
TargetsRemaining = Quad.NumTargets - Quad.TargetCount;
if Quad.MissionComplete
status = "Success";
else
status = "Failed";
end
entry = [mat2str(simNum), mat2str(Sim.Time), mat2str(Quad.MissionComplete), mat2str(Quad.BatteryUsage), mat2str(TargetsRemaining), Quad.InitialSearchType, Quad.SearchType, Quad.FailureType];
results = [results;entry];
%if mod(row,10)
% writetable(cell2table(num2cell(results)),"MCResults.xlsx",'Sheet',1,'Range',strcat("A",mat2str(row+1),":H",mat2str(row+11)))
% results = [];
%else
% row = row + 1;
%end
end
fprintf("Simulations complete; writing results to CSV file.\n")
writetable(cell2table(num2cell(results)),"MCResults.xlsx")
fprintf("Complete: Results table successfully written.\n")
4 数据
后台私信博主。