Revision 6fab3966 scout/libscout/src/behaviors/line_follow.cpp

View differences:

scout/libscout/src/behaviors/line_follow.cpp
38 38
    {
39 39
        double line_loc = linesensor->readline();
40 40

  
41
        motor_l = -MOTOR_BASE + SCALE * line_loc;
42
        motor_r = -MOTOR_BASE - SCALE * line_loc;
41
        ROS_INFO("Line location: %lf.\n", line_loc);
42

  
43
        motor_l = min(max((int) (-MOTOR_BASE + SCALE * line_loc), -128), 127);
44
        motor_r = min(max((int) (-MOTOR_BASE - SCALE * line_loc), -128), 127);
43 45

  
44 46
        motors->set_sides(motor_l, motor_r, MOTOR_ABSOLUTE);
45 47
    }

Also available in: Unified diff