欢迎来到本博客❤️❤️
博主优势:博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
目录
1 概述
2 运行结果
3 参考文献
4 Matlab代码实现
无人机的路径规划技术是囊括数学、计算机科学、统计学、运动学和人工智能等多学科交叉的研究成果,其发展对我国军事、交通、农业和电影业等领域具有一定的影响,已成为高科技领域的研究热点之一。,研究了在三维窄通道和三维山区环境下球形矢量的粒子群优化 (SPSO) 算法的无人机路径规划。本文基于球形矢量的粒子群优化 (SPSO) 算法实现用于无人机(UAV)的路径规划。但是,可以对其进行修改以应用于其他优化问题。
部分代码:
% Convert the solution from spherical space to Cartesian coordinates
function position = SphericalToCart(sol,model)
% Start location
xs = model.start(1);
ys = model.start(2);
zs = model.start(3);
% Solution in Sperical space
r = sol.r;
psi = sol.psi;
phi = sol.phi;
% First Cartesian coordinate
x(1) = xs + r(1)*cos(psi(1))*sin(phi(1));
% Check limits
if x(1) > model.xmax
x(1) = model.xmax;
end
if x(1) < model.xmin
x(1) = model.xmin;
end
y(1) = ys + r(1)*cos(psi(1))*cos(phi(1));
if y(1) > model.ymax
y(1) = model.ymax;
end
if y(1) < model.ymin
y(1) = model.ymin;
end
z(1) = zs + r(1)*sin(psi(1));
if z(1) > model.zmax
z(1) = model.zmax;
end
if z(1) < model.zmin
z(1) = model.zmin;
end
% Next Cartesian coordinates
for i = 2:model.n
x(i) = x(i-1) + r(i)*cos(psi(i))*sin(phi(i));
if x(i) > model.xmax
x(i) = model.xmax;
end
if x(i) < model.xmin
x(i) = model.xmin;
end
y(i) = y(i-1) + r(i)*cos(psi(i))*cos(phi(i));
if y(i) > model.ymax
y(i) = model.ymax;
end
if y(i) < model.ymin
y(i) = model.ymin;
end
% z(i) = z(i-1) + r(i)*cos(psi(i));
z(i) = z(i-1) + r(i)*sin(psi(i));
if z(i) > model.zmax
z(i) = model.zmax;
end
if z(i) < model.zmin
z(i) = model.zmin;
end
end
position.x = x;
position.y = y;
position.z = z;
end
[1]Manh Duong Phung, Quang Phuc Ha, "Safety-enhanced UAV Path Planning with Spherical Vector-based Particle Swarm Optimization", Journal of Applied soft computing, vol. 107, pp. 107376, 2021.