当前位置 : 主页 > 编程语言 > python >

【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附

来源:互联网 收集:自由互联 发布时间:2022-06-18
1 简介 2 部分代码 %% ABC + PSO Path Planning Problem % Here, system tries to find the most optimal path between starting point % and destination point with aid of Artificial Bee Colony (ABC) algorithm % and Particle Swarm Optimization

1 简介

【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码_路径规划

【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码_参考文献_02

【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码_参考文献_03

【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码_路径规划_04

【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码_参考文献_05

2 部分代码

%% ABC + PSO Path Planning Problem
% Here, system tries to find the most optimal path between starting point
% and destination point with aid of Artificial Bee Colony (ABC) algorithm
% and Particle Swarm Optimization algorithm combined. It is good strategy
% in robotics path finding. In each run new obstacles in new positions
% defines and a curved line tries to find the best path. Run multiple times
% to find the best result.
% Hope this code help you :)
%% Cleaning The Stage
clc;
clear;
warning('off');
%% Start ABC + PSO Optimal Path Finder
model=Basics();
model.n=6; % number of Handle Points
CostFunction=@(x) Cost(x,model); % Cost Function
nVar=model.n; % Number of Decision Variables
VarSize=[1 nVar]; % Size of Decision Variables Matrix
VarMin.x=model.xmin; % Lower Bound of Variables
VarMax.x=model.xmax; % Upper Bound of Variables
VarMin.y=model.ymin; % Lower Bound of Variables
VarMax.y=model.ymax; % Upper Bound of Variables
%% PSO + ABC Parameters
MaxIt=150; % Maximum Number of Iterations
nPop=20; % Population Size (Swarm Size)
w=1; % Inertia Weight
wdamp=0.98; % Inertia Weight Damping Ratio
c1=1.5; % Personal Learning Coefficient
end
end
% Update Best Solution Ever Found
for i = 1:nPop
if pop(i).Cost <= BestSol.Cost
BestSol = pop(i);
end
end
tOfTheRange)=-particle(i).Velocity.y(OutOfTheRange);
% Update Position Bounds
particle(i).Position.y = max(particle(i).Position.y,VarMin.y);
particle(i).Position.y = min(particle(i).Position.y,VarMax.y);
%
Flag=[', Violation = ' num2str(GlobalBest.Sol.Violation)];
end
disp(['In Iteration Number ' num2str(it) ':ABC+PSO Fittest Value Is = ' num2str(BestCost(it)) Flag]);
% Plot Solution
figure(1);
Plotting(GlobalBest.Sol,model);
pause(0.01);
end
%% Plot Train Stage
figure;
plot(sort(BestCost,'descend'),'r.','LineWidth',3);
title ('ABC + PSO Training');
xlabel('Itr');
ylabel('ABC+PSO Fittest Value');
grid on;

3 仿真结果

【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码_无人机_06

【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码_路径规划_07

4 参考文献

[1]宋彬. 结合粒子群算法和改进蚁群算法的机器人混合路径规划[D]. 中国矿业大学.

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

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

【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码_路径规划_08

网友评论