]> rtime.felk.cvut.cz Git - eurobot/public.git/blobdiff - src/robofsm/robot.c
Odometry autocalibration
[eurobot/public.git] / src / robofsm / robot.c
index c4fc03463f5da4b07f3b3b1ef2aaf712dd15bad0..57e690a8b1701e9890f5addb90254d41fc566c8d 100644 (file)
@@ -300,14 +300,14 @@ void robot_calibrate_odometry()
                fprintf(stderr, "File not found. \n\n");
                return;
        }
-       char line [10];
+       char line [15];
        float a = 0;
        float b = 0;
        int num = 0;
-       while (fgets (line, 10 , file)) {
-               a += atof(line);
-               fgets (line, 10 , file);
-               b += atof(line);
+       while (fgets (line, 15 , file)) {
+               a += atof(strtok(line," "));
+               fgets (line, 15 , file);
+               b += atof(strtok(NULL," "));
                num ++;
        }
        fclose (file);