16 #define DEBUG cout << __func__ 17 #define MAX_STRING_LENGTH 1024 19 int main(
int argc,
const char *
const * argv){
27 double patchDelta=0.1;
30 double maxUrange=81.9;
38 bool computeCovariance=
false;
39 bool readFromStdin=
false;
41 double laserx=.0,lasery=.0,lasertheta=.0;
46 cout <<
"usage main {arglist}" << endl;
47 cout <<
"where the arguments are: " << endl;
48 cout <<
"\t -xmin <value>" << endl;
49 cout <<
"\t -xmax <value>" << endl;
50 cout <<
"\t -ymin <value>" << endl;
51 cout <<
"\t -ymax <value>" << endl;
52 cout <<
"\t -maxrange <value> : maxmimum preception range" << endl;
53 cout <<
"\t -delta <value> : patch size" << endl;
54 cout <<
"\t -patchDelta <value> : patch cell size" << endl;
55 cout <<
"\t -lstep <value> : linear serach step" << endl;
56 cout <<
"\t -astep <value> : ìangular search step" << endl;
57 cout <<
"\t -regscore <value> : registration scan score" << endl;
58 cout <<
"\t -filename <value> : log filename in carmen format" << endl;
59 cout <<
"\t -sigma <value> : convolution kernel size" << endl;
60 cout <<
"Look the code for discovering another thousand of unuseful parameters" << endl;
83 parseFlag(
"-computeCovariance",computeCovariance);
91 if (!filename.size()){
92 cout <<
"no filename specified" << endl;
97 is.open(filename.c_str());
99 cout <<
"no file found" << endl;
104 DEBUG <<
"scanmatcher processor construction" << endl;
108 scanmatcher.
setMatchingParameters(maxUrange, maxrange, sigma, kernelSize, lstep, astep, iterations, computeCovariance);
111 scanmatcher.
useICP=useICP;
123 ifstream plainStream;
124 if (! readFromStdin){
125 plainStream.open(filename.c_str());
127 cout <<
"Plain Stream opened="<< (bool) plainStream << endl;
130 cout <<
"Plain Stream opened on stdin" << endl;
142 if (! readFromStdin){
143 if (! outfilename.size()){
144 outfilename=string(
"scanmatched")+filename;
146 poseStream.open(outfilename.c_str());
152 ofstream odopathStream(
"odopath.dat");
163 if (! readFromStdin){
164 cout <<
"." << flush;
167 assert (rs && rs->
beams().size()==rr->size());
172 *output <<
"FLASER "<< rr->size() <<
" ";
174 *output <<
"RLASER "<< rr->size() <<
" ";
175 for (RangeReading::const_iterator b=rr->begin(); b!=rr->end(); b++){
176 *output << *b <<
" ";
178 *output << p.
x <<
" " << p.
y <<
" " << p.
theta <<
" ";
181 *output << p.
x <<
" " << p.
y <<
" " << p.
theta <<
" ";
182 *output << t <<
" nohost " << t << endl;
185 if (! readFromStdin){
const char *const *argv double delta
#define parseFlag(name, value)
const std::vector< Beam > & beams() const
const Sensor * getSensor() const
void setSensorMap(const SensorMap &smap, std::string sensorName="FLASER")
void setRegistrationParameters(double regScore, double critScore)
void setMatchingParameters(double urange, double range, double sigma, int kernsize, double lopt, double aopt, int iterations, bool computeCovariance=false)
OrientedPoint getPose() const
virtual std::istream & load(std::istream &is)
#define parseDouble(name, value)
#define parseInt(name, value)
#define parseString(name, value)
std::map< std::string, Sensor * > SensorMap
virtual SensorMap computeSensorMap() const
virtual void processScan(const RangeReading &reading)
OrientedPoint getPose() const
int main(int argc, const char *const *argv)
const OrientedPoint & getPose() const
orientedpoint< double, double > OrientedPoint
void setmaxMove(double mmove)
CMD_PARSE_BEGIN(1, argc-2)