设计九基于模糊推理自主移动机器人避障控制

设计九基于模糊推理自主移动机器人避障控制

ID:36639176

大小:49.50 KB

页数:13页

时间:2019-05-13

设计九基于模糊推理自主移动机器人避障控制_第1页
设计九基于模糊推理自主移动机器人避障控制_第2页
设计九基于模糊推理自主移动机器人避障控制_第3页
设计九基于模糊推理自主移动机器人避障控制_第4页
设计九基于模糊推理自主移动机器人避障控制_第5页
资源描述:

《设计九基于模糊推理自主移动机器人避障控制》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、附录设计过程和程序清单参考程序如下:function[x,y]=obstacleavoidance(T1,N1,T2,N2,T3,N3,X0,Y0,XG,YG,STEP)holdonx(1)=X0;y(1)=Y0;t1=pi/4;t2=pi/2;t3=3*pi/4;theta=0;n=1;if((N3==0)&&((N1+N2)==0))error%只有A类障碍物的情况elseif((N3==0)&&((N1+N2)~=0))while(((x(n)-XG)^2+(y(n)-YG)^2)>STEP^2)dr=mindetected((t1-t

2、heta),T1,N1,T2,N2,x(n),y(n));dc=mindetected((t2-theta),T1,N1,T2,N2,x(n),y(n));dl=mindetected((t3-theta),T1,N1,T2,N2,x(n),y(n));tg=atan((XG-x(n))+i*(YG-y(n)))*180/pi-theta;sa=fuzzylogic(dr,dc,dl,tg);step=STER*(1-abs(sa)/100);sa=sa*pi/180;x(n+1)=x(n)+step*sin(sa);y(n+1)=y(n)+

3、step*cos(sa);theta=theta+sa;n=n+1;end%只有B类障碍物的情况elseif(((N1+N2)==0)&&(N3~=0))while(((x(n)-XG)^2+(y(n)-YG)^2)>STEP^2)dr=mindetectedquare((t1-theta),T3,N3,x(n),y(n));dc=mindetectedquare((t2-theta),T3,N3,x(n),y(n));dl=mindetectedquare((t3-theta),T3,N3,x(n),y(n));tg=atan((XG-x(

4、n))+i*(YG-y(n)))*180/pi-theta;sa=fuzzylogic(dr,dc,dl,tg);step=STER*(1-abs(sa)/100);sa=sa*pi/180;x(n+1)=x(n)+step*sin(sa);y(n+1)=y(n)+step*cos(sa);theta=theta+sa;n=n+1;end%A、B类障碍物都有的情况elsewhile(((x(n)-XG)^2+(y(n)-YG)^2)>STEP^2)dr1=mindetected((t1-theta),T1,N1,T2,N2,x(n),y(n)

5、);dr2=mindetectedquare((t1-theta),T3,N3,x(n),y(n));dc1=mindetected((t2-theta),T1,N1,T2,N2,x(n),y(n));dc2=mindetectedquare((t2-theta),T3,N3,x(n),y(n));dl1=mindetected((t3-theta),T1,N1,T2,N2,x(n),y(n));dl2=mindetectedquare((t3-theta),T3,N3,x(n),y(n));dr=min(dr1,dr2);dc=min(dc

6、1,dc2);dl=min(dl1,dl2);tg=atan((XG-x(n))+i*(YG-y(n)))*180/pi-theta;sa=fuzzylogic(dr,dc,dl,tg);step=STER*(1-abs(sa)/100);sa=sa*pi/180;x(n+1)=x(n)+step*sin(sa);y(n+1)=y(n)+step*cos(sa);theta=theta+sa;n=n+1;endend%距离传感器的模拟functiondmin=mindetected(a,T1,N1,T2,N2,x,y)dmin1=mindet

7、ected1(a,T1,N1,x,y);dmin2=mindetected2(a,T2,N2,x,y);endfunctiondmin1=mindetected1(a,T,N,x,y)if(N==0)dmin1=100000;elsed(1)=detectedline1(a,T(1,1),T(1,2),x,y,T(1,3),T(1,4));dmin1=d(1);j=1;fori=2:Nd(i)=detectedline1(a,T(i,1),T(i,2),x,y,T(i,3),T(i,4));if(d(i)

8、j);endendendfunctiont=detectedline1(a,b,k,x,y,minx,maxx)if(tan(a)~=k)t=(b+k*x-y)/(

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。