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.cpp 939B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include "lfr_state_machine.h"
  2. /* void State::Idle::toggle(LFR_StateMachine* stateMachine)
  3. {
  4. stateMachine->setState()
  5. } */
  6. void State::Idle::enter(LFR_StateMachine* stateMachine)
  7. {
  8. }
  9. void State::Idle::exit(LFR_StateMachine* stateMachine)
  10. {
  11. }
  12. LFR_State& State::Idle::getInstance()
  13. {
  14. static State::Idle singleton;
  15. return singleton;
  16. }
  17. void State::Autonomous::enter(LFR_StateMachine* stateMachine)
  18. {
  19. }
  20. void State::Autonomous::exit(LFR_StateMachine* stateMachine)
  21. {
  22. stateMachine->setState(State::Idle::getInstance());
  23. }
  24. LFR_State& State::Autonomous::getInstance()
  25. {
  26. static State::Autonomous singleton;
  27. return singleton;
  28. }
  29. void State::Manual::enter(LFR_StateMachine* stateMachine)
  30. {
  31. }
  32. void State::Manual::exit(LFR_StateMachine* stateMachine)
  33. {
  34. stateMachine->setState(State::Idle::getInstance());
  35. }
  36. LFR_State& State::Manual::getInstance()
  37. {
  38. static State::Manual singleton;
  39. return singleton;
  40. }