資源簡介
人工勢場法路徑規劃的仿真程序,用matlab仿真實現

代碼片段和文件信息
function?Y=compute_angle(XXsumn)%Y是引力,斥力與x軸的角度向量X是起點坐標,Xsum是目標和障礙的坐標向量是(n+1)*2矩陣
??for?i=1:n+1%n是障礙數目
??????deltaXi=Xsum(i1)-X(1)
??????deltaYi=Xsum(i2)-X(2)
??????ri=sqrt(deltaXi^2+deltaYi^2)
??????if?deltaXi>0
??????????theta=asin(deltaXi/ri)
??????else
??????????theta=pi-asin(deltaXi/ri)
??????end
??????if?i==1%表示是目標
??????????angle=theta
??????else
??????????angle=pi+theta
??????end?????
??????Y(i)=angle%保存每個角度在Y向量里面,第一個元素是與目標的角度,后面都是與障礙的角度
??end
??????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????843536??2006-09-13?14:20??bizhangrobot\1.bmp
?????文件?????836184??2006-09-13?14:20??bizhangrobot\2.bmp
?????文件????????562??2009-03-24?14:58??bizhangrobot\compute_angle.asv
?????文件????????562??2009-03-24?15:04??bizhangrobot\compute_angle.m
?????文件????????463??2009-03-24?17:03??bizhangrobot\compute_Attract.asv
?????文件????????463??2009-03-24?17:08??bizhangrobot\compute_Attract.m
?????文件???????1065??2006-09-13?14:20??bizhangrobot\compute_repulsion.m
?????文件???????2959??2009-03-25?15:57??bizhangrobot\main.m
?????文件???????7134??2009-03-25?15:59??bizhangrobot\no3.fig
????..A.SH.??????5632??2009-04-06?20:53??bizhangrobot\Thumbs.db
?????目錄??????????0??2009-04-06?20:53??bizhangrobot
-----------?---------??----------?-----??----
??????????????1698560????????????????????11
- 上一篇:計算歸一化相關系數NC的m文件
- 下一篇:mimo_detection.m
評論
共有 條評論