50 #define PM_PSD_SCANNER      0 
   51 #define PM_HOKUYO_URG_04LX  1 
   52 #define PM_SICK_LMS200      2 
   53 #define PM_HOKUYO_UTM_30LX  3 
   60    #define PM_LASER PM_VSCAN 
   64   #define PM_LASER_NAME       "VirtualScan"  
   65   #define PM_L_POINTS         720   
   67   #define PM_MAX_RANGE        100000   
   68   #define PM_MIN_VALID_POINTS 80    
   69   #define PM_SEARCH_WINDOW    10    
   70   #define PM_CORRIDOR_THRESHOLD 25.0  
   75 #define PM_TIME_DELAY       0  
   77 #define PM_MIN_RANGE        10.0f  
   83 #define PM_SEG_MAX_DIST     80.0  
   84 #define PM_WEIGHTING_FACTOR 30*30  
   85 #define PM_CHANGE_WEIGHT_ITER 10  
   87 #define PM_TYPE             double  
   89 #define PM_MAX_ERROR        100   
   90 //#define PM_STOP_COND        0.001   
   91 #define PM_STOP_COND        0.1   
   92 #define PM_MAX_ITER         500    
   93 #define PM_MAX_ITER_ICP     500    
   94 #define PM_STOP_COND_ICP    0.1   
   96 #define PM_MIN_STD_XY          5.0  
   97 #define PM_MIN_STD_ORIENTATION 4.0   
   98 #define PM_MATCH_ERROR_OFFSET  5.0   
  104 #define PM_TIME_FILE "results/iterations.txt"  
  110 #define PM_OCCLUDED  8   
  143 void pm_init(
const  char* filename=NULL, FILE **fin=NULL);
 
  153 void pm_plotScan(
PMScan *ls, 
const char *col,
double diameter = 2.0, 
bool connect_lines = 
false);
 
  163                    bool corridor=
false, 
PM_TYPE corr_angle=0);
 
void pm_plotScan4Thesis(PMScan *lsr, PMScan *lsa)
 
void pm_show_segmentation(const PMScan *ls)
 
void pm_plotScanAt(const PMScan *ls, PM_TYPE x, PM_TYPE y, PM_TYPE th, const char *col, double diameter=2.0, bool connect_lines=false)
 
bool pm_is_corridor(PMScan *act)
Guesses if a scan was taken on a corridor. 
 
void pm_save_scan(PMScan *act, const char *filename)
Saves scan in a text file. 
 
PM_TYPE r[PM_L_POINTS]
[cm] Laser range readings. 0 or negative ranges denote invalid readings. 
 
int pm_readScan(FILE *fin, PMScan *ls)
Reads one scan from file fin and stores it in ls. 
 
PM_TYPE ry
[cm] Robot odometry Y coordinate. 
 
void pm_unit_test(int matching_alg=PM_PSM, bool interactive=true)
Performs unit tests on scan matching. 
 
PM_TYPE pm_error_index(PMScan *lsr, PMScan *lsa)
Calculates an error index expressing the quality of a match. 
 
const PM_TYPE PM_R2D
Conversion factor for converting radians to degrees. 
 
void pm_plotTime4Thesis(PM_TYPE xt, PM_TYPE yt, PM_TYPE tht, int *iter=NULL, double *time=NULL)
 
double t
[s] Time when scan was taken. 
 
PM_TYPE x[PM_L_POINTS]
[cm] Laser reading X coordinates in Cartesian coordinates. 
 
#define PM_L_POINTS
Maximum number of points in a scan. 
 
PM_TYPE pm_error_index2(PMScan *ref, PMScan *cur, int *associatedPoints=NULL)
More quickly calculates an error index expressing the quality of a match. 
 
PM_TYPE pm_si[PM_L_POINTS]
Contains the sinus of each bearing. 
 
PM_TYPE rx
[cm] Robot odometry X coordinate. 
 
int bad[PM_L_POINTS]
Tag describing the validity of a range measurement. 0 if OK; sources of invalidity - out of range rea...
 
void pm_init(const char *filename=NULL, FILE **fin=NULL)
Initialises internal variables and opens a log file. 
 
void pm_cov_est(PM_TYPE err, double *c11, double *c12, double *c22, double *c33, bool corridor=false, PM_TYPE corr_angle=0)
Estimates the covariance matrix of a match. 
 
int seg[PM_L_POINTS]
Describes which segment the range reading belongs to. 
 
PM_TYPE pm_icp(const PMScan *lsr, PMScan *lsa)
Matches two laser scans using the iterative closest point method. 
 
PM_TYPE th
[rad] Robot orientation. 
 
#define PM_TYPE
The variable type used in calculations. Change it to double for higher accuracy and lower speed...
 
#define PM_PSM
Polar scan matching - matching bearing association rule. 
 
Structure describing a laser scan. 
 
PM_TYPE pm_co[PM_L_POINTS]
Contains the cosinus of each bearing. 
 
void pm_preprocessScan(PMScan *ls)
Shows segmentation results by plotting segments with different colours. 
 
PM_TYPE pm_fi[PM_L_POINTS]
Contains precomputed range bearings. 
 
PM_TYPE pm_corridor_angle(PMScan *act)
Determines the orientation of a corridor. 
 
PM_TYPE y[PM_L_POINTS]
[cm] Laser reading Y coordinates in Cartesian coordinates. 
 
PM_TYPE pm_psm(const PMScan *lsr, PMScan *lsa)
Match two laser scans using polar scan matching. 
 
void pm_plotScan(PMScan *ls, const char *col, double diameter=2.0, bool connect_lines=false)
 
const PM_TYPE PM_D2R
Conversion factor for converting degrees to radians.