手動bのほぼ全部

Dependents:   kobayashi_rei 2019BSyudo Bsyudo 2019Bsyudo

Committer:
THtakahiro702286
Date:
Mon Jul 08 08:45:10 2019 +0000
Revision:
0:8d012d469eb4
Child:
1:38dd7564c15f
enything to do

Who changed what in which revision?

UserRevisionLine numberNew contents of line
THtakahiro702286 0:8d012d469eb4 1 #ifndef STATES_H
THtakahiro702286 0:8d012d469eb4 2 #define STATES_H
THtakahiro702286 0:8d012d469eb4 3
THtakahiro702286 0:8d012d469eb4 4 #include "mbed.h"
THtakahiro702286 0:8d012d469eb4 5 #include "PID.h"
THtakahiro702286 0:8d012d469eb4 6 #include "pin_config.h"
THtakahiro702286 0:8d012d469eb4 7 #include "controller.h"
THtakahiro702286 0:8d012d469eb4 8 #include "R1370.h"
THtakahiro702286 0:8d012d469eb4 9 #include "wheelUnit.h"
THtakahiro702286 0:8d012d469eb4 10
THtakahiro702286 0:8d012d469eb4 11 //#define PI 3.14159
THtakahiro702286 0:8d012d469eb4 12
THtakahiro702286 0:8d012d469eb4 13 /*角度制御*/
THtakahiro702286 0:8d012d469eb4 14 //#define angleKP 5.5 //速さ
THtakahiro702286 0:8d012d469eb4 15 //#define angleKI 5.0 //揺れすぎたら大きく、動かな過ぎたら小さく
THtakahiro702286 0:8d012d469eb4 16 //#define angleKD 0.0000005 //ずらしたときに戻る力 がでかすぎたら小さく、小さすぎたら大きく
THtakahiro702286 0:8d012d469eb4 17
THtakahiro702286 0:8d012d469eb4 18 /*角度情報*/
THtakahiro702286 0:8d012d469eb4 19 #define front 0
THtakahiro702286 0:8d012d469eb4 20 #define right 90
THtakahiro702286 0:8d012d469eb4 21 #define back 180
THtakahiro702286 0:8d012d469eb4 22 #define left -90
THtakahiro702286 0:8d012d469eb4 23
THtakahiro702286 0:8d012d469eb4 24
THtakahiro702286 0:8d012d469eb4 25 class States
THtakahiro702286 0:8d012d469eb4 26 {
THtakahiro702286 0:8d012d469eb4 27 public:
THtakahiro702286 0:8d012d469eb4 28 States();
THtakahiro702286 0:8d012d469eb4 29 void tellAngle();
THtakahiro702286 0:8d012d469eb4 30 void tellPad();
THtakahiro702286 0:8d012d469eb4 31 void move();
THtakahiro702286 0:8d012d469eb4 32 private:
THtakahiro702286 0:8d012d469eb4 33 /*モーター系*/
THtakahiro702286 0:8d012d469eb4 34 WheelUnit omni;
THtakahiro702286 0:8d012d469eb4 35 Serial serial;
THtakahiro702286 0:8d012d469eb4 36
THtakahiro702286 0:8d012d469eb4 37 /*角度制御*/
THtakahiro702286 0:8d012d469eb4 38 R1370 gyro;
THtakahiro702286 0:8d012d469eb4 39 PID anglePID;
THtakahiro702286 0:8d012d469eb4 40 float norm;
THtakahiro702286 0:8d012d469eb4 41 float nowAngle;
THtakahiro702286 0:8d012d469eb4 42 int idealAngle;
THtakahiro702286 0:8d012d469eb4 43 float deviation;
THtakahiro702286 0:8d012d469eb4 44 float turnPower;
THtakahiro702286 0:8d012d469eb4 45 int state;
THtakahiro702286 0:8d012d469eb4 46
THtakahiro702286 0:8d012d469eb4 47 /*コントローラ系*/
THtakahiro702286 0:8d012d469eb4 48 Controller pad;
THtakahiro702286 0:8d012d469eb4 49 float stickRad;
THtakahiro702286 0:8d012d469eb4 50 float stickNorm;
THtakahiro702286 0:8d012d469eb4 51 float X;
THtakahiro702286 0:8d012d469eb4 52 float Y;
THtakahiro702286 0:8d012d469eb4 53 int b[11],b2[11],b3[11];
THtakahiro702286 0:8d012d469eb4 54 };
THtakahiro702286 0:8d012d469eb4 55 #endif