Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lfr_state_machine.h 758B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <iostream>
  3. #include <lfr.h>
  4. #include <lfr_socket.h>
  5. #include <uart_communication.h>
  6. #include "lfr_state_interface.h"
  7. class LFR_StateMachine
  8. {
  9. LFR_IState* currentState;
  10. LFR_StateMachine() = delete;
  11. const int thresholdBinary = 140;
  12. const int videoHeight = 720;
  13. const int videoWidth = 1280;
  14. const int gaussKernelSize = 11;
  15. std::mutex mutex;
  16. LFR autonomousMode;
  17. LFR_UART uartCommunicator;
  18. LFR_Socket socket;
  19. public:
  20. LFR_StateMachine(LFR_IState& startState);
  21. inline LFR_IState* getCurrentState() const {return currentState;}
  22. void setState(LFR_IState& newState)
  23. {
  24. currentState->exit(this);
  25. currentState = &newState;
  26. currentState->enter(this);
  27. }
  28. };