Octopus!!
Dependencies: 2017NHKpin_config FEP HMC6352 PID QEI R1307 ikarashiMDC omni_wheel
Fork of KANIv3 by
bot/bot.h@36:c1398ea8f604, 2017-10-09 (annotated)
- Committer:
- takeuchi
- Date:
- Mon Oct 09 09:22:44 2017 +0900
- Revision:
- 36:c1398ea8f604
- Parent:
- 32:b619c7787dc3
- Child:
- 41:ae6f844facb1
add rolling motion
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" |
uchitake |
1:845af5425eec | 9 | #include "pin_config.h" |
uchitake |
1:845af5425eec | 10 | #include "controller.h" |
uchitake |
1:845af5425eec | 11 | #include "PID_controller.h" |
uchitake |
9:39be1525dfe0 | 12 | #include "slider.h" |
uchitake |
9:39be1525dfe0 | 13 | #include "wheel_unit.h" |
uchitake |
1:845af5425eec | 14 | |
takeuchi |
36:c1398ea8f604 | 15 | const int ROLL = 0; |
uchitake |
9:39be1525dfe0 | 16 | const int SWORD = 1; |
UCHITAKE |
15:9aa11febe517 | 17 | const int DESTROY = 2; |
uchitake |
28:676330f1d186 | 18 | const float ADJUST_DEGREE = 5.0; |
uchitake |
1:845af5425eec | 19 | /** |
uchitake |
1:845af5425eec | 20 | * @brief ロボットのクラス |
uchitake |
1:845af5425eec | 21 | */ |
takeuchi |
32:b619c7787dc3 | 22 | class Bot |
uchitake |
1:845af5425eec | 23 | { |
uchitake |
1:845af5425eec | 24 | public : |
uchitake |
1:845af5425eec | 25 | /** |
uchitake |
1:845af5425eec | 26 | * @brief コンストラクタ |
uchitake |
1:845af5425eec | 27 | */ |
uchitake |
1:845af5425eec | 28 | Bot(); |
uchitake |
1:845af5425eec | 29 | |
uchitake |
1:845af5425eec | 30 | /** |
uchitake |
1:845af5425eec | 31 | * @brief センサなどの値を更新 |
uchitake |
1:845af5425eec | 32 | */ |
uchitake |
1:845af5425eec | 33 | void confirmAll(); |
uchitake |
1:845af5425eec | 34 | |
uchitake |
1:845af5425eec | 35 | /** |
uchitake |
1:845af5425eec | 36 | * @brief 足回りの制御 |
uchitake |
1:845af5425eec | 37 | */ |
uchitake |
1:845af5425eec | 38 | void controllDrive(); |
uchitake |
3:369d9ee17e84 | 39 | void controllDrive2(); |
uchitake |
17:79fa65706f92 | 40 | void controllDrive3(); |
uchitake |
1:845af5425eec | 41 | |
uchitake |
1:845af5425eec | 42 | /** |
uchitake |
1:845af5425eec | 43 | * @brief 機構部の制御 |
uchitake |
1:845af5425eec | 44 | */ |
uchitake |
1:845af5425eec | 45 | void controllMech(); |
uchitake |
3:369d9ee17e84 | 46 | |
uchitake |
18:78df87e20590 | 47 | /** |
uchitake |
18:78df87e20590 | 48 | * センサのキャリブレーション |
uchitake |
18:78df87e20590 | 49 | */ |
uchitake |
1:845af5425eec | 50 | void calibrate(); |
uchitake |
1:845af5425eec | 51 | |
uchitake |
1:845af5425eec | 52 | private : |
uchitake |
1:845af5425eec | 53 | Controller pad; |
uchitake |
9:39be1525dfe0 | 54 | Serial RS485; |
uchitake |
9:39be1525dfe0 | 55 | DigitalOut RS485Controller; |
uchitake |
9:39be1525dfe0 | 56 | DigitalOut powerSwitch; |
uchitake |
9:39be1525dfe0 | 57 | WheelUnit quadOmni; |
uchitake |
9:39be1525dfe0 | 58 | Slider slider; |
uchitake |
9:39be1525dfe0 | 59 | ikarashiMDC armMotor[3]; |
takeuchi |
32:b619c7787dc3 | 60 | PIDC plane; |
takeuchi |
32:b619c7787dc3 | 61 | PIDC axis; |
uchitake |
6:fe9767a50891 | 62 | bool receiveSuccessed; |
uchitake |
28:676330f1d186 | 63 | float frontDegree; |
uchitake |
14:1fadf7d2f583 | 64 | DigitalOut led[3]; |
uchitake |
5:16ea97725085 | 65 | Serial debugSerial; |
uchitake |
19:34da005ea4ea | 66 | Timer t; |
uchitake |
1:845af5425eec | 67 | }; |
uchitake |
1:845af5425eec | 68 | |
uchitake |
1:845af5425eec | 69 | #endif//BOT_H |