ready to test capture Route and Autopiloz
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -15,14 +15,17 @@ class CaptureRoute : public ManualControl {
|
||||
void runCaptureRoute();
|
||||
|
||||
Navigation* getNavigation() const { return this->navigation; }
|
||||
RouteInfo getRouteInfo() const { return this->routeInfo; }
|
||||
|
||||
bool shouldUpdate();
|
||||
private:
|
||||
Navigation* navigation;
|
||||
|
||||
uint16_t savedPoints = 0;
|
||||
RouteInfo routeInfo;
|
||||
|
||||
uint32_t last_millis = 0;
|
||||
uint16_t delay = 200;
|
||||
|
||||
bool updateDisplay = false;
|
||||
};
|
||||
|
||||
#endif // CAPTURE_ROUTE_H
|
||||
Reference in New Issue
Block a user