✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
多无人机(UAV)协同目标分配是多无人机协同控制的重要内容之一.针对多无人机协同侦察问题,以提高作战效能,减少侦察代价和任务完成时间为目的进行目标分配,首先建立了目标分配问题的数学模型,在初始分配的基础上,使用基于合同网的目标分配方法,引入负载系数参数,最后通过迭代执行买卖合同与交换合同实现了任务的合理分配.由仿真结果可知,算法能够给出很好的优化效果的分配方案,并有很好的可扩展性.
⛄ 部分代码
close all
clc
clear
num_of_UAVs = 4; % Num of UAVs
time = 1300;
sample_arena = Arena; % Arena , If you want to change the position of static
% Obstacals, see the Arena.m file
tic
for i = 1:1:num_of_UAVs
% Initialising the Aircrafts
UAVs(i) = AirCraft(i);
end
sample_mission_planner = mission_planner(UAVs, sample_arena );
% Initialising the mission planner
N = time/sample_arena.dt;
%% Loop run
for i = 1:1:N
for k = 1:1:numel(UAVs)
sample_mission_planner.plan_mission(k);
% Plan mission i,e get the new command for the k-th UAV
end
for k = 1:1:numel(UAVs)
UAVs(k).move(sample_arena);
% move the K-th UAV
end
end
toc
%% Figure plots
figure (1);
hold on
for l = 1:1:num_of_UAVs
X = [UAVs(l).vehical_log.x];
Y = [UAVs(l).vehical_log.y];
Z = [UAVs(l).vehical_log.h];
if l == 1
plot3(X , Y , Z,'y')
elseif l == 2
plot3(X , Y , Z , 'g')
elseif l == 3
plot3(X , Y , Z , 'k')
end
end
buildings = sample_arena.static_object;
plot([buildings(1).x;buildings(2).x;buildings(3).x;buildings(4).x] , [buildings(1).y;buildings(2).y;buildings(3).y;buildings(4).y],'bs')
title('Routes followed by the UAVs','fontsize',7)
xlabel('East(m)')
ylabel('North(m)')
zlabel('Up(m)')
axis equal , grid on , pause(0.01),hold off;
for i = 1:1:num_of_UAVs
speed(:,i) = [UAVs(i).vehical_log.v];
heading(:,i) = [UAVs(i).vehical_log.psi];
bank(:,i) = [UAVs(i).vehical_log.phi];
height(:,i) = [UAVs(i).vehical_log.h];
end
figure(3)
subplot(4,1,1)
plot(speed)
xlabel('time (s)','fontsize',7)
ylabel('air spd (m/s)','fontsize',7)
subplot(4,1,2)
plot(heading)
xlabel('time (s)','fontsize',7)
ylabel('hdg (deg)','fontsize',7)
subplot(4,1,3)
plot(bank)
xlabel('time (s); solid - actual; dotted - cmd','fontsize',7)
ylabel('bank (deg)','fontsize',7)
subplot(4,1,4)
plot(height)
xlabel('time (s)','fontsize',7)
ylabel('ht (m)','fontsize',7)
⛄ 运行结果
⛄ 参考文献
[1] 钱艳平, 夏洁, 刘天宇. 基于合同网的无人机协同目标分配方法[C]// CNKI. CNKI, 2011:5.
[2] 常松, 贾子彦. 基于改进合同网算法的多无人机任务分配[J]. 物联网技术, 2020, 10(5):3.