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 haofan Zheng

Branch:
Drift
Revision:
80:c85cb93713b3
Child:
85:f3911aab41d9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/StateMachine/RunningState.h	Tue Apr 18 19:26:33 2017 +0000
@@ -0,0 +1,37 @@
+#pragma once
+#ifndef RUNNING_STATE_H
+#define RUNNING_STATE_H
+
+#include <mbed.h>
+#include "States.h"
+
+class RunningState : public States
+{
+public:
+    RunningState();
+    ~RunningState();
+    
+    virtual void DrawUserInterface();
+    
+    virtual void Update(float deltaTime);
+    
+    virtual uint8_t HasTouchPosFunction() const;
+    
+    virtual uint8_t HasTouchIrqFunction() const;
+    
+    virtual void TouchPosCallback(int16_t x, int16_t y);
+    
+    virtual void TouchIrqCallback();
+    
+private:
+    
+    float m_speedRatio;
+    float m_lastAngle;
+    float m_lastAngleAbs;
+    float m_cornerRatio;
+    uint8_t m_lastLineFound;
+    
+    void TerminateProcess();
+};
+
+#endif //RUNNING_STATE_H
\ No newline at end of file