David's line following code from the LVBots competition, 2015.
Dependencies: GeneralDebouncer Pacer PololuEncoder mbed
Fork of DeadReckoning by
main.h@37:23000a47ed2b, 2014-03-06 (annotated)
- Committer:
- DavidEGrayson
- Date:
- Thu Mar 06 05:11:46 2014 +0000
- Revision:
- 37:23000a47ed2b
- Parent:
- 33:58a0ab6e9ad2
- Child:
- 39:a5e25fd52ff8
With a boost 0.2% to handleRight in the Reckoner, this code did very well on the course twice!! Then I ran it the other way and it was more than a foot off :(
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DavidEGrayson | 21:c279c6a83671 | 1 | #pragma once |
DavidEGrayson | 21:c279c6a83671 | 2 | |
DavidEGrayson | 21:c279c6a83671 | 3 | #include "reckoner.h" |
DavidEGrayson | 21:c279c6a83671 | 4 | #include "line_tracker.h" |
DavidEGrayson | 37:23000a47ed2b | 5 | #include "logger.h" |
DavidEGrayson | 21:c279c6a83671 | 6 | |
DavidEGrayson | 28:4374035df5e0 | 7 | void loadCalibration(); |
DavidEGrayson | 28:4374035df5e0 | 8 | |
DavidEGrayson | 21:c279c6a83671 | 9 | void waitForSignalToStart(); |
DavidEGrayson | 28:4374035df5e0 | 10 | void findLineAndCalibrate(); void findLine(); // two alternatives |
DavidEGrayson | 21:c279c6a83671 | 11 | void turnRightToFindLine(); |
DavidEGrayson | 21:c279c6a83671 | 12 | void followLineToEnd(); |
DavidEGrayson | 21:c279c6a83671 | 13 | void driveHomeAlmost(); |
DavidEGrayson | 21:c279c6a83671 | 14 | void finalSettleIn(); |
DavidEGrayson | 37:23000a47ed2b | 15 | void __attribute__((noreturn)) loggerReportLoop(); |
DavidEGrayson | 21:c279c6a83671 | 16 | |
DavidEGrayson | 28:4374035df5e0 | 17 | void updateMotorsToFollowLine(); |
DavidEGrayson | 21:c279c6a83671 | 18 | void updateReckonerFromEncoders(); |
DavidEGrayson | 33:58a0ab6e9ad2 | 19 | void setLeds(bool v1, bool v2, bool v3, bool v4); |
DavidEGrayson | 21:c279c6a83671 | 20 | float determinant(); |
DavidEGrayson | 21:c279c6a83671 | 21 | float dotProduct(); |
DavidEGrayson | 33:58a0ab6e9ad2 | 22 | float magnitude(); |
DavidEGrayson | 37:23000a47ed2b | 23 | void loggerService(); |
DavidEGrayson | 21:c279c6a83671 | 24 | |
DavidEGrayson | 21:c279c6a83671 | 25 | extern Reckoner reckoner; |
DavidEGrayson | 21:c279c6a83671 | 26 | extern LineTracker lineTracker; |
DavidEGrayson | 37:23000a47ed2b | 27 | extern Logger logger; |