read_data_cb

PURPOSE ^

READ_DATA_CB is the main file that reads the raw laser data.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 READ_DATA_CB is the main file that reads the raw laser data.

 READ_DATA_CB is the main file that reads the raw laser data.
 This file is called by the GUI.

 Abdallah Kassir 1/3/2010

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % READ_DATA_CB is the main file that reads the raw laser data.
0002 %
0003 % READ_DATA_CB is the main file that reads the raw laser data.
0004 % This file is called by the GUI.
0005 %
0006 % Abdallah Kassir 1/3/2010
0007 
0008 
0009 % check for file names
0010 if ~exist('laserdatafname','var') || ~exist('videoframetimefname','var')
0011     % get file names
0012     laserdatafname=input('Enter Laser Data File Name:','s');
0013     videoframetimefname=input('Enter Video Timestamp File Name:','s');
0014 else
0015     laserdatafnamein=input(['Enter Laser Data File Name ([]=',laserdatafname,'):'],'s');
0016     if ~isempty(laserdatafnamein)
0017         laserdatafname=laserdatafnamein;
0018     end
0019     videoframetimefnamein=input(['Enter Video Timestamp File Name ([]=',videoframetimefname,'):'],'s');
0020     if ~isempty(videoframetimefnamein)
0021         videoframetimefname=videoframetimefnamein;
0022     end
0023 end
0024 
0025 
0026 % load files
0027 if ~exist(laserdatafname,'file') || ~exist(videoframetimefname,'file')
0028     disp('File does not exist.');
0029     return;
0030 end
0031 fprintf('Loading Data. Please Wait...');
0032 rawlaserdata=load(laserdatafname);
0033 videotimestamps=load(videoframetimefname);
0034 videotimestamps=videotimestamps(:,1);
0035 disp('Done.');
0036 
0037 % get laser data closest to video timestamps
0038 [lasertimestamps,imindices] = GetClosestTimeStamps(videotimestamps, rawlaserdata(:,1) );
0039 laserdata = rawlaserdata(imindices,:);
0040 
0041 % get range matrix and angle vector
0042 [rangeMatrix, angleVector, laserDivisor] = QBuildLaserRangeAngle(laserdata);
0043 
0044 rawrangeMatrix=QBuildLaserRangeAngle(rawlaserdata);

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