【无人机】基于遗传算法实现无人机编队位置规划附matlab代码

2023-05-16

 1 内容介绍

现代社会的无人机成本造价低、不易损耗、轻巧灵便、易躲藏、能精确打击

目标这些特点,使其在一些高危任务中发挥了不可替代的作用[5]。无人机的用处主要有两种:民用和军事。在民用方面,我们可以运用无人机对一些可能出现隐患的事物进行监控,比如对震后灾区的地面勘探、森林火灾的检测、风暴中心的气象数据等。在 2014 索契奥运会上,无人机携带的摄像拍摄的画面更贴近运动员,画质更为清晰,2018 中国新年春晚上大量无人机组成的海豚造型惊艳了世界。在军事方面,我们可以运用无人机进行一些特殊任务的执行,比如对毒贩的监视工作,边境的巡防工作,无人机侦查、搜救、预警等。无人机的运用使我们在一些事情上实现了无人员伤亡。军事无人机是当今时代无人机技术的高水准体现。伴随着日益成熟的无人机技术,对航路规划的研究也愈加深入。航路规划的前提是在一定的约束条件下,然后寻求可飞行航路。对于无人机而言它自身的主要约束条件有:最大的载重量、可以上升的门限高度、空载时耗油量、起飞时承载的重量等,在飞行时要考虑地形存在的威胁和是否存在禁飞区等。相对国外研究,我国还没有比较成熟的航路规划体系,但是对航路规划的研究热情我国日益加强.飞行过程中有时会遇到一些突发事故,无人机在此时不能按照预先规划的航迹继续进行,需要无人机能够在当前的环境下动态的规划出一条满足要求的航路,也说明了航路规划的静态和实时动态规划相结合的算法是我们未来的一个研究趋势。

随着现代社会的不断发展,电子信息技术研究不断深入,无人机航路规划越

来越智能化。现代社会由于飞机的特殊性,其安全性一直是我们最为关心的话题,因为一旦发生一点点事故,往往伴随着生命的代价,所以在面对一些内部环境比较复杂的地方时,可以使用一些有着特殊功能的无人机,它们在无人的状态下可以将性能调整到最优,在执行任务的过程中不用担心其产生人员伤亡,而且无人机的活动区域比较广泛,不限单次使用,能够执行多种任务。现代战场上无人机的威力发挥很大程度上取决于航路规划的合理性。根据模型,航路规划通常会产生很多条满足条件的航路,而我们要做的就是快速、准确找到这些满足要求航路中的最优一条。随着无人机的硬件和软件技术的不断成熟,无人机航路规划技术也必将得到更好的发展和更广泛的应用.​

2 仿真代码

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% E150 Genetic Algorithm Evolution Visualizer
% Avery Rock, UC Berkeley Mechanical Engineering, avery_rock@berkeley.edu
% Written for E150, Fall 2019.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function familyTree(Orig, parents, pop)
%%

% Inputs: 
%   Orig -- the indices of a sorted GA generation from before sorting (see sort() documentation), 
%   parents -- the number of parents, required for interpreting source
%   pop --  the number of performers to plot. Use pop >= parents. 

% Returns: 
% no variables, plots a representation of the evolution history to the current figure. 

% The function automatically ignores generations where no rank changes
% occur among the parents OR there are any repeated indices (indicating
% incorrect data). 

% Data visualization: This function can be used to visualize and interpret the performance of
% your GA iteration process. Gray lines represent "survival" with or
% without a rank change. Red lines represent breeding (e.g.,  a new string
% will be connected to its parents with red lines). New random strings have
% no connections. A surviving string will be represented with gray, a new
% string generated randomly will be a blue mark and a new string generated
% by breeding will be red.

% Performance interpretation: If your GA is working correctly, there should
% be lots of turnover (i.e., few generations where nothing happens),
% significant numbers of successful offspring and a moderate number of
% successful random strings. You can also spot stagnation (a parent
% surviving for many generations and continually producing offspring that
% stay in the top ranks). 

%%

Orig2 = Orig(:, 1:pop); % trim source to just relevant entries.
row = 0; changes = []; % initialize variables for determining relevant generations
children = parents; % assume nearest-neighbor with two children
rando = zeros(0, 2); inc = zeros(0, 2); kid = zeros(0, 2); % intialize empty storage arrays
G = size(Orig, 1); % total number of generations.
pts = 25; % number of points to plot in connections
c1 = [.6 .6 .6]; c2 = [1 .6 .6]; % line colors for surviving connections and children
lw = 1.5; % connection line weight
mw = 1.5; % marker line weight

incx = zeros(pts, 2); incy = zeros(pts, 2); % empty arrays for connecting line coordinates.
kidx = zeros(pts, 2); kidy = zeros(pts, 2);

for g = 1:G % for every generation
    if ~isequal(Orig2(g, 1:parents), 1:parents) && length(unique(Orig2(g, :))) == pop % if a change in survivors and valid data
        row = row + 1; % row on which to plot current state - counts relevant generations
        x1 = row - 1; x2 = row; % start and end points of connections
        changes = [changes; g]; % record that a change occured in this generation
        for i = 1:pop
            s = Orig2(g, i); y2 = i;
            if s == i && i <= parents && g > 1 % if the entry is a surviving parent who has not moved
                y1 = i;
                [xx, yy] = mySpline([x1 x2], [y1 y2], pts);
                incx = [incx, xx]; incy = [incy, yy];
                inc = [inc; [x2, y2]];
            elseif  s <= parents && g > 1% if the entry is a surviving parent who has been moved down
                y1 = s;
                [xx, yy] = mySpline([x1 x2], [y1 y2], pts);
                incx = [incx, xx]; incy = [incy, yy];
                inc = [inc; [x2, y2]];
            elseif s <= parents + children && g > 1 % if the entry is a child
                for n = 2:2:children
                    if s <= parents + n
                        y11 = n - 1; y12 = n;
                        [xx1, yy1] = mySpline([x1, x2], [y11, y2], pts);
                        [xx2, yy2] = mySpline([x1, x2], [y12, y2], pts);
                        kidx = [kidx, xx1, xx2]; kidy = [kidy, yy1, yy2];
                        kid = [kid; [x2, y2]];
                        break
                    end
                end
            else % if it's a new random addition.
                rando = [rando; [x2, y2]];
            end
        end
    end
end

p1 = plot(incx, incy, '-', 'Color', c1, 'LineWidth', 1.5); hold on
p2 = plot(kidx, kidy, '-', 'Color', c2, 'LineWidth', 1.5); hold on
p3 = plot(rando(:, 1), rando(:, 2), 's', 'MarkerEdgeColor', [.2 .4 .9], 'MarkerFaceColor', [.6 .6 1], 'MarkerSize', 10, 'LineWidth', mw); hold on % plot random
p4 = plot(inc(:, 1), inc(:, 2), 's', 'MarkerEdgeColor', [.3 .3 .3], 'MarkerFaceColor', [.6 .6 .6], 'MarkerSize', 10, 'LineWidth', mw); hold on % plot survival
p5 = plot(kid(:, 1), kid(:, 2), 's', 'MarkerEdgeColor', [.9 .3 .3], 'MarkerFaceColor', [1 .6 .6], 'MarkerSize', 10, 'LineWidth', mw); % plot children
h = [p3, p4, p5];
legend(h, "Random", "Incumbent", "Child")

xlabels = {};
for i = 1:numel(changes)
    xlabels{i} = num2str(changes(i));
end

ylabels = {};
for j = 1:pop
    ylabels{j} = num2str(j);
end

title("Family Tree");
set(gca, 'xtick', [1:row]); set(gca,'ytick', [1:pop]);
set(gca,'xticklabel', xlabels); set(gca,'yticklabel', ylabels);
xlabel("generation"); ylabel("Rank");
axis([0 row + 1 0 pop + 1]); view([90, 90])
end

function [xx, yy] = mySpline(x, y, pts)
% produces clamped splines between two points 

% Inputs: 
%   x -- 2-value vector containing the x coordinates of the end points
%   y -- 2-value vector containing the y coordinates of the end points
%   pts -- the number of total points to plot (ends plus intermediates)

% Returns: 
%    xx -- array of x coordinates to plot
%    yy -- array of y coordinates to plot

cs = spline(x, [0 y 0]);
xx = linspace(x(1), x(2), pts)';
yy = ppval(cs,xx);
end

UAV swarms have numerous applications in our modern world. They can facilitate mapping, observing, and overseeing large areas with ease. It is necessary for these agents to autonomously navigate potentially dangerous terrain and airspace in order to log information about areas. In this project, we simulate the motion of a swarm of drones, and their interaction with obstacles, and targets.

The goal of this project is to optimize this simulation using a Genetic Algorithm to maximize the number of targets mapped, minimize the number of crashed drones, and minimize the amount of time used in the simulation. To do this, we will use 15 design parameters to determine the dynamics and kinematics of each drone, using Forward Euler time discretization to update drone positions.

A Genetic Algorithm will be used to train this swarm of drones by generating random strings of design parameters, and breeding new strings to find the optimal string for this simulation.

In this paper, I will present relevant background information, and equations to describe the simulation. I will also describe the process by which I go about optimizing the Genetic Algorithm. Finally, I present the outcome of the simulation and Genetic Algorithm, and discuss the relevance of my results.

3 运行结果

4 参考文献

[1]杨军, 王道波, 渠尊尊,等. 基于元胞遗传算法的多无人机编队集结路径规划[J]. 机械与电子, 2018, 36(1):5.

[2]黄书召, 田军委, 乔路,等. 基于改进遗传算法的无人机路径规划[J].  2021.

[3]邵壮. 多无人机编队路径规划与队形控制技术研究[D]. 西北工业大学.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

【无人机】基于遗传算法实现无人机编队位置规划附matlab代码 的相关文章

  • 微内核和宏内核

    https zhuanlan zhihu com p 53612117
  • ARMv7-A/R/M系列 --- 简介

    1 简介在ARM11之后的处理器家族 xff0c 改采Cortex命名 xff0c 并针对高 中 低阶分别划分为A R M三大处理器 像是高阶手机用的Coretex A系列 xff0c 或者是微控制器所使用的Coretex M系列 xff0
  • ubuntu-C++Demo处理数据的一些小知识点

  • enum类型变量的使用和赋值

    enum 是枚举型 union 是共用体 xff0c 成员共用一个变量缓冲区 现在基本已经不用了 枚举类型 在实际问题中 xff0c 有些变量的取值被限定在一个有限的范围内 例如 xff0c 一个星期内只有七天 xff0c 一年只有十二个月
  • 单总线和多总线的区别

    在计算机系统的硬件组成中 xff0c 总线 xff08 Bus xff09 是不可缺少的一部分 xff0c 将各大基本部件按照一定的方式链接起来就构成了计算机硬件系统 就目前来讲 xff0c 许多微型计算机的各大部件之间都是用总线链接起来的
  • Win7系统下怎么扩大C盘容量 合并磁盘分

    C磁盘空间总是不够用 有没有想过把磁盘扩大点呢 下面小编就教你个办法 xff0c 把其他盘的空间转换成C盘的容量 xff0c 这要怎么弄呢 其实挺简单的 方法如下 xff1a 1 首先从电脑桌面左下脚开始里面进去找到 计算机 找到计算机名称
  • 操作系统与应用程序的关系

    操作系统与应用程序的关系 操作系统主要可以分为两大部分 xff1a 内核和内核之外的一些程序 内核就是直接控制最底层的硬件 xff0c 而我们日常所用到的软件 xff0c 大都是通过内核之外一些程序与内核之间的接口完成的 xff0c 例如W
  • GSM系统构成(NSS,OSS,BSS,MS)

    第一部分NSS EIR HLR AUC MSC VLR EIR Equipment identify register装备身份注册 HLR Home Location Register 归属位置寄存器 AUC Authentication
  • DSP指数编码器(EXP)工作原理

    例 xff1a 完成对累加器A的归一化处理 EXP A 多余符号位数 8 T寄存器 ST T EXPONENT 将保存在T寄存器中的指数存入指定的数据存储器中 NORM A 对累加器A进行归一化处理 40位累加器A中的定点数FF FFFF
  • VS C++调用Lua动态链接库

    这里使用的是VS2019 xff0c 其他版本类似 新建一个控制台应用 创建好工程后 xff0c 打开工程属性页 进入C C 43 43 gt 常规 gt 附加包含目录 xff0c 将lua的头文件目录包含进去 进入链接器 gt 输入 gt
  • Unity 如何判断GameObject是否为Prefab

    public static bool IsPrefabInstance UnityEngine GameObject obj var type 61 PrefabUtility GetPrefabAssetType obj var stat
  • Git 常用命令

    注册用户名和邮箱 xff1a git config global user name username git config global user email useremail 查看log的快捷定义 xff1a 在C Users 当前用
  • C++值赋值运算符重载

    C 43 43 值赋值运算符重载的格式是这样的 xff1a 类名 amp span class hljs keyword operator span xff08 span class hljs keyword const span 类名 a
  • 学习笔记:GDB 调试

    01 什么是GDB GDB 是由 GNU 软件系统社区提供的调试工具 xff0c 同 GCC 配套组成了一套完整的开发环境 xff0c GDB 是 Linux 和许多类 Unix 系统中的标准开发环境 一般来说 xff0c GDB 主要帮助
  • C++之类对象的返回与引用

    一 类对象的返回 在拷贝构造器中提到过 xff1a class span class hljs literal A span span class hljs comment span span class hljs literal A sp
  • 字符串的操作

    一 字符串的初始化 1 定长字符数组 1 gt span class hljs keyword char span buf1 span class hljs number 128 span 61 span class hljs string
  • 哈希表的大小为什么最好是素数

    在看数据结构和算法分析这本书的时候 xff0c 哈希表建议大小为素数 xff0c 但里面并没有详细说明为什么 xff0c 只说了因为它在哈希表最小化集群 xff0c 这又是为什么 xff0c 我通过百度 xff0c 外加自己的理解说明一下为
  • selenium webdriver定位iframe里的body方法

    1 iFrame有ID 或者 name的情况 进入id 61 frame1 的frame中 xff0c 定位id 61 div1 的div和id 61 input1 的输入框 dr switchTo frame frame1 dr find
  • unity-实现摄像机跟随物体(Vector3.SmoothDamp)

    直接贴代码 span class hljs keyword using span UnityEngine span class hljs keyword using span System Collections span class hl
  • unity-UGUI隐藏按钮

    方法1 xff1a Button btn span class hljs comment span btn span class hljs preprocessor gameObject span span class hljs prepr

随机推荐