亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? slam.m

?? slam進(jìn)階學(xué)習(xí)
?? M
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
function x=slam
% Basic Simultaneous Localisation and Mapping Algorithm usign EKF using Encoder and Laser
%  Juan Nieto         j.nieto@acfr.usyd.edu.au
%  Eduardo Nebot      nebot@acfr.usyd.edu.au
%  More information   http://acfr.usyd.edu.au/homepages/academic/enebot/summer_sch.htm 
%
%
%EkfSlam, this file is using "Nearest Neighbour" data association

close all; clear all;

%Beacons Positions, taken with a kinematic GPS ( 2cm ), used only to Compare results
global beacons;
FileBEACON='beac_juan3.mat';
load(FileBEACON);
beacons=estbeac; clear estbeac;

DeltaT=1;        
T0=0;
TF=112;     % max = 112 secs;

global GPSLon GPSLat

load('data_set');   % File with data stored according to spec provided

%-----------------------------------------------------
To=min([TimeGPS(1),Time_VS(1),TimeLaser(1)]);
TimeLaser=TimeLaser-To;
Time_VS=Time_VS-To;                 %Init time --> 0
TimeGPS=TimeGPS-To;
Time=Time-To;
%-----------------------------------------------------
[tf,If]=FINDT(TimeGPS,TF);% to plot the gps data till TF 
GPSLon=GPSLon(1:If);
GPSLat=GPSLat(1:If);

%----------------------------------------------------------------------------------------
%Prepare matrices to save data: f( Number of predictions + Number of updates Laser 
%                                  + Number of updates GPS)
global xest Pest TimeGlobal FlagS innov innvar;

numberbeacons=50;
NumPred=size(Time,2);
NumUpdaL=size(TimeLaser,2);
NumUpdaG=size(TimeGPS,2);

xest=zeros(3,NumPred+2*NumUpdaL+NumUpdaG);
Pest=zeros(numberbeacons,NumPred+2*NumUpdaL+NumUpdaG);
innov=zeros(2,2*(NumUpdaL+NumUpdaG));
innvar=zeros(2,2*(NumUpdaL+NumUpdaG));
TimeGlobal=zeros(1,NumPred+2*NumUpdaL+NumUpdaG);
FlagS=zeros(1,NumPred+2*NumUpdaL+NumUpdaG);          %This flag is used to know if we 
                                                     %saved an update or a prediction

%----------For the the Jacobians, states and covariances--------------------
global Pp Jh xp 

Pp=zeros(2*numberbeacons+3,2*numberbeacons+3);
Jh=zeros(2,2*numberbeacons+3);
xp=zeros(2*numberbeacons+3,1);
MatrixA=zeros(2*numberbeacons+3,2*numberbeacons+3);        %Auxiliar matrix for J*Pest*J'
MatrixB=zeros(2*numberbeacons+3,2*numberbeacons+3);

%-------------On Line Plot-----------------------------------------------------------------
global FlagWait FlagEnd hhh;
FlagWait = 0 ;
FlagEnd =0 ;

figure(10) ;clf ; 
hold on;
uicontrol('Style','pushbutton','String','PAUSE','Position',[10 5 50 30], 'Callback', 'fOnOff(1);');
uicontrol('Style','pushbutton','String','END  ','Position',[10 5+35 50 30], 'Callback', 'fOnOff(2);');

title('EKFSlam');xlabel('East (meters)');ylabel('North (meters)');
plot(GPSLon,GPSLat,'r.');axis([-10,20,-25,20]);%axis([2,33,-25,25]);%
plot(beacons(:,1),beacons(:,2),'b*')
hhh(1)=plot(0,0,'b','erasemode','none') ;   %path estimated
hhh(2)=plot(0,0,'r','erasemode','xor') ;   %what is used from the frame
hhh(3)=plot(0,0,'b.','erasemode','xor') ;   %laser, all the frame
hhh(4)=plot(0,0,'r+','erasemode','xor') ;   %high intensity only
hhh(5)=plot(0,0,'r','erasemode','xor') ;   %covariance ellipse x-y position
hhh(6)=plot(0,0,'r','erasemode','xor') ;   %covariance ellipse x-y beacon
hhh(7)=plot(0,0,'r','erasemode','xor') ;   %covariance ellipse x-y beacon

hhh(8)=plot(0,0,'sr','erasemode','xor') ;   %car
hhh(9)=plot(0,0,'go','erasemode','xor') ;   %beacons' position estimated
legend('GPS','Beacons','Estimated Path','Laser Data','All laser','H. Inten.')

hold off;

%-----------------------------------------------------------------
% Filter Tuning
% These are the parameter you need to modify to improve the operation
% of the filter  ( Good Luck :-) )
%
global sigmaU sigma_laser sigma_gps;

%Internal Sensors  ( dead - reckoning )
    sigmastear=(7)*pi/180;        %Qu=7
    sigmavel=0.7;                 %Qv=0.7
    
%Observations:  laser Range and Bearing   ( Sick laser )
%               We are estimating the centre of a 6 cm pole
    SIGMA_RANGE=0.10;             %Rr=0.1  
    SIGMA_BEARING=(1)*pi/180;     %Ro=1
    
% Observations: GPS
% This is only used at the beginning to estimate absolute heading
% and then compare the localisation results with GPS
    sigmagps=0.05;            
    
    
% sensors error covariance
    sigmaU=[sigmavel*sigmavel       0;
                0             sigmastear*sigmastear];
    
    sigma_laser=[SIGMA_RANGE^2     0;
                0          SIGMA_BEARING^2]  ;            
    
    sigma_gps=[sigmagps*sigmagps     0;
                0          sigmagps*sigmagps]  ;          


%--------------Initial conditions & some constants----------------------------------------

global Pt isave index_update beacon2show tglobal trefresh plotall;   %trefresh is to refresh 
                                                                     %the path in the plot

finit=-112*pi/180; % or you could use something like: atan2(GPSLat(2)-GPSLat(1),GPSLon(2)-GPSLon(1));

xinit=[GPSLon(1);GPSLat(1);finit];

Pinit= [0.1    0.0   0.0   ;
        0.0   0.1    0.0   ;
        0.0   0.0    (15)*pi/180  ];

u=[Velocity(1) ; Steering(1) ];  

FlagStates=[-1;-1;-1];      %Initialization of flags to count the number of "hits" of each beacon

Pt=3;           %Pointer to the last state, at the beggining we have the three model's states  
t1=cputime; trefresh=T0+2;
iglobal=0; isave=1; index_update=1; tglobal=0;
xp(1:Pt)=xinit; Pp(1:Pt,1:Pt)=Pinit;
plotellipse=0;         %Flag to plot the covariance of the vehicle and some landmarks  
                       % 1: plot  0: no plot
plotall=1;             %check in the plot function
beacon2show=[4 5];     %These are the beacons which the covariance ellipse will be show
                       %In this example only two beacons are selected.

                       
%-----------------------------------Running filter------------------------------------------
disp('Running filter...')


%**************************  Navigation Loop Start **************************************

while (tglobal<TF)
    iglobal=iglobal+1;
    tglobal=Time(iglobal);
    if (iglobal>1)
        dt=tglobal-Time(iglobal-1);
    else
        dt=0.025;
    end
    
    %Perform a prediction with delta = previous time - actual time
    
    pred(dt,u);                                          %Prediction
    SaveStates(xp(1:3),diag(Pp(1:Pt,1:Pt)),tglobal,0);   %save data
    set(hhh(1),'XData',xp(1),'YData',xp(2)) ;
    if plotellipse
        plotCovariance; %plot the covariance ellipse (1-sigma)
    else  
        set(hhh(8),'XData',xp(1),'YData',xp(2)) ;
    end
    
    %New Information, If External: do update, if dead-reckioning : set u for next predition
    
    %------------------------------------------------------------------------------------------------------------------------      
    %  GPS is sensor 1, Only used for DeltaT to evaluate initial heading !!
    if (Sensor(iglobal)==1) & (tglobal<(T0+DeltaT))                     
        %GPS
        zgps=[GPSLon(Index(iglobal));GPSLat(Index(iglobal))];
        [in ins]=update_gps(zgps);
        SaveStates(xp(1:3),diag(Pp(1:Pt,1:Pt)),tglobal,1); SaveInnov(in,diag(ins));
    end 
    
    
    %------------------------------------------------------------------------------------------------
    %Sensor =2 are Dead reckoning sensors

    if Sensor(iglobal)==2 
        %Sensors
        u=[Velocity(Index(iglobal)) ;Steering(Index(iglobal))];    %SPEED IN m/s, stearing in rads.
    end
    
    %-----------------------------------------------------------------------------------------------
    % Sensor = 3 is the Laser   

    if (Sensor(iglobal)==3) & (tglobal>(T0+DeltaT))
       %Laser
       bias=0*pi/180;
       [LASERr LASERo RR a]=getdata(Laser(Index(iglobal),:), Intensity(Index(iglobal),:));  %estimate beacon centre
       zlaser=[LASERr ; LASERo+bias];          
       %------------------------------------------------------------------------------------------------
       laserview(RR,a,LASERr,LASERo);        %plot the laser frame
       
       %------------------------Update--------------------------------------------------------------------
       for w=1:size(LASERr,2)    
        index1=0;
        if Pt==3                % this is the first beacon and will be incorporated
                                % this can be improved building a list to avoid spurious observ.
            new_state(zlaser(:,w));
            Pt=Pt+2;            %pointer to the last state in the s.v.
            FlagStates(Pt-1:Pt)=1;
            [index1,in,ins]=asoc_update(zlaser(:,w),(Pt-1),1);       %Update of the new state
            SaveStates(xp(1:3),diag(Pp(1:Pt,1:Pt)),tglobal,1);       %save states
            SaveInnov(in,diag(ins));                                 %save innovations
            set(hhh(1),'XData',xp(1),'YData',xp(2)) ;                % on line plot
        else        
            [closest]=Zone_Probe(zlaser(:,w));       %if not first association is needed ( look only in reduced area )
            closest=4+2.*(closest-1);                %pointer to the X beacons position in the state vector
            j=1;i=0; qu=[];possible=[];
            while (j<=length(closest))                    
                i=closest(j);
                [index1,in,ins,q1]=asoc_update(zlaser(:,w),i,0);    %q1 is the likelihood value, assoc only here
                if index1==1
                    possible=[possible i];
                    qu=[qu q1];
                end
                j=j+1;
            end
            if ~isempty(possible)     
                if length(possible)>1
                    disp('Multi hypothesis problem');        % this may be a problem !
                end
                [value,index2]=min(qu);
                twin=possible(index2);                             %nearest nighbour==max. likelihood
                FlagStates(twin:twin+1)=FlagStates(twin:twin+1)+1; 
                [index1,in,ins]=asoc_update(zlaser(:,w),twin,1);     % perform the update with best
                SaveStates(xp(1:3),diag(Pp(1:Pt,1:Pt)),tglobal,1);
                SaveInnov(in,diag(ins));
                set(hhh(1),'XData',xp(1),'YData',xp(2)) ;
            else           
                new_state(zlaser(:,w));                 
                Pt=Pt+2;                
                FlagStates(Pt-1:Pt)=1;
                [index1,in,ins]=asoc_update(zlaser(:,w),Pt-1,1);         %Update of the new state
            end
        end    
                  
      end
  end   
  
  
  while FlagWait,
      if FlagEnd, return  
      end  		                %This is for the buttons of "pause" and "end" in the animation plot
      pause(0.5) ;
  end;
  if FlagEnd; hold on;plot(xest(1,1:isave-1),xest(2,1:isave-1),'b');hold off; return 
  end  
end

%************************ Navigation Loop End **********************************

xest=xest(:,1:isave-1); Pest=Pest(:,1:isave-1);
innov=innov(:,1:index_update-1); innvar=innvar(:,1:index_update-1);
FlagS=FlagS(:,1:isave-1);
TimeGlobal=TimeGlobal(:,1:isave-1);


disp('Completed Filtering:')
t2=cputime;                     %To know the real time of the algorithm
treal=TF-T0,
time=t2-t1,
taverage=(t2-t1)/iglobal, 
%----------------------------Fiter completed --------------------------------------

%This is to select just the beacons we saw more than "hits" times. ( for display purposes
global estbeacons
hits=4;
aux=FlagStates(4:2:Pt);
ii=find(aux>=hits);
xpos=4+2.*(ii-1);
estbeacons(:,1)=xp(xpos) ; estbeacons(:,2)=xp(xpos+1); 
numbeac=size(estbeacons,1);


plots;

return;
%--------------------------------------------------------------------------------------------------------------------------------------
%---------------------------------End of the main function-----------------------------------------------------------------------------
%--------------------------------------------------------------------------------------------------------------------------------------



%------------------------------------------------------------------------------
%      Auxiliary functions
%-------------------------------------------------------------------------------

function pred(dt,u)
% Function to generate a one-step vehicle prediction .
    global Pt;
    global Pp xp MatrixA MatrixB;
    global sigmaU;
    %----------------------------------------------------------------------
    %Car parameters
    L=2.83 ; h=0.76;  b = 1.21-1.42/2;  a = 3.78;   
    %-----------------------------------------------------------------------
    XSIZE=Pt; N=(Pt-3)/2;     %Pt=3+2*N
    
    % input error transfer matrix      (df/du)
    ve=u(1);
    vc=ve/(1-tan(u(2))*h/L);          %The velocity has to be translated from the back
                                      %left wheel to the center of the axle
    dvc_dve=(1-tan(u(2))*h/L)^-1;
    dvc_dalpha=ve*h/(L*(cos(u(2)))^2*(1-tan(u(2))*h/L));
    aux=(cos(u(2))^(-2));
    T1=a*sin(xp(3))+b*cos(xp(3));
    T2=a*cos(xp(3))-b*sin(xp(3));

    b1=(cos(xp(3))-tan(u(2))/L*T1)*dvc_dve;
    b3=(sin(xp(3))+tan(u(2))/L*T2)*dvc_dve;
    b5=tan(u(2))/L*dvc_dve;
    b2=-T1*vc/L*aux+b1*dvc_dalpha;
    b4=T2*vc/L*aux+b1*dvc_dalpha;
    b6=vc/L*aux+tan(u(2))/L*dvc_dalpha;

    Bv=dt*[b1   b2;
          b3   b4;
          b5   b6];

% state transition matrix evaluation    (df/dx) -------------------------------
    J1=[1 0 -dt*(vc*sin(xp(3))+vc/L*tan(u(2))*(a*cos(xp(3))-b*sin(xp(3))))       
        0  1  dt*(vc*cos(xp(3))-vc/L*tan(u(2))*(a*sin(xp(3))+b*cos(xp(3))))       %Jacobian
        0  0                              1                               ];  
        I=eye(Pt-3,Pt-3);             

% first state prediction -------------------------------------------------------

    xp(1)=xp(1) + dt*vc*cos(xp(3))-dt*vc/L*tan(u(2))*(a*sin(xp(3))+b*cos(xp(3)));
    xp(2)=xp(2) + dt*vc*sin(xp(3))+dt*vc/L*tan(u(2))*(a*cos(xp(3))-b*sin(xp(3)));         
    xp(3)=xp(3) + dt*vc/L*tan(u(2));
    xp(3)=NormalizeAngle(xp(3));

%J*Pest*J' ---------------------------------------------------------------------
    P1=Pp(1:3,1:Pt);
    P2=Pp(4:Pt,1:Pt);
    Aux=[J1*P1
        I*P2];
    Aux1=Aux(1:3,1:3); Aux2=Aux(1:3,4:Pt); Aux3=Aux(4:Pt,1:3); Aux4=Aux(4:Pt,4:Pt);

    MatrixA(1:Pt,1:Pt)=[Aux1*J1' Aux2*I
                        Aux3*J1' Aux4*I];
    clear Aux Aux1 Aux2 Aux3 Aux4;
%---------------------------------------------------------------------------------

%B*sigmaU*B'----------------------------------------------------------------------
    MatrixB(1:Pt,1:Pt)=[Bv*sigmaU*Bv'  zeros(3,Pt-3)
                            zeros(Pt-3,Pt)        ];
%---------------------------------------------------------------------------------     
    Pp(1:Pt,1:Pt)= MatrixA + MatrixB;
return;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费高清视频在线观看| 成人午夜视频免费看| 99免费精品在线| 中文字幕一区二区5566日韩| 亚洲h动漫在线| 国产乱码精品1区2区3区| 91超碰这里只有精品国产| 亚洲人成影院在线观看| 91在线国内视频| 久久综合丝袜日本网| 国产麻豆成人精品| 精品日韩在线一区| 国产成人免费视频一区| 国产欧美日韩中文久久| 国产99精品视频| 国产精品高潮呻吟久久| aaa欧美日韩| 日韩精品乱码免费| 91精品啪在线观看国产60岁| 伊人色综合久久天天人手人婷| 五月激情六月综合| 制服丝袜亚洲色图| 精品一区二区三区免费| 国产日韩亚洲欧美综合| 国产午夜亚洲精品不卡| 国产成人av一区二区| 色哟哟精品一区| 91精品国产综合久久精品图片 | 亚洲综合男人的天堂| 欧美天堂亚洲电影院在线播放| 免费成人性网站| 午夜欧美大尺度福利影院在线看| 欧美精品在线视频| 成人免费精品视频| 韩日欧美一区二区三区| 欧美激情一区二区在线| 欧美日韩www| 91伊人久久大香线蕉| 久久99国产精品麻豆| 一区二区成人在线观看| 久久久久久久综合| 日韩一级大片在线| 欧美午夜寂寞影院| 色综合天天视频在线观看| 激情小说欧美图片| 乱一区二区av| 免费看日韩精品| 亚洲图片自拍偷拍| 亚洲免费av高清| 亚洲欧美区自拍先锋| 日本一区二区三区在线观看| 日韩精品自拍偷拍| 日韩视频免费观看高清完整版在线观看 | 国产一区亚洲一区| 久久激情五月激情| 亚洲欧美另类在线| 中文字幕制服丝袜成人av| 日韩欧美国产精品一区| 91高清在线观看| 91视频在线观看免费| 国产成人自拍网| 国产一区二区三区四区五区美女| 亚洲乱码中文字幕综合| 亚洲综合一区二区| 一区二区三区在线播放| 亚洲欧美aⅴ...| 一区二区三区精品久久久| 一区二区三区中文在线| 一区二区三区精品久久久| 亚洲欧美日韩在线不卡| 亚洲人妖av一区二区| 亚洲免费av高清| 亚洲不卡在线观看| 亚洲成人一二三| 国产激情一区二区三区四区| 蜜桃av噜噜一区二区三区小说| 久久精品久久精品| 国产乱淫av一区二区三区| 国产综合色视频| 丁香网亚洲国际| 欧美日韩国产免费一区二区| 欧美日韩视频在线第一区 | 色综合久久久网| 91小视频免费观看| 欧美一区二区三区免费视频| 色美美综合视频| 成人黄色大片在线观看| 成人精品小蝌蚪| 欧美影院精品一区| 26uuu亚洲| 亚洲美女免费在线| 国产原创一区二区三区| 在线观看视频91| 精品国产乱码久久久久久图片| 一区在线播放视频| 一区二区成人在线视频| 久久精品二区亚洲w码| 色哟哟一区二区三区| 久久精品一区二区三区不卡 | 日韩欧美在线影院| 国产精品天美传媒沈樵| 国产成人自拍网| 欧美成人在线直播| 亚洲成人av中文| 日本韩国欧美国产| 中文字幕一区不卡| 成人动漫中文字幕| 亚洲国产高清aⅴ视频| 国产一区二区三区在线观看精品| 欧美电影一区二区| 亚洲精品久久7777| 色天使色偷偷av一区二区| 欧美激情一区二区在线| 国产成人精品免费在线| 日韩欧美精品在线视频| 蜜臀精品久久久久久蜜臀| 8x福利精品第一导航| 日韩极品在线观看| 欧美一区二区三区在线视频| 亚洲地区一二三色| 6080午夜不卡| 国产a精品视频| 国产精品不卡一区二区三区| 国产69精品久久99不卡| 国产精品麻豆久久久| 99久久精品国产精品久久 | 在线精品观看国产| 亚洲综合免费观看高清在线观看| 欧美色偷偷大香| 蜜臀精品一区二区三区在线观看| 久久精品一区二区三区不卡牛牛| 99免费精品在线观看| 五月婷婷激情综合网| 国产欧美日韩精品一区| 色婷婷久久久亚洲一区二区三区| 日韩精品成人一区二区三区| 久久久久久久久岛国免费| 高清beeg欧美| 天天免费综合色| 国产精品欧美一区喷水| 欧美日韩在线一区二区| 成人永久看片免费视频天堂| 日韩av一级电影| 中文字幕在线播放不卡一区| 欧美三级电影在线观看| av中文字幕在线不卡| 麻豆精品一区二区综合av| 亚洲日本一区二区| 久久久精品免费网站| 91日韩一区二区三区| 国产成人午夜精品5599 | 国产精品久久国产精麻豆99网站 | 奇米影视在线99精品| 怡红院av一区二区三区| 国产精品免费丝袜| 久久久久久久一区| 久久蜜臀精品av| 91精品国产综合久久国产大片| 在线视频亚洲一区| 色一情一乱一乱一91av| 国产在线一区观看| 成人免费看视频| 成人av第一页| 97精品电影院| 91国产成人在线| 色婷婷久久综合| 欧美精品一级二级| 日韩欧美高清一区| 欧美久久久久久久久久| 69精品人人人人| 精品国精品国产尤物美女| 精品久久久三级丝袜| 免费的成人av| 久久伊人蜜桃av一区二区| 欧美亚洲国产bt| 成人开心网精品视频| 色94色欧美sute亚洲13| 欧美午夜精品一区二区蜜桃| 欧美精品自拍偷拍动漫精品| 欧美一级xxx| 国产精品色一区二区三区| 亚洲另类在线视频| 久久av中文字幕片| 93久久精品日日躁夜夜躁欧美| 精品视频999| 国产欧美视频一区二区| 日韩av在线播放中文字幕| 国产精品小仙女| 欧美自拍偷拍午夜视频| 2024国产精品| 午夜精品久久久久久久| 国产成人在线视频网站| 国产一区二区女| 9191成人精品久久| 亚洲欧美一区二区三区久本道91| 麻豆精品在线视频| 欧美精品一二三区| 亚洲美女区一区| 国产资源在线一区| 欧美成人综合网站|