21 os <<
"#GFS_COMMENT: " <<
text << endl;
38 os << setiosflags(ios::fixed) << setprecision(6);
40 os <<
time <<
" pippo " <<
time << endl;
52 os <<
"NEFF " <<
neff ;
53 os << setiosflags(ios::fixed) << setprecision(6);
54 os <<
" " <<
time <<
" pippo " <<
time << endl;
60 for (
unsigned int i=0; i<
dim; i++){
94 os <<
" " <<
time <<
" pippo " <<
time << endl;
99 for (
unsigned int i=0; i<
dim; i++){
113 for (
unsigned int i=0; i<
dim; i++){
127 os <<
"WEIGHT " <<
weight << endl;
128 os <<
"ROBOTLASER1 ";
131 if ((
dim == 541)||(
dim == 540)) {
138 else if ((
dim == 180)||(
dim == 181)) {
145 else if ((
dim == 360)||(
dim == 361)) {
152 else if ((
dim == 682)||(
dim == 683)) {
156 os <<
" " << 360.0/1024.0/180.0*M_PI;
169 os << setiosflags(ios::fixed) << setprecision(2);
170 for (
unsigned int i=0; i<
dim; i++){
173 os << setiosflags(ios::fixed) << setprecision(6);
186 os <<
" "<<
time <<
" localhost " <<
time << endl;
191 for (
unsigned int i=0; i<
dim; i++){
202 istringstream lineStream(buf);
204 lineStream >> recordType;
206 if (recordType==
"LASER_READING"){
210 else if (recordType==
"ODO_UPDATE"){
214 else if (recordType==
"ODOM"){
218 else if (recordType==
"SM_UPDATE"){
222 else if (recordType==
"SIMULATOR_POS"){
226 else if (recordType==
"RESAMPLE"){
230 else if (recordType==
"NEFF"){
234 else if (recordType==
"COMMENT" || recordType==
"#COMMENT"){
238 else if (recordType==
"ENTROPY"){
244 rec->
read(lineStream);
253 unsigned int currentIndex=i;
254 for(RecordList::const_reverse_iterator it=rbegin(); it!=rend(); it++){
257 weight+=scanmatch->
weights[currentIndex];
261 currentIndex=
resample->indexes[currentIndex];
269 unsigned int currentIndex=i;
270 for(RecordList::const_reverse_iterator it(frame); it!=rend(); it++){
273 weight+=scanmatch->
weights[currentIndex];
277 currentIndex=
resample->indexes[currentIndex];
287 const_reverse_iterator it=rbegin();
292 unsigned int dim=scanmatch->
dim;
295 unsigned int best=scanmatch->
dim+1;
296 for (
unsigned i=0; i<dim; i++){
310 const_reverse_iterator it=rbegin();
317 for (vector<OrientedPoint>::const_iterator it=scanmatch->
poses.begin(); it!=scanmatch->
poses.end(); it++){
318 os <<
"MARKER [color=black; circle=" << it->x*100 <<
"," << it->y*100 <<
",10] 0 pippo 0" << endl;
323 for(RecordList::iterator it=begin(); it!=end(); it++)
329 unsigned int currentIndex=i;
335 for(RecordList::const_reverse_iterator it(frame); it!=rend(); it++){
338 p=scanmatch->
poses[currentIndex];
342 if (laser && !first){
345 rl.push_front(claser);
349 currentIndex=
resample->indexes[currentIndex];
357 unsigned int currentIndex=i;
363 for(RecordList::const_reverse_iterator it=rbegin(); it!=rend(); it++){
378 p=pose->
pose=scanmatch->
poses[currentIndex];
379 w=scanmatch->
weights[currentIndex]-oldWeight;
380 oldWeight=scanmatch->
weights[currentIndex];
390 p=pose->
pose=odometry->
poses[currentIndex];
416 rl.push_front(claser);
421 rl.push_front(ccomment);
426 currentIndex=
resample->indexes[currentIndex];
431 bool computedTransformation=
false;
432 bool truePosFound=
false;
440 for(RecordList::iterator it=
rl.begin(); it!=
rl.end(); it++){
444 started=started ||
dynamic_cast<const LaserRecord*
>(*it)?
true:
false;
445 if (started && ! truePosFound){
450 truePose=tpose->
pose;
455 if (started && truePosFound && ! computedTransformation){
462 computedTransformation=
true;
465 if (computedTransformation){
466 os << setiosflags(ios::fixed) << setprecision(6);
477 double ex=realDelta.
x-trueDelta.
x;
478 double ey=realDelta.
y-trueDelta.
y;
480 eth=atan2(sin(eth), cos(eth));
484 << ex <<
" " << ey <<
" " << eth
485 <<
" " << sqrt(ex*ex+ey*ey) <<
" " << fabs(eth) << endl;
486 totalError+=sqrt(ex*ex+ey*ey);
501 cout <<
"average error" << totalError/count << endl;