David's line following code from the LVBots competition, 2015.
Dependencies: GeneralDebouncer Pacer PololuEncoder mbed
Fork of DeadReckoning by
Diff: turn_sensor.cpp
- Revision:
- 55:05c8f439497d
- Parent:
- 50:517c0f0e621f
diff -r 1ca4e748e098 -r 05c8f439497d turn_sensor.cpp --- a/turn_sensor.cpp Thu Apr 16 20:21:13 2015 +0000 +++ b/turn_sensor.cpp Thu Apr 16 20:59:35 2015 +0000 @@ -49,6 +49,12 @@ // // (0.07 dps/digit) * (1/1000000 s/us) * (2^29/45 unit/degree) // = 14680064/17578125 unit/(digit*us) + //const float factor = (float)14680064 / 17578125; + + // Fudge factor to account for the fact that the gyro might be mounted + // at a bad angle or it might be more or less sensitive than expected. + //const float fudge = 0.98809906722; + angleUnsigned += (int64_t)d * 14680064 / 17578125; } } \ No newline at end of file