1 简介
The code provided with this document uses Fuzzy Logic for robot motion planning. Assume that you have a robot arena with an overhead camera as shown in Figure 1. The camera can be easily calibrated and the image coming from the camera can be used to create a robot map, as shown in the same figure. This is a simplistic implementation of the real life scenarios where multiple cameras are used to capture different parts of the entire workspace, and their outputs are fused to create an overall map used by the motion planning algorithms. This tutorial would assume that such a map already exists and is given as an input to the map.
2 部分代码
function feasible=plotRobot(position,direction,map,robotHalfDiagonalDistance)
% plot robot with specified configuration and check its feasibility
corner1=position+robotHalfDiagonalDistance*[sin(direction-pi/4) cos(direction-pi/4)];
corner2=position+robotHalfDiagonalDistance*[sin(direction+pi/4) cos(direction+pi/4)];
corner3=position+robotHalfDiagonalDistance*[sin(direction-pi/4+pi) cos(direction-pi/4+pi)];
corner4=position+robotHalfDiagonalDistance*[sin(direction+pi/4+pi) cos(direction+pi/4+pi)];
line([corner1(2);corner2(2);corner3(2);corner4(2);corner1(2)],[corner1(1);corner2(1);corner3(1);corner4(1);corner1(1)],'color','blue','LineWidth',2);
if ~feasiblePoint(int16(corner1),map) || ~feasiblePoint(int16(corner2),map) || ~feasiblePoint(int16(corner3),map) || ~feasiblePoint(int16(corner4),map)
feasible=false;
else
feasible=true;
end
3 仿真结果
4 参考文献
[1]李擎等. "静态环境下基于模糊逻辑算法的移动机器人路径规划." 中国控制与决策会议 2013.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。