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

1234567891011121314151617181920212223242526272829303132333435363738
  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. const double maxSpeed = 0.5;
  17. std::mutex mutex;
  18. LFR autonomousMode;
  19. LFR_UART uartCommunicator;
  20. LFR_Socket socket;
  21. vector<string> split (string s, string delimiter) const;
  22. void sanitize (string& s) const;
  23. bool checkStringValidity (const std::vector<std::string>& s) const;
  24. void parseString(string s);
  25. public:
  26. void enterAutonomous();
  27. void exitAutonomous();
  28. LFR_StateMachine();
  29. inline LFR_IState* getCurrentState() const {return currentState;}
  30. void setState(LFR_IState& newState);
  31. };