SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.
Dependencies: TSI USBDevice mbed-dev
Fork of SmartWheels by
StateMachine/RunningState.h@80:c85cb93713b3, 2017-04-18 (annotated)
- Committer:
- hazheng
- Date:
- Tue Apr 18 19:26:33 2017 +0000
- Branch:
- Drift
- Revision:
- 80:c85cb93713b3
- Child:
- 85:f3911aab41d9
Transfer to State Machine.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hazheng | 80:c85cb93713b3 | 1 | #pragma once |
hazheng | 80:c85cb93713b3 | 2 | #ifndef RUNNING_STATE_H |
hazheng | 80:c85cb93713b3 | 3 | #define RUNNING_STATE_H |
hazheng | 80:c85cb93713b3 | 4 | |
hazheng | 80:c85cb93713b3 | 5 | #include <mbed.h> |
hazheng | 80:c85cb93713b3 | 6 | #include "States.h" |
hazheng | 80:c85cb93713b3 | 7 | |
hazheng | 80:c85cb93713b3 | 8 | class RunningState : public States |
hazheng | 80:c85cb93713b3 | 9 | { |
hazheng | 80:c85cb93713b3 | 10 | public: |
hazheng | 80:c85cb93713b3 | 11 | RunningState(); |
hazheng | 80:c85cb93713b3 | 12 | ~RunningState(); |
hazheng | 80:c85cb93713b3 | 13 | |
hazheng | 80:c85cb93713b3 | 14 | virtual void DrawUserInterface(); |
hazheng | 80:c85cb93713b3 | 15 | |
hazheng | 80:c85cb93713b3 | 16 | virtual void Update(float deltaTime); |
hazheng | 80:c85cb93713b3 | 17 | |
hazheng | 80:c85cb93713b3 | 18 | virtual uint8_t HasTouchPosFunction() const; |
hazheng | 80:c85cb93713b3 | 19 | |
hazheng | 80:c85cb93713b3 | 20 | virtual uint8_t HasTouchIrqFunction() const; |
hazheng | 80:c85cb93713b3 | 21 | |
hazheng | 80:c85cb93713b3 | 22 | virtual void TouchPosCallback(int16_t x, int16_t y); |
hazheng | 80:c85cb93713b3 | 23 | |
hazheng | 80:c85cb93713b3 | 24 | virtual void TouchIrqCallback(); |
hazheng | 80:c85cb93713b3 | 25 | |
hazheng | 80:c85cb93713b3 | 26 | private: |
hazheng | 80:c85cb93713b3 | 27 | |
hazheng | 80:c85cb93713b3 | 28 | float m_speedRatio; |
hazheng | 80:c85cb93713b3 | 29 | float m_lastAngle; |
hazheng | 80:c85cb93713b3 | 30 | float m_lastAngleAbs; |
hazheng | 80:c85cb93713b3 | 31 | float m_cornerRatio; |
hazheng | 80:c85cb93713b3 | 32 | uint8_t m_lastLineFound; |
hazheng | 80:c85cb93713b3 | 33 | |
hazheng | 80:c85cb93713b3 | 34 | void TerminateProcess(); |
hazheng | 80:c85cb93713b3 | 35 | }; |
hazheng | 80:c85cb93713b3 | 36 | |
hazheng | 80:c85cb93713b3 | 37 | #endif //RUNNING_STATE_H |