


下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、clear allfor i=1:200v=150; % 目標(biāo)速度 v_sensor=0;% 傳感器速度 t=1; % 掃描周期x(i+1)=x(i)+v*cos(a)*t; y(i+1)=y(i)+v*sin(a)*t; endxradarpositon=0; % 傳感器坐標(biāo)yradarpositon=0; %for i=1:200 xradarpositon=0;ppred=zeros(4,4);pzz=zeros(2,2);pxx=zeros(4,2);xpred=zeros(4,1); ypred=zeros(2,1); sumx=0; sumy=0; sumxukf=0;yradar
2、positon=0;zmeasure(1,i)=atan(y(i)-yradarpositon)/(x(i)-xradarposit on)+random('normal',0,azimutherror,1,1);zmeasure(2,i)=sqrt(y(i)-yradarpositon)a2+(x(i)-xradarpositon)a2)+random('normal',0,rangeerror,1,1);xx(i)=zmeasure(2,i)*cos(zmeasure(1,i);%觀測值sumyukf=0;sumxekf=0;sumyekf=0; % 統(tǒng)計的
3、初值yy(i)=zmeasure(2,i)*sin(zmeasure(1,i);measureerror=azimutherrora2 0;0 rangeerrora2;processerror=tao*processnoise;l=4;vnoise = size(processerror ,1);alpha=1; kalpha=0; belta=2;wnoise = size(measureerror ,1);a=1 t 0 0;ramda=3-l;0 1 0 0;0 0 1 t;azimutherror=0.015; % 方位均方誤差 rangeerror=100; % 距離均方誤差 pr
4、ocessnoise=1; % 過程噪聲均方差0 0 0 1;anoise=size(a,1);for j=1:2*l+1tao=ta3/3 22/2 0 0;wm(j)=1/(2*(l+ramda);22/2 to 0;0 0 ta3/3 ta2/2;0 0 ta2/2 t; % the input matrix of processwc(j)=1/(2*(l+ramda);endg=ta2/2 0t 0wm(1)=ramda/(l+ramda);wc(1)=ramda/(l+ramda);%+1-alphaa2+belta;% 權(quán)0 ta2/2值0 t ;if i=1a=35*pi/180
5、; a_v=5/100;xerror=rangeerrora2*cos(zmeasure(1,i)a2+zmeasure(2 ,i)a2*azimutherrora2*sin(zmeasure(1,i)a2;yerror=rangeerrora2*sin(zmeasure(1,i)a2+zmeasure(2,a_sensor=45*pi/180;x(1)=8000; % 初始位置i)a2*azimutherrora2*cos(zmeasure(1,i)a2;xyerror=(rangeerrora2-zmeasure(2,i)a2*azimutherrora2y(1)=12000;)*sin(
6、zmeasure(1,i)*cos(zmeasure(1,i);p=xerror xerror/t xyerror xyerror/t;xerror/t 2*xerror/(ta2) xyerror/t 2*xyerror/(ta2);xyerror xyerror/t yerror yerror/t; xyerror/t 2*xyerror/(ta2) yerror/t 2*yerror/(ta2);xestimate=zmeasure(2,i)*cos(zmeasure(1,i)0zmeasure(2,i)*sin(zmeasure(1,i) 0 'endcho=(chol(p*(
7、l+ramda)'%for j=1:l xgamap1(:,j)=xestimate+cho(:,j); xgamap2(:,j)=xestimate-cho(:,j);endxsigma=xestimate xgamap1 xgamap2;f=a;xsigmapre=f*xsigma;xpred=zeros(anoise,1);for j=1:2*l+1 xpred=xpred+wm(j)*xsigmapre(:,j);endnoise1=anoise; ppred=zeros(noise1,noise1);for j=1:2*l+1 ppred=ppred+wc(j)*(xsigm
8、apre(:,j)-xpred)*(xsigmapre( :,j)-xpred)'endppred=ppred+processerror;chor=(chol(l+ramda)*ppred)'for j=1:l xaugsigmap1(:,j)=xpred+chor(:,j); xaugsigmap2(:,j)=xpred-chor(:,j);endxaugsigma=xpred xaugsigmap1 xaugsigmap2 ;for j=1:2*l+1ysigmapre(1,j)=atan(xaugsigma(3,j)/xaugsigma(1,j) ; ysigmapre(
9、2,j)=sqrt(xaugsigma(1,j)a2+(xaugsigma(3,j)a2);endypred=zeros(2,1);for j=1:2*l+1 ypred=ypred+wm(j)*ysigmapre(:,j);endpzz=zeros(2,2);for j=1:2*l+1pzz=pzz+wc(j)*(ysigmapre(:,j)-ypred)*(ysigmapre(:,j)-ypred)'endpzz=pzz+measureerror;pxy=zeros(anoise,2);for j=1:2*l+1pxy=pxy+wc(j)*(xaugsigma(:,j)-xpred
10、)*(ysigmapre(:,j)-ypred)'endk=pxy*inv(pzz);xestimate=xpred+k*(zmeasure(:,i)-ypred);p=ppred-k*pzz*k'xukf(i)=xestimate(1,1);yukf(i)=xestimate(3,1);% % ekfpro%if i=1ekf_p=xerror xerror/t xyerror xyerror/t;xerror/t 2*xerror/(ta2) xyerror/t 2*xyerror/(ta2);xyerror xyerror/t yerror yerror/t;xyerro
11、r/t 2*xyerror/(ta2) yerror/t 2*yerror/(ta2);ekf_xestimate=zmeasure(2,i)*cos(zmeasure(1,i)0zmeasure(2,i)*sin(zmeasure(1,i) 0 ' ekf_xpred=ekf_xestimate;end;f=a;ekf_xpred=f*ekf_xestimate; ekf_ppred=f*ekf_p*f'+processerror;h=-ekf_xpred(3)/(ekf_xpred(3)a2+ekf_xpred(1)a2)0ekf_xpred(1)/(ekf_xpred(3
12、)a2+ekf_xpred(1)a2) 0;ekf_xpred(1)/sqrt(ekf_xpred(3)a2+ekf_xpred(1)a2)0ekf_xpred(3)/sqrt(ekf_xpred(3)a2+ekf_xpred(1)a2) 0;ekf_z(1,1)=atan(ekf_xpred(3)/ekf_xpred(1) ;ekf_z(2,1)=sqrt(ekf_xpred(1)a2+(ekf_xpred(3)a2);phhp=h*ekf_ppred*h'+measureerror; ekf_k=ekf_ppred*h'*inv(phhp);ekf_p=(eye(l)-ek
13、f_k*h)*ekf_ppred; ekf_xestimate=ekf_xpred+ekf_k*(zmeasure(:,i)-ekf_z); traceekf(i)=trace(ekf_p);xekf(i)=ekf_xestimate(1,1);yekf(i)=ekf_xestimate(3,1);errorx(i)=xx(i)+xradarpositon-x(i);errory(i)=yy(i)+yradarpositon-y(i);ukferrorx(i)=xestimate(1)+xradarpositon-x(i);ukferrory(i)=xestimate(3)+yradarpos
14、iton-y(i);ekferrorx(i)=ekf_xestimate(1)+xradarpositon-x(i);ekferrory(i)=ekf_xestimate(3)+yradarpositon-y(i);aa(i)=xx(i)+xradarpositon-x(i);bb(i)=yy(i)+yradarpositon-y(i);sumx=sumx+(errorx(if2);sumy=sumy+(errory(i)a2); sumxukf=sumxukf+(ukferrorx(if2); sumyukf=sumyukf+(ukferrory(i)a2);sumxekf=sumxekf+
15、(ekferrorx(i)a2);sumyekf=sumyekf+(ekferrory(i)a2);mseerrorx(i)=sqrt(sumx/(i-1);% 噪聲的統(tǒng)計均方誤差mseerrory(i)=sqrt(sumy/(i-1);mseerrorxukf(i)=sqrt(sumxukf/(i-1);%ukf差mseerroryukf(i)=sqrt(sumyukf/(i-1);mseerrorxekf(i)=sqrt(sumxekf/(i-1);%ekf差mseerroryekf(i)=sqrt(sumyekf/(i-1);的統(tǒng)計均方誤的統(tǒng)計均方誤endfigure(2) plot(m
16、seerroryukf,'r');hold on;plot(mseerroryekf,'g');hold on;plot(mseerrory,'.');hold on;ylabel('mse of y axis','fontsize',15); xlabel('sample number','fontsize',15); legend('ukf','ekf','measurement error');figure(3) plot(x,y);hold on;plot(xekf,yekf,'g');hold on;plot(xukf,yukf,'r');hold on;plot(xx,yy,'m');ylabel(' x ','fontsize',15); xlabel('y','fontsize',15); legend('true','ukf','ekf','measurements');figure(1);plot(mseerrorxukf,
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年美術(shù)活動春雨標(biāo)準(zhǔn)教案反思
- 提升教學(xué)質(zhì)量的年度目標(biāo)計劃
- 《貴州眾一金彩黔礦業(yè)有限公司織金縣官寨鄉(xiāng)明源煤礦(變更)礦產(chǎn)資源綠色開發(fā)利用方案(三合一)》評審意見
- 渠道管理-渠道中的行為
- 2025年駐馬店貨運資格證考題
- 2025年黃石貨運從業(yè)資格證考試模擬考試題庫
- 2025年阿克蘇b2貨運上崗證模擬考試
- 2025年盤錦貨運資格證模擬考試卷
- 2025年安徽貨運從業(yè)考試試題及答案大全
- 美食產(chǎn)品知識培訓(xùn)課件
- 中國傳媒大學(xué)-廣告媒體策劃與應(yīng)用(第2版)-課件
- 玻璃工藝學(xué)第4章 玻璃的性質(zhì)
- 四川省藥械集中采購及醫(yī)藥價格監(jiān)測平臺操作指引
- 精品市政道路施工測量方法及測量方案
- 室內(nèi)采暖管道安裝施工工藝標(biāo)準(zhǔn)規(guī)范標(biāo)準(zhǔn)
- 小型手推清掃車畢業(yè)設(shè)計說明書課件
- 監(jiān)理大綱(范本)
- 受拉鋼筋抗震錨固長度Lae
- 2018年湖北省襄陽市中考物理試卷
- 《沉淀滴定法》PPT課件.ppt
- 波程差與光程差
評論
0/150
提交評論