タコ 駆動側
Dependencies: 2017NHKpin_config FEP R1307 PID ikarashiMDC omni_wheel
Fork of NHK2017_octopus2 by
bot/bot.h@54:7176e6a08600, 2017-11-23 (annotated)
- Committer:
- number_key
- Date:
- Thu Nov 23 14:59:02 2017 +0900
- Revision:
- 54:7176e6a08600
- Parent:
- 52:320f910ca6ca
- Child:
- 55:52b2cb45f21f
first success
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
uchitake |
1:845af5425eec | 1 | /** |
uchitake |
1:845af5425eec | 2 | * @file bot.h |
uchitake |
1:845af5425eec | 3 | * @brief ロボットのクラス |
uchitake |
1:845af5425eec | 4 | */ |
uchitake |
1:845af5425eec | 5 | #ifndef BOT_H |
uchitake |
1:845af5425eec | 6 | #define BOT_H |
uchitake |
1:845af5425eec | 7 | |
uchitake |
1:845af5425eec | 8 | #include "mbed.h" |
number_key |
50:3a7c858aa0f9 | 9 | #include "math.h" |
uchitake |
1:845af5425eec | 10 | #include "pin_config.h" |
uchitake |
1:845af5425eec | 11 | #include "controller.h" |
uchitake |
1:845af5425eec | 12 | #include "PID_controller.h" |
uchitake |
9:39be1525dfe0 | 13 | #include "wheel_unit.h" |
number_key |
49:69a7235d837a | 14 | #include "def.h" |
uchitake |
1:845af5425eec | 15 | |
uchitake |
28:676330f1d186 | 16 | const float ADJUST_DEGREE = 5.0; |
uchitake |
1:845af5425eec | 17 | /** |
uchitake |
1:845af5425eec | 18 | * @brief ロボットのクラス |
uchitake |
1:845af5425eec | 19 | */ |
takeuchi |
32:b619c7787dc3 | 20 | class Bot |
uchitake |
1:845af5425eec | 21 | { |
uchitake |
1:845af5425eec | 22 | public : |
uchitake |
1:845af5425eec | 23 | /** |
uchitake |
1:845af5425eec | 24 | * @brief コンストラクタ |
uchitake |
1:845af5425eec | 25 | */ |
uchitake |
1:845af5425eec | 26 | Bot(); |
uchitake |
1:845af5425eec | 27 | |
uchitake |
1:845af5425eec | 28 | /** |
uchitake |
1:845af5425eec | 29 | * @brief センサなどの値を更新 |
uchitake |
1:845af5425eec | 30 | */ |
number_key |
54:7176e6a08600 | 31 | void confirmPad(); |
uchitake |
1:845af5425eec | 32 | |
uchitake |
1:845af5425eec | 33 | /** |
uchitake |
1:845af5425eec | 34 | * @brief 足回りの制御 |
uchitake |
1:845af5425eec | 35 | */ |
uchitake |
1:845af5425eec | 36 | void controllDrive(); |
uchitake |
3:369d9ee17e84 | 37 | void controllDrive2(); |
uchitake |
17:79fa65706f92 | 38 | void controllDrive3(); |
takeuchi |
41:ae6f844facb1 | 39 | void controllDrive4(); |
uchitake |
1:845af5425eec | 40 | |
uchitake |
1:845af5425eec | 41 | /** |
uchitake |
1:845af5425eec | 42 | * @brief 機構部の制御 |
uchitake |
1:845af5425eec | 43 | */ |
uchitake |
1:845af5425eec | 44 | void controllMech(); |
uchitake |
3:369d9ee17e84 | 45 | |
uchitake |
18:78df87e20590 | 46 | /** |
uchitake |
18:78df87e20590 | 47 | * センサのキャリブレーション |
uchitake |
18:78df87e20590 | 48 | */ |
uchitake |
1:845af5425eec | 49 | void calibrate(); |
uchitake |
1:845af5425eec | 50 | |
number_key |
49:69a7235d837a | 51 | void checkConnection(); |
number_key |
49:69a7235d837a | 52 | |
number_key |
49:69a7235d837a | 53 | void checkDegree(); |
number_key |
49:69a7235d837a | 54 | |
number_key |
52:320f910ca6ca | 55 | void checkReceiveData(); |
number_key |
52:320f910ca6ca | 56 | |
uchitake |
1:845af5425eec | 57 | private : |
number_key |
54:7176e6a08600 | 58 | Controller pad; |
uchitake |
9:39be1525dfe0 | 59 | Serial RS485; |
uchitake |
9:39be1525dfe0 | 60 | DigitalOut RS485Controller; |
uchitake |
9:39be1525dfe0 | 61 | DigitalOut powerSwitch; |
uchitake |
9:39be1525dfe0 | 62 | WheelUnit quadOmni; |
takeuchi |
32:b619c7787dc3 | 63 | PIDC plane; |
takeuchi |
32:b619c7787dc3 | 64 | PIDC axis; |
number_key |
54:7176e6a08600 | 65 | int receiveSuccessed; |
uchitake |
28:676330f1d186 | 66 | float frontDegree; |
uchitake |
5:16ea97725085 | 67 | Serial debugSerial; |
uchitake |
19:34da005ea4ea | 68 | Timer t; |
uchitake |
1:845af5425eec | 69 | }; |
uchitake |
1:845af5425eec | 70 | |
uchitake |
1:845af5425eec | 71 | #endif//BOT_H |