David's line following code from the LVBots competition, 2015.
Dependencies: GeneralDebouncer Pacer PololuEncoder mbed
Fork of DeadReckoning by
logger.h@37:23000a47ed2b, 2014-03-06 (annotated)
- Committer:
- DavidEGrayson
- Date:
- Thu Mar 06 05:11:46 2014 +0000
- Revision:
- 37:23000a47ed2b
- Child:
- 46:f11cb4f93aac
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 | 37:23000a47ed2b | 1 | #pragma once |
DavidEGrayson | 37:23000a47ed2b | 2 | |
DavidEGrayson | 37:23000a47ed2b | 3 | #include <stdint.h> |
DavidEGrayson | 37:23000a47ed2b | 4 | |
DavidEGrayson | 37:23000a47ed2b | 5 | #define LOGGER_SIZE 2000 |
DavidEGrayson | 37:23000a47ed2b | 6 | |
DavidEGrayson | 37:23000a47ed2b | 7 | struct LogEntry |
DavidEGrayson | 37:23000a47ed2b | 8 | { |
DavidEGrayson | 37:23000a47ed2b | 9 | //int16_t cos; |
DavidEGrayson | 37:23000a47ed2b | 10 | //int16_t sin; |
DavidEGrayson | 37:23000a47ed2b | 11 | int16_t x; |
DavidEGrayson | 37:23000a47ed2b | 12 | int16_t y; |
DavidEGrayson | 37:23000a47ed2b | 13 | }; |
DavidEGrayson | 37:23000a47ed2b | 14 | |
DavidEGrayson | 37:23000a47ed2b | 15 | class Logger |
DavidEGrayson | 37:23000a47ed2b | 16 | { |
DavidEGrayson | 37:23000a47ed2b | 17 | public: |
DavidEGrayson | 37:23000a47ed2b | 18 | Logger(); |
DavidEGrayson | 37:23000a47ed2b | 19 | void log(); |
DavidEGrayson | 37:23000a47ed2b | 20 | void dump(); |
DavidEGrayson | 37:23000a47ed2b | 21 | bool isFull(); |
DavidEGrayson | 37:23000a47ed2b | 22 | |
DavidEGrayson | 37:23000a47ed2b | 23 | LogEntry entries[LOGGER_SIZE]; |
DavidEGrayson | 37:23000a47ed2b | 24 | |
DavidEGrayson | 37:23000a47ed2b | 25 | // The index of the next entry to write to. |
DavidEGrayson | 37:23000a47ed2b | 26 | int32_t entryIndex; |
DavidEGrayson | 37:23000a47ed2b | 27 | }; |
DavidEGrayson | 37:23000a47ed2b | 28 |