Home > src > demos > bot_demo > bot_demo_loop.m

bot_demo_loop

PURPOSE ^

% Run the bot demo ns times to obtain some reliable results

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Run the bot demo ns times to obtain some reliable results

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 %% Run the bot demo ns times to obtain some reliable results
0003 
0004   % Number of loops
0005   ns = 100;
0006   
0007   % Allocate space for results
0008   rmse_results = zeros(10,ns);
0009   
0010   % Show waitbar
0011   handle = waitbar(0,'Please wait...');  
0012   loopstart = tic;
0013   
0014   for loop = 1:ns
0015 
0016       figure(1)
0017       
0018       % Run the demos (with silen=1, keep_trajectory=1 - not in first)
0019       ekfs_bot_demo
0020       ukfs_bot_demo
0021       ghkfs_bot_demo
0022       ckfs_bot_demo
0023       
0024       rmse_results(:,loop) = [ekf_rmse;   % EKF
0025                               eks_rmse1;  % ERTS
0026                               eks_rmse2;  % ETF
0027                               ukf_rmse;   % UKF
0028                               uks_rmse1;  % URTS
0029                               uks_rmse2;  % UTF
0030                               ghkf_rmse;  % GHKF
0031                               ghks_rmse1; % GHRTS
0032                               ckf_rmse;   % CHKF
0033                               cks_rmse1;];% CRTS
0034                           
0035       % Update waitbar and show time remaining
0036       if rem(k,20)==0 
0037           secondsleft = min(toc(loopstart),Inf)/loop*(ns-loop);
0038           waitbar(loop/ns,handle,sprintf('Monte Carlo runs\nTime left: %.0f min %.0f s.', ...
0039           floor(secondsleft/60),rem(secondsleft,60)))
0040       end
0041   end
0042 
0043   % Get rid of the waitbar
0044   close(handle)
0045   
0046   clc
0047   
0048   % Calculate means
0049   means = mean(rmse_results,2);
0050   
0051   ekf_rmse   = means(1);   % EKF
0052   eks_rmse1  = means(2);   % ERTS
0053   eks_rmse2  = means(3);   % ETF
0054   ukf_rmse   = means(4);   % UKF
0055   uks_rmse1  = means(5);   % URTS
0056   uks_rmse2  = means(6);   % UTF
0057   ghkf_rmse  = means(7);   % GHKF
0058   ghrts_rmse = means(8);   % GHRTS
0059   ckf_rmse   = means(9);   % CKF
0060   crts_rmse  = means(10);   % CRTS
0061   
0062 
0063       
0064   % Show average results
0065   fprintf('Average RMSE results over %i Monte Carlo runs\n',ns);
0066   fprintf('  EKF1-RMSE  = %.4f\n',ekf_rmse);
0067   fprintf('  EKS1-RMSE  = %.4f\n',eks_rmse1);
0068   fprintf('  ETF1-RMSE  = %.4f\n',eks_rmse2);
0069   fprintf('  UKF1-RMSE  = %.4f\n',ukf_rmse);
0070   fprintf('  URTS-RMSE  = %.4f\n',uks_rmse1);
0071   fprintf('  UTF-RMSE   = %.4f\n',uks_rmse2);
0072   fprintf('  GHKF-RMSE  = %.4f\n',ghkf_rmse);
0073   fprintf('  GHRTS-RMSE = %.4f\n',ghrts_rmse);
0074   fprintf('  CKF-RMSE   = %.4f\n',ckf_rmse);
0075   fprintf('  CRTS-RMSE  = %.4f\n',crts_rmse);
0076   
0077   
0078   
0079   ekf_rmse;   % EKF
0080   eks_rmse1;  % ERTS
0081   eks_rmse2;  % ETF
0082   ukf_rmse;   % UKF
0083   uks_rmse1;  % URTS
0084   uks_rmse2;  % UTF
0085   ckf_rmse;   % CKF
0086   crts_rmse;  % CRTS
0087   ghkf_rmse;  % GHKF
0088   ghrts_rmse; % GHRTS
0089   
0090   
0091   
0092

Generated on Fri 12-Aug-2011 15:15:16 by m2html © 2005