From: petr Date: Mon, 7 May 2012 21:29:17 +0000 (+0200) Subject: Odometry autocalibration X-Git-Url: http://rtime.felk.cvut.cz/gitweb/eurobot/public.git/commitdiff_plain/b6d168ef35f00341799d5ed63b1d25633031ff17 Odometry autocalibration Correction of mean calculation and shorten time for testing traversed distance. --- diff --git a/src/robofsm/common-states.cc b/src/robofsm/common-states.cc index d4a0c7b8..8914ecfe 100644 --- a/src/robofsm/common-states.cc +++ b/src/robofsm/common-states.cc @@ -435,7 +435,7 @@ FSM_STATE(go_back_for_cal) PLAYGROUND_HEIGHT_M - (ROBOT_WIDTH_M/2.0), 0); robot_move_by(-1.1, NO_TURN(), &tcVerySlow); - FSM_TIMER(150); + FSM_TIMER(200); break; case EV_MOTION_DONE: ROBOT_LOCK(est_pos_odo); diff --git a/src/robofsm/robot.c b/src/robofsm/robot.c index 5aeb5dd4..c4fc0346 100644 --- a/src/robofsm/robot.c +++ b/src/robofsm/robot.c @@ -305,9 +305,9 @@ void robot_calibrate_odometry() float b = 0; int num = 0; while (fgets (line, 10 , file)) { - a = atof(line); + a += atof(line); fgets (line, 10 , file); - b = atof(line); + b += atof(line); num ++; } fclose (file);