David's dead reckoning code for the LVBots competition on March 6th. Uses the mbed LPC1768, DRV8835, QTR-3RC, and two DC motors with encoders.

Dependencies:   PololuEncoder Pacer mbed GeneralDebouncer

Committer:
DavidEGrayson
Date:
Sat Jul 27 22:52:19 2019 +0000
Revision:
43:0e985a58f174
Parent:
42:96671b71aac5
Child:
46:df2c2d25c070
Changed reckoner to use readings from turnSensor (Gyro) to get its direction vector instead of encoder ticks.

Who changed what in which revision?

UserRevisionLine numberNew 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 42:96671b71aac5 6 #include "turn_sensor.h"
DavidEGrayson 21:c279c6a83671 7
DavidEGrayson 42:96671b71aac5 8 void loadLineCalibration();
DavidEGrayson 42:96671b71aac5 9 void doGyroCalibration();
DavidEGrayson 28:4374035df5e0 10
DavidEGrayson 21:c279c6a83671 11 void waitForSignalToStart();
DavidEGrayson 28:4374035df5e0 12 void findLineAndCalibrate(); void findLine(); // two alternatives
DavidEGrayson 21:c279c6a83671 13 void turnRightToFindLine();
DavidEGrayson 21:c279c6a83671 14 void followLineToEnd();
DavidEGrayson 21:c279c6a83671 15 void driveHomeAlmost();
DavidEGrayson 21:c279c6a83671 16 void finalSettleIn();
DavidEGrayson 37:23000a47ed2b 17 void __attribute__((noreturn)) loggerReportLoop();
DavidEGrayson 21:c279c6a83671 18
DavidEGrayson 28:4374035df5e0 19 void updateMotorsToFollowLine();
DavidEGrayson 43:0e985a58f174 20 void updateReckoner();
DavidEGrayson 33:58a0ab6e9ad2 21 void setLeds(bool v1, bool v2, bool v3, bool v4);
DavidEGrayson 21:c279c6a83671 22 float determinant();
DavidEGrayson 21:c279c6a83671 23 float dotProduct();
DavidEGrayson 33:58a0ab6e9ad2 24 float magnitude();
DavidEGrayson 37:23000a47ed2b 25 void loggerService();
DavidEGrayson 21:c279c6a83671 26
DavidEGrayson 21:c279c6a83671 27 extern Reckoner reckoner;
DavidEGrayson 21:c279c6a83671 28 extern LineTracker lineTracker;
DavidEGrayson 42:96671b71aac5 29 extern TurnSensor turnSensor;
DavidEGrayson 42:96671b71aac5 30 extern Logger logger;