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_states.cpp 1008B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include "lfr_states.h"
  2. void State::Idle::enter(LFR_StateMachine* stateMachine)
  3. {
  4. }
  5. void State::Idle::exit(LFR_StateMachine* stateMachine)
  6. {
  7. }
  8. LFR_IState& State::Idle::getInstance()
  9. {
  10. static State::Idle singleton;
  11. return singleton;
  12. }
  13. void State::Autonomous::enter(LFR_StateMachine* stateMachine)
  14. {
  15. std::cout << "enter autonomous mode" << std::endl;
  16. stateMachine->enterAutonomous();
  17. }
  18. void State::Autonomous::exit(LFR_StateMachine* stateMachine)
  19. {
  20. std::cout << "exit autonomous mode" << std::endl;
  21. stateMachine->exitAutonomous();
  22. }
  23. LFR_IState& State::Autonomous::getInstance()
  24. {
  25. static State::Autonomous singleton;
  26. return singleton;
  27. }
  28. void State::Manual::enter(LFR_StateMachine* stateMachine)
  29. {
  30. std::cout << "enter manual mode" << std::endl;
  31. }
  32. void State::Manual::exit(LFR_StateMachine* stateMachine)
  33. {
  34. std::cout << "exit manual mode" << std::endl;
  35. }
  36. LFR_IState& State::Manual::getInstance()
  37. {
  38. static State::Manual singleton;
  39. return singleton;
  40. }