MbICP2.h
Go to the documentation of this file.
1 /**************************************************************************************************
2  Software License Agreement (BSD License)
3 
4  Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted
8  provided that the following conditions are met:
9 
10  *Redistributions of source code must retain the above copyright notice, this list of
11  conditions and the following disclaimer.
12  *Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided
14  with the distribution.
15  *Neither the name of the University of Aveiro nor the names of its contributors may be used to
16  endorse or promote products derived from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***************************************************************************************************/
27 /*************************************************************************************/
28 /* */
29 /* File: MbICP.h */
30 /* Authors: Luis Montesano and Javier Minguez */
31 /* Modified: 1/3/2006 */
32 /* */
33 /* This library implements the: */
34 /* */
35 /* J. Minguez, F. Lamiraux and L. Montesano */
36 /* Metric-Based Iterative Closest Point, */
37 /* Scan Matching for Mobile Robot Displacement Estimation */
38 /* IEEE Transactions on Roboticics (2006) */
39 /* */
40 /*************************************************************************************/
41 /*
42  * This program is free software; you can redistribute it and/or modify
43  * it under the terms of the GNU General Public License as published by
44  * the Free Software Foundation; either version 2 of the License, or
45  * (at your option) any later version.
46  *
47  * This program is distributed in the hope that it will be useful,
48  * but WITHOUT ANY WARRANTY; without even the implied warranty of
49  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50  * GNU General Public License for more details.
51  *
52  * You should have received a copy of the GNU General Public License
53  * along with this program; if not, write to the Free Software
54  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
55  *
56  */
57 
58 /* **************************************************************************************** */
59 // This file contains inner information of the MbICP that you want to see from the outside
60 /* **************************************************************************************** */
61 
67 #ifndef MbICP2
68 #define MbICP2
69 
70 #include "MbICP.h"
71 #include "TData.h"
72 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
77 // ---------------------------------------------------------------
78 // ---------------------------------------------------------------
79 // Types definition
80 // ---------------------------------------------------------------
81 // ---------------------------------------------------------------
82 
83 
84 // ************************
85 // Associations information
86 
87 /*
88 typedef struct{
89  float rx,ry,nx,ny,dist; // Point (nx,ny), static corr (rx,ry), dist
90  int numDyn; // Number of dynamic associations
91  float unknown; // Unknown weight
92  int index; // Index within the original scan
93  int L,R;
94 }TAsoc;
95 */
96 
97 // ************************
98 // Scan inner matching parameters
99 typedef struct{
100  /* --------------------- */
101  /* --- Thresold parameters */
102  /* Bw: maximum angle diference between points of different scans */
103  /* Points with greater Bw cannot be correspondent (eliminate spurius asoc.) */
104  /* This is a speed up parameter */
105  float Bw;
106 
107  /* Br: maximum distance difference between points of different scans */
108  /* Points with greater Br cannot be correspondent (eliminate spurius asoc.) */
109  float Br;
110 
111  /* --------------------- */
112  /* --- Inner parameters */
113 
114  /* L: value of the metric */
115  /* When L tends to infinity you are using the standart ICP */
116  /* When L tends to 0 you use the metric (more importance to rotation */
117  float LMET;
118 
119  /* laserStep: selects points of each scan with an step laserStep */
120  /* When laserStep=1 uses all the points of the scans */
121  /* When laserStep=2 uses one each two ... */
122  /* This is an speed up parameter */
124 
125  /* ProjectionFilter: */
126  /* Eliminate the points that cannot be seen given the two scans (see Lu&Millios 97) */
127  /* It works well for angles < 45 \circ*/
128  /* 1 : activates the filter */
129  /* 0 : desactivates the filter */
131 
132  /* MaxDistInter: maximum distance to interpolate between points in the ref scan */
133  /* Consecutive points with less Euclidean distance than MaxDistInter are considered to be a segment */
135 
136  /* filtrado: in [0,1] sets the % of asociations NOT considered spurious */
137  float filter;
138 
139  /* AsocError: in [0,1] */
140  /* One way to check if the algorithm diverges if to supervise if the number of associatios goes below a thresold */
141  /* When the number of associations is below AsocError, the main function will return error in associations step */
142  float AsocError;
143 
144  /* --------------------- */
145  /* --- Exit parameters */
146  /* MaxIter: sets the maximum number of iterations for the algorithm to exit */
147  /* More iterations more chance you give the algorithm to be more accurate */
148  int MaxIter;
149 
150  /* error_th: in [0,1] sets the maximum error ratio between iterations to exit */
151  /* In each iteration, the error is the residual of the minimization */
152  /* When error_th tends to 1 more precise is the solution of the scan matching */
153  float error_th;
154 
155  /* errx_out,erry_out, errt_out: minimum error of the asociations to exit */
156  /* In each iteration, the error is the residual of the minimization in each component */
157  /* The condition is (lower than errx_out && lower than erry_out && lower than errt_out */
158  /* When error_XXX tend to 0 more precise is the solution of the scan matching */
159  float errx_out,erry_out, errt_out;
160 
161  /* IterSmoothConv: number of consecutive iterations that satisfity the error criteria */
162  /* (error_th) OR (errorx_out && errory_out && errt_out) */
163  /* With this parameter >1 avoids random solutions */
165 
166 }TSMparams;
167 
168 // ************************
169 // Structure to store the scans in polar and cartesian coordinates
170 
171 /*
172 typedef struct {
173  int numPuntos;
174  Tpf laserC[MAXLASERPOINTS]; // Cartesian coordinates
175  Tpfp laserP[MAXLASERPOINTS]; // Polar coordinates
176 }Tscan;
177 */
178 
179 // ---------------------------------------------------------------
180 // ---------------------------------------------------------------
181 // Variables definition
182 // ---------------------------------------------------------------
183 // ---------------------------------------------------------------
184 
185 
186 // ************************
187 // Static structure to initialize the SM parameters
188 extern TSMparams params;
189 
190 // Original points to be aligned
191 extern Tscan ptosRef;
192 extern Tscan ptosNew;
193 
194 // At each step::
195 
196 // Those points removed by the projection filter (see Lu&Millios -- IDC)
197 extern Tscan ptosNoView; // Only with ProjectionFilter=1;
198 
199 // Structure of the associations before filtering
201 extern int cntAssociationsT;
202 
203 // Filtered Associations
205 extern int cntAssociationsTemp;
206 
207 // Current motion estimation
208 extern Tsc motion2;
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif
float Br
Definition: MbICP2.h:109
int ProjectionFilter
Definition: MbICP2.h:130
TSMparams params
Definition: MbICP.c:103
Tscan ptosNew
Definition: MbICP.c:107
Types used in the MbICP algorithm.
MbICP scan matcher main header.
int cntAssociationsTemp
Definition: MbICP.c:115
Tscan ptosRef
Definition: MbICP.c:106
int cntAssociationsT
Definition: MbICP.c:111
int MaxIter
Definition: MbICP2.h:148
Tsc motion2
Definition: MbICP.c:121
Tscan ptosNoView
Definition: MbICP.c:118
#define MAXLASERPOINTS
Definition: TData.h:64
Definition: TData.h:84
int IterSmoothConv
Definition: MbICP2.h:164
float LMET
Definition: MbICP2.h:117
TAsoc cp_associationsTemp[MAXLASERPOINTS]
Definition: MbICP.c:114
Definition: TData.h:100
int laserStep
Definition: MbICP2.h:123
float MaxDistInter
Definition: MbICP2.h:134
float Bw
Definition: MbICP2.h:105
TAsoc cp_associations[MAXLASERPOINTS]
Definition: MbICP.c:110
float AsocError
Definition: MbICP2.h:142
float filter
Definition: MbICP2.h:137
float erry_out
Definition: MbICP2.h:159
float error_th
Definition: MbICP2.h:153
Definition: TData.h:90


lidar_egomotion
Author(s): Jorge Almeida
autogenerated on Mon Mar 2 2015 01:32:10