2017年度の製作を開始します

Dependencies:   mbed mbed-rtos

Fork of Control_Main_Full_20160608 by albatross

Branch:
?????
Revision:
49:87af91607b46
Child:
52:a9d23be503c6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/InputHandler/InputHandler.h	Sun Jun 04 13:29:51 2017 +0000
@@ -0,0 +1,46 @@
+#ifndef InputHandler
+#define InputHandler
+
+#include "mbed.h"
+
+#define NEUWIDTH 0.2
+#define NORMMAX 1.0
+#define NORMMIN -1.0
+#define WIDENRATE NORMMAX/(NORMMAX - NEUWIDTH)
+#define NEUTRAL_SUM_NUM 10
+
+class InputCalc
+{
+private:
+    double rawNeu;
+    double rawMax;
+    double rawMin;
+    double shiftedMax;
+    double shiftedMin;
+    double NeushiftWidth;
+    double upperShiftRate;
+    double lowerShiftRate;
+
+public:
+     InputCalc();
+    void setNeutral(float input);
+    void setMaxAndMin(double input);
+
+    //入力値の中央値を0とし、その分最大値と最小値をシフトします
+    void shift2ZeroNeu();
+
+    //シフトした後の値を-1.0~1.0へと正規化するための比率を取得します
+    void GetNormRate();
+
+    //値を-1.0~1.0へと正規化します
+    void NormValue(double *input);
+
+    //初期値の分、入力値を0に寄せて、拡大します。
+    void WidenNeutral(double* input) ;
+    
+    double CutInvalidInput(double input);
+    
+    //上記のメソッドを使用したループ内処理
+    double Processing(double input);
+};
+#endif
\ No newline at end of file