Matlab Examples

In the Sample1 .alog file (named QuadTree_Alog.alog), we wish to extract range data from a laser called LMS_LASER_2D_LEFT.

  1. Run the executable without any input arguments to see the various configuration parameters that can be used.
    >> ALogParser()
  2. Range data is in the LMS_LASER_2D_LEFT message, and it is stored in a field Range. To extract this data:
    >> [a] = ALogParser(‘QuadTree_Alog.alog’,’LMS_LASER_2D_LEFT’,’–fields’,’@Range,
    Note that all the arguments are enclosed in string literals.
  3. The resultant data will be stored in an array called [a] in the matlab workspace.
  4. By default, the entire file is parsed. If this behaviour is not required/wanted, a time range (in seconds) can be specified. If only 20 seconds are required, the following command could be executed:
    >> [a] = uALogParser(‘QuadTree_Alog.alog’,’LMS_LASER_2D_LEFT’,’–fields’,’@Range’,’–time’,’start’,’20
    (Note: A start AND end time must be specified.)
    (Note: The keywords ‘start’ and ‘end’ can be combined with numeric values, e.g. –time start end, or –time 60 end
  5. uALogParser has the ability to extract multiple data fields from a message. If scanCount (which is a scalar value) is required in addition to the Range data, the following command would be issued:
    >> [a,b] = uALogParser(‘QuadTree_Alog.alog’,’LMS_LASER_2D_LEFT’,’–fields’,’@Range,scanCount’,’–time’,’start’,’20
  6. By default, the logging time is not included in the returned array, If it is required, simply pass the -w option to the parser:
    >> [a,b,time] = uALogParser(‘QuadTree_Alog.alog’,’LMS_LASER_2D_LEFT’,’–fields’,’@Range,scanCount’,’–time’,’start’,’20’,’-w
    (Note: You need to pass an additional variable into the parser to account for the time field)

Using uAlogParser with the above parameters with Sample 1 results in a file with the following structure: