12345678910111213141516171819202122232425262728293031323334 |
- #pragma once
- #include <iostream>
- #include <lfr.h>
- #include <lfr_socket.h>
- #include <uart_communication.h>
- #include "lfr_state_interface.h"
-
- class LFR_StateMachine
- {
- LFR_IState* currentState;
- LFR_StateMachine() = delete;
-
- const int thresholdBinary = 140;
- const int videoHeight = 720;
- const int videoWidth = 1280;
- const int gaussKernelSize = 11;
-
- std::mutex mutex;
-
- LFR autonomousMode;
- LFR_UART uartCommunicator;
- LFR_Socket socket;
-
-
- public:
- LFR_StateMachine(LFR_IState& startState);
- inline LFR_IState* getCurrentState() const {return currentState;}
- void setState(LFR_IState& newState)
- {
- currentState->exit(this);
- currentState = &newState;
- currentState->enter(this);
- }
- };
|