“在代码的海洋里,有无尽的知识等待你去发现。我就是那艘领航的船,带你乘风破浪,驶向代码的彼岸。
💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
在机器人学、自动驾驶和游戏开发等领域,寻路算法是核心组成部分之一,用于规划从起点到终点的最短或最优路径。然而,静态的最短路径算法往往无法应对动态环境中的障碍物,特别是那些未预知或突然出现的障碍。为此,研究者们提出了一种结合外部避障功能的最短路径算法,以增强算法的适应性和安全性。
算法背景:
传统的最短路径算法,如Dijkstra算法和A*算法,主要关注于静态地图上的路径规划,假定所有障碍物的位置都是固定的且事先已知。但在现实世界中,如繁忙的城市街道、充满不确定性的仓库环境或是复杂的自然地形,机器人或自动驾驶车辆必须能够即时响应动态障碍物,如行人、其他车辆或突发的障碍。
外部避障功能:
具有外部避障功能的最短路径算法,通过实时监测环境中的障碍物,并在路径规划中动态考虑这些障碍物的影响,从而生成安全且高效的路径。这一功能通常依赖于传感器数据,如激光雷达(LiDAR)、摄像头或红外传感器,来检测周围环境的变化。
📚2 运行结果
主函数部分代码:
close all
clear all
clc
%Specify start and end points
%WARNING: shortest distance between start and end points to wall must be
%greater than footprint otherwise the start and end positions will outside
%of the valid space for navigation
start_point = [120;35];
end_point = [50;20];
%Specify external boundaries and footprint of of robot
external_boundaries = [0,0;60,0;60,45;45,45;45,59;75.5,40;106,59;106,45;91,45;91,0;151,0;151,105;50,105;0,60];
footprint = 6;
%Let the external boundaries form a closed polygon for graphical
%visualization purposes
external_boundaries_draw = external_boundaries;
external_boundaries_draw(size(external_boundaries,1)+1,:) = external_boundaries_draw(1,:);
hold on
axis equal
%Plot the boundaries, starting points and end points
plot(external_boundaries_draw(:,1), external_boundaries_draw(:,2), 'Color', 'black')
plot(start_point(1), start_point(2), 'X', 'Color', 'green')
plot(start_point(1), start_point(2), 'O', 'Color', 'green')
plot(end_point(1), end_point(2), 'X', 'Color', 'red')
plot(end_point(1), end_point(2), 'O', 'Color', 'red')
tic
inflated_boundaries = boundary_inflation(external_boundaries, footprint);
waypoint_coordinates = pathfinder(start_point, end_point, inflated_boundaries);
toc
external_boundaries_shifted_draw = inflated_boundaries;
external_boundaries_shifted_draw(size(external_boundaries_shifted_draw,1)+1,:) = inflated_boundaries(1,:);
plot(external_boundaries_shifted_draw(:,1), external_boundaries_shifted_draw(:,2), 'Color', 'cyan')
🎉3 参考文献
文章中一些内容引自网络,会注明出处或引用为参考文献,难免有未尽之处,如有不妥,请随时联系删除。
[1]王国业,刘恩宏.履带式割草机自动驾驶远程交互避障系统设计与试验[J/OL].农机化研究:1-6[2024-07-17].https://doi.org/10.13427/j.cnki.njyi.20240702.005.
[2]李骁龙.基于深度学习的矿用救援机器人自动避障方法[J].自动化应用,2024,65(03):15-18.DOI:10.19769/j.zdhy.2024.03.005.