X-Git-Url: http://rtime.felk.cvut.cz/gitweb/eurobot/public.git/blobdiff_plain/1ff21080e54ec7236fe1f2d682eb3e4e24fe257a..2d1408a4af74eb1d73816df3d17cc22a5e27e1f6:/src/robofsm/common-states.cc diff --git a/src/robofsm/common-states.cc b/src/robofsm/common-states.cc index 7556727b..1975f71a 100644 --- a/src/robofsm/common-states.cc +++ b/src/robofsm/common-states.cc @@ -36,7 +36,7 @@ UL_LOG_CUST(ulogd_common_states); /* Log domain name = ulogd + name of the file void set_initial_position() { robot_set_est_pos_trans(ROBOT_AXIS_TO_BACK_M, - PLAYGROUND_HEIGHT_M - (ROBOT_WIDTH_M/2.0) - 0.05, + PLAYGROUND_HEIGHT_M - (ROBOT_WIDTH_M/2.0), 0); } @@ -444,18 +444,20 @@ FSM_STATE(go_back_for_cal) x1 = robot.odo_distance_a; y1 = robot.odo_distance_b; ROBOT_UNLOCK(est_pos_odo); - printf("Distance for calibration: \n"); - printf("Left%f\n", x1); - printf("Right%f\n", y1); - FILE * file; - file = fopen ("odometry_cal_data","a+"); - sprintf(buffer, "%4.4f", -1/x1); - fputs (buffer,file); - fputs (" ", file); - sprintf(buffer, "%4.4f", -1/y1); - fputs (buffer,file); - fputs ("\n", file); - fclose(file); + if(x1 != 0 || y1 != 0) { + printf("Distance for calibration: \n"); + printf("Left%f\n", x1); + printf("Right%f\n", y1); + FILE * file; + file = fopen ("odometry_cal_data","a+"); + sprintf(buffer, "%4.4f", -1/x1); + fputs (buffer,file); + fputs (" ", file); + sprintf(buffer, "%4.4f", -1/y1); + fputs (buffer,file); + fputs ("\n", file); + fclose(file); + } SUBFSM_RET(NULL); break; case EV_TIMER: