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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. }
  16. void State::Autonomous::exit(LFR_StateMachine* stateMachine)
  17. {
  18. stateMachine->setState(State::Idle::getInstance());
  19. }
  20. LFR_IState& State::Autonomous::getInstance()
  21. {
  22. static State::Autonomous singleton;
  23. return singleton;
  24. }
  25. void State::Manual::enter(LFR_StateMachine* stateMachine)
  26. {
  27. }
  28. void State::Manual::exit(LFR_StateMachine* stateMachine)
  29. {
  30. stateMachine->setState(State::Idle::getInstance());
  31. }
  32. LFR_IState& State::Manual::getInstance()
  33. {
  34. static State::Manual singleton;
  35. return singleton;
  36. }