45 #define PM_PSD_SCANNER 0
46 #define PM_HOKUYO_URG_04LX 1
47 #define PM_SICK_LMS200 2
48 #define PM_HOKUYO_UTM_30LX 3
54 #define PM_LASER PM_HOKUYO_UTM_30LX
58 #if PM_LASER == PM_PSD_SCANNER
59 #define PM_LASER_NAME "PSD_Scanner"
60 #define PM_L_POINTS 200
62 #define PM_MAX_RANGE 400
63 #define PM_MIN_VALID_POINTS 100
64 #define PM_SEARCH_WINDOW 50
65 #define PM_CORRIDOR_THRESHOLD 25.0
66 #elif PM_LASER == PM_HOKUYO_URG_04LX
67 #define PM_LASER_NAME "Hokuyo URG-04LX"
68 #define PM_L_POINTS 682
70 #define PM_MAX_RANGE 530
71 #define PM_MIN_VALID_POINTS 200
72 #define PM_SEARCH_WINDOW 80
73 #define PM_CORRIDOR_THRESHOLD 25.0
74 #elif PM_LASER == PM_SICK_LMS200
75 #define PM_LASER_NAME "Sick LMS"
76 #define PM_L_POINTS 181
78 #define PM_MAX_RANGE 1000
79 #define PM_MIN_VALID_POINTS 40
80 #define PM_SEARCH_WINDOW 20
81 #define PM_CORRIDOR_THRESHOLD 25.0
82 #elif PM_LASER == PM_HOKUYO_UTM_30LX
83 #define PM_LASER_NAME "HOKUYO UTM-30LX"
84 #define PM_L_POINTS 1081
86 #define PM_MAX_RANGE 700
87 #define PM_MIN_VALID_POINTS 300
88 #define PM_SEARCH_WINDOW 200
89 #define PM_CORRIDOR_THRESHOLD 25.0
95 #define PM_TIME_DELAY 0
97 #define PM_MIN_RANGE 10.0f
103 #define PM_SEG_MAX_DIST 20.0
104 #define PM_WEIGHTING_FACTOR 70*70
105 #define PM_CHANGE_WEIGHT_ITER 10
107 #define PM_TYPE float
109 #define PM_MAX_ERROR 100
110 #define PM_STOP_COND 0.4
111 #define PM_MAX_ITER 30
112 #define PM_MAX_ITER_ICP 60
113 #define PM_STOP_COND_ICP 0.1
115 #define PM_MIN_STD_XY 20.0
116 #define PM_MIN_STD_ORIENTATION 4.0
117 #define PM_MATCH_ERROR_OFFSET 5.0
123 #define PM_TIME_FILE "results/iterations.txt"
129 #define PM_OCCLUDED 8
162 void pm_init(
const char* filename=NULL, FILE **fin=NULL);
172 void pm_plotScan(
PMScan *ls,
const char *col,
double diameter = 2.0,
bool connect_lines =
false);
182 bool corridor=
false,
PM_TYPE corr_angle=0);
void pm_plotScan4Thesis(PMScan *lsr, PMScan *lsa)
Plots current and reference scan in the way scans appeared in my thesis.
Definition: polar_match.cpp:1553
void pm_show_segmentation(const PMScan *ls)
Shows segmentation results by plotting segments with different colours.
Definition: polar_match.cpp:444
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)
Plots scan ls at robot/laser pose x, y, th.
Definition: polar_match.cpp:208
bool pm_is_corridor(PMScan *act)
Guesses if a scan was taken on a corridor.
Definition: polar_match.cpp:524
void pm_save_scan(PMScan *act, const char *filename)
Saves scan in a text file.
Definition: polar_match.cpp:1539
PM_TYPE r[PM_L_POINTS]
[cm] Laser range readings. 0 or negative ranges denote invalid readings.
Definition: polar_match.h:153
int pm_readScan(FILE *fin, PMScan *ls)
Reads one scan from file fin and stores it in ls.
Definition: polar_match.cpp:169
PM_TYPE ry
[cm] Robot odometry Y coordinate.
Definition: polar_match.h:151
void pm_unit_test(int matching_alg=PM_PSM, bool interactive=true)
Performs unit tests on scan matching.
Definition: polar_match.cpp:2097
PM_TYPE pm_error_index(PMScan *lsr, PMScan *lsa)
Calculates an error index expressing the quality of a match.
Definition: polar_match.cpp:678
const PM_TYPE PM_R2D
Conversion factor for converting radians to degrees.
Definition: polar_match.cpp:65
void pm_plotTime4Thesis(PM_TYPE xt, PM_TYPE yt, PM_TYPE tht, int *iter=NULL, double *time=NULL)
Generates a convergence speed plot from previously saved result.
Definition: polar_match.cpp:1625
double t
[s] Time when scan was taken.
Definition: polar_match.h:149
PM_TYPE x[PM_L_POINTS]
[cm] Laser reading X coordinates in Cartesian coordinates.
Definition: polar_match.h:154
#define PM_L_POINTS
Maximum number of points in a scan.
Definition: polar_match.h:84
PM_TYPE pm_error_index2(PMScan *ref, PMScan *cur, int *associatedPoints=NULL)
More quickly calculates an error index expressing the quality of a match.
Definition: polar_match.cpp:824
PM_TYPE pm_si[PM_L_POINTS]
Contains the sinus of each bearing.
Definition: polar_match.cpp:62
PM_TYPE rx
[cm] Robot odometry X coordinate.
Definition: polar_match.h:150
int bad[PM_L_POINTS]
Tag describing the validity of a range measurement. 0 if OK; sources of invalidity - out of range rea...
Definition: polar_match.h:156
void pm_init(const char *filename=NULL, FILE **fin=NULL)
Initialises internal variables and opens a log file.
Definition: polar_match.cpp:122
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.
Definition: polar_match.cpp:979
int seg[PM_L_POINTS]
Describes which segment the range reading belongs to.
Definition: polar_match.h:159
PM_TYPE pm_icp(const PMScan *lsr, PMScan *lsa)
Matches two laser scans using the iterative closest point method.
Definition: polar_match.cpp:1192
PM_TYPE th
[rad] Robot orientation.
Definition: polar_match.h:152
#define PM_TYPE
The variable type used in calculations. Change it to double for higher accuracy and lower speed...
Definition: polar_match.h:107
#define PM_PSM
Polar scan matching - matching bearing association rule.
Definition: polar_match.h:120
Structure describing a laser scan.
Definition: polar_match.h:147
PM_TYPE pm_co[PM_L_POINTS]
Contains the cosinus of each bearing.
Definition: polar_match.cpp:63
void pm_preprocessScan(PMScan *ls)
Prepares a scan for scan matching.
Definition: polar_match.cpp:493
PM_TYPE pm_fi[PM_L_POINTS]
Contains precomputed range bearings.
Definition: polar_match.cpp:61
PM_TYPE pm_corridor_angle(PMScan *act)
Determines the orientation of a corridor.
Definition: polar_match.cpp:885
PM_TYPE y[PM_L_POINTS]
[cm] Laser reading Y coordinates in Cartesian coordinates.
Definition: polar_match.h:155
PM_TYPE pm_psm(const PMScan *lsr, PMScan *lsa)
Match two laser scans using polar scan matching.
Definition: polar_match.cpp:1034
void pm_plotScan(PMScan *ls, const char *col, double diameter=2.0, bool connect_lines=false)
Plots scan ls.
Definition: polar_match.cpp:276
const PM_TYPE PM_D2R
Conversion factor for converting degrees to radians.
Definition: polar_match.cpp:64