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

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

ID:35396768

大小:56.65 KB

页数:15页

时间:2019-03-24

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

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

1、参考程序如下:function[x,y]=obstacleavoidance(Tl,Nl,T2,N2,T3,N3,X0,Y0,XGYGSTEP)holdonx(l)=X0;y(l)=Y0;tl=pi/4;t2二pi/2;t3=3*pi/4;theta=0;n=l;if((N3==0)&&((N1+N2)==0))error%只有A类障碍物的情况elseif((N3==0)&&((N1+N2)〜=0))while(((x(n)-XG)A2+(y(n)-YG)A2)>STEPA2)dr=mindetected((t1-theta),T1,N1,T2,N2,x(n),y(n));

2、dc=mindetected((t2-theta),T1,N1,T2,N2,x(n),y(n));dl=mindetected((t3-theta),Tl,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*(l-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+l;end%只有B类障碍物

3、的情况elseif(((Nl+N2)==0)&&(N3〜=0))while(((x(n)-XG)A2+(y(n)-YG)A2)>STEPA2)dr=mindetectedquare((tl-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(n))+i*(YG-y(n)))*180/pi-theta;sa=fuzzylogic(dr,dc,dl,tg);step

4、=STER*(1-abs(sa)/100);sa=sa*pi/180;x(n+l)=x(n)+step*sin(sa);y(n+1)=y(n)+step*cos(sa);theta=theta+sa;n=n+l;%A、B类障碍物都有的情况elsewhile(((x(n)-XG)A2+(y(n)-YG)A2)>STEPA2)dr1=mindetected((tl-theta),T1,N1,T2,N2,x(n),y(n));dr2=mindetectedquare((tl-theta),T3,N3,x(n),y(n));de1=mindetected((t2-theta),T1

5、,N1,T2,N2,x(n),y(n));dc2=mindetectedquare((t2-theta),T3,N3,x(n),y(n));dll=mindetected((t3-theta),Tl,N1,T2,N2,x(n),y(n));dl2=mindetectedquare((t3-theta),T3,N3,x(n),y(n));dr=min(drl,dr2);dc=min(dcl,dc2);dl=min(dll,dl2);tg=atan((XG-x(n))+i*(YG-y(n)))*180/pi-theta;sa=fuzzylogic(dr,dc,dl,tg);st

6、ep=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+l;end%距离传感器的模拟functiondmin=mindetected(a,T1,N1,T2,N2,x,y)dmin1=mindetectedl(a,T1,N1,x,y);dmin2=mindetected2(a,T2,N2,x,y);endfunctiondmin1二mindetected1(a,T,N,x,y)if(N=0)dmin1=100000;els

7、ed(l)=detectedline1(a,T(l,1),T(1,2),x,y,T(1,3),T(1,4));dminl=d(l);j=l;fori=2:NdQ)=detectedlinel(a,T(i,l),T(i,2),x,y,T(i,3),T(i,4));if(d(i)

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

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

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