ready to test capture Route and Autopiloz

This commit is contained in:
2022-02-03 19:50:48 +01:00
parent 5ca21b09b2
commit bc37abcb66
20 changed files with 226 additions and 39 deletions
@@ -3,6 +3,7 @@
CaptureRoute::CaptureRoute(MoveControl* moveControl, Navigation* navigation)
: ManualControl(moveControl) {
this->navigation = navigation;
this->routeInfo = RouteInfo{0, 0};
}
void CaptureRoute::loop() {
@@ -18,5 +19,15 @@ void CaptureRoute::loop() {
void CaptureRoute::runCaptureRoute() {
if (Ps3.data.button.triangle) {
this->navigation->addCurrentPosToRoute();
this->routeInfo.totalPoints++;
this->updateDisplay = true;
}
}
bool CaptureRoute::shouldUpdate() {
if (this->updateDisplay) {
this->updateDisplay = false;
return true;
}
return false;
}