14 #define DEBUG cout << __PRETTY_FUNCTION__ 15 #define MAX_STRING_LENGTH 1024 17 int main(
int argc,
const char *
const * argv){
25 double patchDelta=0.1;
28 double maxUrange=81.9;
36 bool computeCovariance=
false;
37 bool readFromStdin=
false;
39 double laserx=.0,lasery=.0,lasertheta=.0;
44 cout <<
"usage main {arglist}" << endl;
45 cout <<
"where the arguments are: " << endl;
46 cout <<
"\t -xmin <value>" << endl;
47 cout <<
"\t -xmax <value>" << endl;
48 cout <<
"\t -ymin <value>" << endl;
49 cout <<
"\t -ymax <value>" << endl;
50 cout <<
"\t -maxrange <value> : maxmimum preception range" << endl;
51 cout <<
"\t -delta <value> : patch size" << endl;
52 cout <<
"\t -patchDelta <value> : patch cell size" << endl;
53 cout <<
"\t -lstep <value> : linear serach step" << endl;
54 cout <<
"\t -astep <value> : ìangular search step" << endl;
55 cout <<
"\t -regscore <value> : registration scan score" << endl;
56 cout <<
"\t -filename <value> : log filename in carmen format" << endl;
57 cout <<
"\t -sigma <value> : convolution kernel size" << endl;
58 cout <<
"Look the code for discovering another thousand of unuseful parameters" << endl;
81 parseFlag(
"-computeCovariance",computeCovariance);
89 if (!filename.size()){
90 cout <<
"no filename specified" << endl;
95 is.open(filename.c_str());
97 cout <<
"no file found" << endl;
102 DEBUG <<
"scanmatcher processor construction" << endl;
106 scanmatcher.
setMatchingParameters(maxUrange, maxrange, sigma, kernelSize, lstep, astep, iterations, computeCovariance);
109 scanmatcher.
useICP=useICP;
121 ifstream plainStream;
122 if (! readFromStdin){
123 plainStream.open(filename.c_str());
125 cout <<
"Plain Stream opened="<< (bool) plainStream << endl;
128 cout <<
"Plain Stream opened on stdin" << endl;
140 if (! readFromStdin){
141 if (! outfilename.size()){
142 outfilename=string(
"scanmatched")+filename;
144 poseStream.open(outfilename.c_str());
150 ofstream odopathStream(
"odopath.dat");
161 if (! readFromStdin){
162 cout <<
"." << flush;
165 assert (rs && rs->
beams().size()==rr->size());
170 *output <<
"FLASER "<< rr->size() <<
" ";
172 *output <<
"RLASER "<< rr->size() <<
" ";
173 for (RangeReading::const_iterator b=rr->begin(); b!=rr->end(); b++){
174 *output << *b <<
" ";
176 *output << p.
x <<
" " << p.
y <<
" " << p.
theta <<
" ";
179 *output << p.
x <<
" " << p.
y <<
" " << p.
theta <<
" ";
180 *output << t <<
" nohost " << t << endl;
183 if (! readFromStdin){
const char *const *argv double delta
#define parseFlag(name, value)
const Sensor * getSensor() const
void setSensorMap(const SensorMap &smap, std::string sensorName="FLASER")
virtual SensorMap computeSensorMap() const
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)
virtual std::istream & load(std::istream &is)
#define parseDouble(name, value)
const OrientedPoint & getPose() const
#define parseInt(name, value)
#define parseString(name, value)
std::map< std::string, Sensor * > SensorMap
virtual void processScan(const RangeReading &reading)
int main(int argc, const char *const *argv)
OrientedPoint getPose() const
OrientedPoint getPose() const
const std::vector< Beam > & beams() const
orientedpoint< double, double > OrientedPoint
void setmaxMove(double mmove)
CMD_PARSE_BEGIN(1, argc-2)