SHOWLASMOVE is a debugging function to display the laser scans. SHOWLASMOVE is a debugging function to display the laser scans. USAGE: showclusters(angleVector,rangeMatrix,clstrs); INPUTS: angleVector: 1xN vector; angleVector lists the angles for the ranges in rangeMatrix. rangeMatrix: MxN array; Each row in rangeMatrix contains a laser scan with ranges at the angles specified in angleVector. speed: display speed (integer greater than or equal to 1).
0001 function showlasmove(angleVector,rangeMatrix,speed) 0002 % SHOWLASMOVE is a debugging function to display the laser scans. 0003 % 0004 % SHOWLASMOVE is a debugging function to display the laser scans. 0005 % 0006 % USAGE: 0007 % showclusters(angleVector,rangeMatrix,clstrs); 0008 % 0009 % INPUTS: 0010 % angleVector: 1xN vector; angleVector lists the angles for the ranges 0011 % in rangeMatrix. 0012 % 0013 % rangeMatrix: MxN array; Each row in rangeMatrix contains a laser scan 0014 % with ranges at the angles specified in angleVector. 0015 % 0016 % speed: display speed (integer greater than or equal to 1). 0017 0018 figure; 0019 axis; 0020 mov=1; 0021 if ~exist('speed','var') 0022 mov=0; 0023 end 0024 0025 if mov 0026 for cntr=1:speed:size(rangeMatrix,1); 0027 polar(angleVector,rangeMatrix(cntr,:),'.'); 0028 title(num2str(cntr)); 0029 drawnow; 0030 cla; 0031 end 0032 else 0033 cntr=1; 0034 while 1 0035 dispclstrscore(angleVector,rangeMatrix(cntr,:),ones(size(angleVector))); 0036 imdistline; 0037 title(num2str(cntr)); 0038 while ~waitforbuttonpress 0039 end 0040 btnprsd=get(gcf,'CurrentCharacter'); 0041 if btnprsd=='n' 0042 cntr=cntr+1; 0043 if cntr>size(rangeMatrix,1) 0044 cntr=size(rangeMatrix,1); 0045 end 0046 elseif btnprsd=='b' 0047 cntr=cntr-1; 0048 if cntr<1 0049 cntr=1; 0050 end 0051 elseif btnprsd=='e' 0052 break; 0053 end 0054 cla; 0055 end 0056 end