dispboardpts

PURPOSE ^

DISPBOARDPTS displays the selected calibration points onto one scan.

SYNOPSIS ^

function dispboardpts(angleVector,rangeMatrix,clstrs,boardclstrs,selectionnumbers)

DESCRIPTION ^

 DISPBOARDPTS displays the selected calibration points onto one scan.

 DISPBOARDPTS displays the selected calibration points onto one scan.

 USAGE:
     dispboardpts(angleVector,rangeMatrix,clstrs,boardclstrs,selectionnumbers)
 
 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.
 
     clstrs: MxN array. clstrs should be the same size as rangeMatrix.
     Each element in clstrs is an integer indicating the line cluster the
     range to which reading belongs.
 
     boardclstrs: Mx1 vector with the selected cluster of each scan.
     (0=none)
 
     selectionnumbers: row vector containing the active scan numbers

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function dispboardpts(angleVector,rangeMatrix,clstrs,boardclstrs,selectionnumbers)
0002 % DISPBOARDPTS displays the selected calibration points onto one scan.
0003 %
0004 % DISPBOARDPTS displays the selected calibration points onto one scan.
0005 %
0006 % USAGE:
0007 %     dispboardpts(angleVector,rangeMatrix,clstrs,boardclstrs,selectionnumbers)
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 %     clstrs: MxN array. clstrs should be the same size as rangeMatrix.
0017 %     Each element in clstrs is an integer indicating the line cluster the
0018 %     range to which reading belongs.
0019 %
0020 %     boardclstrs: Mx1 vector with the selected cluster of each scan.
0021 %     (0=none)
0022 %
0023 %     selectionnumbers: row vector containing the active scan numbers
0024 
0025 % remove scans with no boardcluster (guard)
0026 selectionnumbers(boardclstrs(selectionnumbers)==0)=[];
0027 
0028 if isempty(selectionnumbers)
0029     disp('No selected boards.');
0030     return;
0031 end
0032 
0033 noscans=size(rangeMatrix,1);
0034 % conver to cartestian coordinates
0035 [z,x]=pol2cart(repmat(angleVector,[noscans,1]),rangeMatrix);
0036 
0037 figure;
0038 hold on;
0039 nopoints=0;
0040 for cntr=selectionnumbers
0041     ind=(clstrs(cntr,:)==boardclstrs(cntr));
0042     plot(x(cntr,ind),z(cntr,ind),'r.',0,0,'bo');
0043     nopoints=nopoints+length(ind);
0044 end
0045 hold off;
0046 
0047 axis equal;
0048 grid on;
0049 legend('Laser Points','Laser Origin');
0050 title('Laser Points on Board Planes');
0051 xlabel('x');
0052 ylabel('z');
0053 fprintf( 'Planes selected:');disp(selectionnumbers);
0054 fprintf( 'Total of %d planes selected, with a total of %d data points.\n', length(selectionnumbers),nopoints);
0055 drawnow;

Generated on Thu 08-Apr-2010 14:35:09 by m2html © 2005