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 892B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <iostream>
  3. #include <algorithm>
  4. #include <lfr.h>
  5. #include <lfr_socket.h>
  6. #include <uart_communication.h>
  7. #include "lfr_state_interface.h"
  8. #include "lfr_states.h"
  9. class LFR_StateMachine
  10. {
  11. LFR_IState* currentState;
  12. const int thresholdBinary = 140;
  13. const int videoHeight = 720;
  14. const int videoWidth = 1280;
  15. const int gaussKernelSize = 11;
  16. std::mutex mutex;
  17. LFR autonomousMode;
  18. LFR_UART uartCommunicator;
  19. LFR_Socket socket;
  20. vector<string> split (string s, string delimiter) const;
  21. void sanitize (string& s) const;
  22. bool checkStringValidity (const std::vector<std::string>& s) const;
  23. void parseString(string s);
  24. public:
  25. void enterAutonomous();
  26. void exitAutonomous();
  27. LFR_StateMachine();
  28. inline LFR_IState* getCurrentState() const {return currentState;}
  29. void setState(LFR_IState& newState);
  30. };