David's line following code from the LVBots competition, 2015.
Dependencies: GeneralDebouncer Pacer PololuEncoder mbed
Fork of DeadReckoning by
Diff: reckoner.cpp
- Revision:
- 37:23000a47ed2b
- Parent:
- 36:ccb03b734737
- Child:
- 46:f11cb4f93aac
--- a/reckoner.cpp Thu Mar 06 02:39:07 2014 +0000 +++ b/reckoner.cpp Thu Mar 06 05:11:46 2014 +0000 @@ -153,7 +153,9 @@ void Reckoner::handleRight() { - handleTurnRadians(-DA); + // DA = 4790484 + // 0.2% boost + handleTurnRadians(-4800065); } void Reckoner::handleLeft() @@ -165,6 +167,8 @@ { int32_t dc = -((int64_t)sin * radians) >> LOG_UNIT_MAGNITUDE; int32_t ds = ((int64_t)cos * radians) >> LOG_UNIT_MAGNITUDE; + dc = -((int64_t)(sin+ds/2) * radians) >> LOG_UNIT_MAGNITUDE; + ds = ((int64_t)(cos+dc/2) * radians) >> LOG_UNIT_MAGNITUDE; cos += dc; sin += ds; } \ No newline at end of file