ジャパンオープン用のメインプログラム
Dependencies: mbed AQM1602 HMC6352 PID
setting/def.h@27:825c6835e3db, 2016-03-21 (annotated)
- Committer:
- lilac0112_1
- Date:
- Mon Mar 21 17:05:08 2016 +0000
- Revision:
- 27:825c6835e3db
- Parent:
- 26:6ca88eeaa2b4
- Child:
- 28:f246a5fbf6a5
somehow
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lilac0112_1 | 0:ea35c18c85fc | 1 | #ifndef _DEF_H_ |
lilac0112_1 | 0:ea35c18c85fc | 2 | #define _DEF_H_ |
lilac0112_1 | 0:ea35c18c85fc | 3 | |
lilac0112_1 | 11:3efae754e6ef | 4 | //red or green |
lilac0112_1 | 26:6ca88eeaa2b4 | 5 | #define RED_CAT |
lilac0112_1 | 26:6ca88eeaa2b4 | 6 | //#define GREEN_CAT |
lilac0112_1 | 11:3efae754e6ef | 7 | |
lilac0112_1 | 0:ea35c18c85fc | 8 | //BT(BlueTooth) |
lilac0112_1 | 0:ea35c18c85fc | 9 | #define DATA_NUM 8+2//2byte→KEYCODE(拝啓)とCHECKCODE(敬具) 8byte→やりとりするデータ |
lilac0112_1 | 0:ea35c18c85fc | 10 | #define TX_KEYCODE 0xAA//あちらのKEYCODE |
lilac0112_1 | 0:ea35c18c85fc | 11 | #define RX_KEYCODE 0xAA//こちらのKEYCODE |
lilac0112_1 | 0:ea35c18c85fc | 12 | #define KEY 0//KEYCODEは配列の最初 |
lilac0112_1 | 0:ea35c18c85fc | 13 | #define CHECK DATA_NUM-1//CHECKCODEは配列の最後 |
lilac0112_1 | 0:ea35c18c85fc | 14 | |
lilac0112_1 | 0:ea35c18c85fc | 15 | |
lilac0112_1 | 0:ea35c18c85fc | 16 | //Switch 入力値 |
lilac0112_1 | 0:ea35c18c85fc | 17 | #define NONE 0 |
lilac0112_1 | 0:ea35c18c85fc | 18 | #define UP 1 |
lilac0112_1 | 0:ea35c18c85fc | 19 | #define DOWN 2 |
lilac0112_1 | 0:ea35c18c85fc | 20 | #define RIGHT 3 |
lilac0112_1 | 0:ea35c18c85fc | 21 | #define LEFT 4 |
lilac0112_1 | 0:ea35c18c85fc | 22 | |
lilac0112_1 | 0:ea35c18c85fc | 23 | //Lcd 設定値 |
lilac0112_1 | 7:efe90188a49d | 24 | #define LCD_COLUMN_NUM 0x11 |
lilac0112_1 | 3:c49ea7ad8e91 | 25 | #define BUFSIZE 7 |
lilac0112_1 | 10:6df631c39f9b | 26 | #define STATE_NUM_X 0x08 |
lilac0112_1 | 0:ea35c18c85fc | 27 | #define STATE_NUM_Y 0x10 |
lilac0112_1 | 3:c49ea7ad8e91 | 28 | |
lilac0112_1 | 4:52da8da146d4 | 29 | #define JUMP_TAG_MAX 0xFFFF |
lilac0112_1 | 4:52da8da146d4 | 30 | //tag |
lilac0112_1 | 8:25c8c75d182a | 31 | #define ZERO_FUNCTION 0 |
lilac0112_1 | 8:25c8c75d182a | 32 | #define START 1 |
lilac0112_1 | 8:25c8c75d182a | 33 | #define GET_IR 2 |
lilac0112_1 | 10:6df631c39f9b | 34 | #define GET_SNS0 3 |
lilac0112_1 | 8:25c8c75d182a | 35 | #define GET_PID_VALUE 4 |
lilac0112_1 | 8:25c8c75d182a | 36 | #define CALIBRATION_ENTER 5 |
lilac0112_1 | 8:25c8c75d182a | 37 | #define CALIBRATION_EXIT 6 |
lilac0112_1 | 8:25c8c75d182a | 38 | #define FRONT_RESET 7 |
lilac0112_1 | 8:25c8c75d182a | 39 | #define SET_POWER1 8 |
lilac0112_1 | 8:25c8c75d182a | 40 | #define SET_POWER2 9 |
lilac0112_1 | 8:25c8c75d182a | 41 | #define SOFT_RESET 10 |
lilac0112_1 | 8:25c8c75d182a | 42 | #define SET_STRATEGY1 11 |
lilac0112_1 | 8:25c8c75d182a | 43 | #define SET_STRATEGY2 12 |
lilac0112_1 | 8:25c8c75d182a | 44 | #define SET_STRATEGY3 13 |
lilac0112_1 | 8:25c8c75d182a | 45 | #define SET_STRATEGY4 14 |
lilac0112_1 | 8:25c8c75d182a | 46 | #define START2 15 |
lilac0112_1 | 8:25c8c75d182a | 47 | |
lilac0112_1 | 8:25c8c75d182a | 48 | #define SET_POWER_DOWN 16 |
lilac0112_1 | 8:25c8c75d182a | 49 | #define SET_POWER_UP 17 |
lilac0112_1 | 8:25c8c75d182a | 50 | #define SET_STRATEGY_DOWN 18 |
lilac0112_1 | 8:25c8c75d182a | 51 | #define SET_STRATEGY_UP 19 |
lilac0112_1 | 4:52da8da146d4 | 52 | |
lilac0112_1 | 9:c966191926c5 | 53 | #define DRIVE_KICKER 20 |
lilac0112_1 | 10:6df631c39f9b | 54 | #define DRIVE_DRIBBLER_AND_KICKER 21 |
lilac0112_1 | 10:6df631c39f9b | 55 | |
lilac0112_1 | 10:6df631c39f9b | 56 | #define CALIBRATION_TURN 22 |
lilac0112_1 | 10:6df631c39f9b | 57 | #define RW_PID 23 |
lilac0112_1 | 10:6df631c39f9b | 58 | |
lilac0112_1 | 10:6df631c39f9b | 59 | #define TURN_AND_START 24 |
lilac0112_1 | 11:3efae754e6ef | 60 | #define CALIBRATION_ENTER_OR_EXIT 25 |
lilac0112_1 | 9:c966191926c5 | 61 | |
lilac0112_1 | 3:c49ea7ad8e91 | 62 | typedef struct {//for command |
lilac0112_1 | 3:c49ea7ad8e91 | 63 | char LcdStr[STATE_NUM_X][BUFSIZE]; |
lilac0112_1 | 3:c49ea7ad8e91 | 64 | uint8_t str_num; |
lilac0112_1 | 3:c49ea7ad8e91 | 65 | uint8_t (*CommandFunction)(uint8_t x); |
lilac0112_1 | 4:52da8da146d4 | 66 | uint16_t tag_num; |
lilac0112_1 | 3:c49ea7ad8e91 | 67 | } CommandItem; |
lilac0112_1 | 3:c49ea7ad8e91 | 68 | |
lilac0112_1 | 7:efe90188a49d | 69 | |
lilac0112_1 | 7:efe90188a49d | 70 | //tag |
lilac0112_1 | 7:efe90188a49d | 71 | #define MODE_ATTACK0 0 |
lilac0112_1 | 7:efe90188a49d | 72 | #define MODE_ATTACK1 1 |
lilac0112_1 | 7:efe90188a49d | 73 | #define MODE_ATTACK2 2 |
lilac0112_1 | 7:efe90188a49d | 74 | #define MODE_ATTACK3 3 |
lilac0112_1 | 7:efe90188a49d | 75 | #define MODE_ATTACK4 4 |
lilac0112_1 | 7:efe90188a49d | 76 | #define MODE_ATTACK5 5 |
lilac0112_1 | 7:efe90188a49d | 77 | |
lilac0112_1 | 7:efe90188a49d | 78 | #define MODE_DEBUG0 6 |
lilac0112_1 | 7:efe90188a49d | 79 | #define MODE_DEBUG1 7 |
lilac0112_1 | 7:efe90188a49d | 80 | #define MODE_DEBUG2 8 |
lilac0112_1 | 7:efe90188a49d | 81 | #define MODE_DEBUG3 9 |
lilac0112_1 | 7:efe90188a49d | 82 | #define MODE_DEBUG4 10 |
lilac0112_1 | 7:efe90188a49d | 83 | #define MODE_DEBUG5 11 |
lilac0112_1 | 7:efe90188a49d | 84 | |
lilac0112_1 | 7:efe90188a49d | 85 | typedef struct {//for active |
lilac0112_1 | 7:efe90188a49d | 86 | char LcdStr[LCD_COLUMN_NUM]; |
lilac0112_1 | 7:efe90188a49d | 87 | void (*ActiveFunction)(void); |
lilac0112_1 | 7:efe90188a49d | 88 | uint16_t tag_num; |
lilac0112_1 | 7:efe90188a49d | 89 | } ActiveItem; |
lilac0112_1 | 7:efe90188a49d | 90 | |
lilac0112_1 | 0:ea35c18c85fc | 91 | //繰り返し割り込み |
lilac0112_1 | 0:ea35c18c85fc | 92 | #define DUTY_NUM 1 |
lilac0112_1 | 0:ea35c18c85fc | 93 | |
lilac0112_1 | 0:ea35c18c85fc | 94 | #define DUTY_SW 0 |
lilac0112_1 | 0:ea35c18c85fc | 95 | #define DUTY_GYRO 1 |
lilac0112_1 | 0:ea35c18c85fc | 96 | #define DUTY_PING 2 |
lilac0112_1 | 0:ea35c18c85fc | 97 | #define DUTY_COLOR 3 |
lilac0112_1 | 0:ea35c18c85fc | 98 | #define DUTY_MOUSE 4 |
lilac0112_1 | 0:ea35c18c85fc | 99 | |
lilac0112_1 | 0:ea35c18c85fc | 100 | /*PID処理*/ |
lilac0112_1 | 0:ea35c18c85fc | 101 | #define RATE 0.052//52 |
lilac0112_1 | 9:c966191926c5 | 102 | #define PID_BIAS 0.0//1.0 |
lilac0112_1 | 0:ea35c18c85fc | 103 | #define REFERENCE 180.0 |
lilac0112_1 | 0:ea35c18c85fc | 104 | #define MINIMUM 0.0 |
lilac0112_1 | 0:ea35c18c85fc | 105 | #define MAXIMUM 359.9 |
lilac0112_1 | 0:ea35c18c85fc | 106 | #define P_GAIN 1.3//1.25//0.8 //0.78 |
lilac0112_1 | 0:ea35c18c85fc | 107 | #define I_GAIN 0.0 //0.0 |
lilac0112_1 | 0:ea35c18c85fc | 108 | #define D_GAIN 0.01//0.01 //0.009 |
lilac0112_1 | 0:ea35c18c85fc | 109 | #define OUT_LIMIT 30.0 |
lilac0112_1 | 0:ea35c18c85fc | 110 | #define MAX_POW 100 |
lilac0112_1 | 0:ea35c18c85fc | 111 | #define MIN_POW -100 |
lilac0112_1 | 0:ea35c18c85fc | 112 | #define PID_CYCLE 0.05 //s |
lilac0112_1 | 0:ea35c18c85fc | 113 | |
lilac0112_1 | 10:6df631c39f9b | 114 | #define PID_OUT_MIN 5 |
lilac0112_1 | 10:6df631c39f9b | 115 | |
lilac0112_1 | 10:6df631c39f9b | 116 | //hmc |
lilac0112_1 | 10:6df631c39f9b | 117 | #define HMC_RUN 1 |
lilac0112_1 | 10:6df631c39f9b | 118 | #define HMC_RST 0 |
lilac0112_1 | 10:6df631c39f9b | 119 | |
lilac0112_1 | 0:ea35c18c85fc | 120 | //ir |
lilac0112_1 | 5:5ff3a7d5d8c2 | 121 | //ir_pow_old |
lilac0112_1 | 0:ea35c18c85fc | 122 | #define IR_X 0 |
lilac0112_1 | 0:ea35c18c85fc | 123 | #define IR_Y 1 |
lilac0112_1 | 5:5ff3a7d5d8c2 | 124 | //ir_pow |
lilac0112_1 | 5:5ff3a7d5d8c2 | 125 | #define IR_X_DIR 0 |
lilac0112_1 | 5:5ff3a7d5d8c2 | 126 | #define IR_Y_DIR 1 |
lilac0112_1 | 5:5ff3a7d5d8c2 | 127 | #define IR_X_TURN 2 |
lilac0112_1 | 5:5ff3a7d5d8c2 | 128 | #define IR_Y_TURN 3 |
lilac0112_1 | 5:5ff3a7d5d8c2 | 129 | |
lilac0112_1 | 0:ea35c18c85fc | 130 | #define IR_SHORT 0 |
lilac0112_1 | 0:ea35c18c85fc | 131 | #define IR_LONG 1 |
lilac0112_1 | 0:ea35c18c85fc | 132 | |
lilac0112_1 | 0:ea35c18c85fc | 133 | #define X_AXIS 0 |
lilac0112_1 | 0:ea35c18c85fc | 134 | #define Y_AXIS 1 |
lilac0112_1 | 0:ea35c18c85fc | 135 | |
lilac0112_1 | 1:3e013ae7900d | 136 | |
lilac0112_1 | 1:3e013ae7900d | 137 | #define DIS_0 0x0//low_value |
lilac0112_1 | 1:3e013ae7900d | 138 | #define DIS_1 0x1 |
lilac0112_1 | 1:3e013ae7900d | 139 | #define DIS_2 0x2 |
lilac0112_1 | 1:3e013ae7900d | 140 | #define DIS_3 0x3 |
lilac0112_1 | 1:3e013ae7900d | 141 | #define DIS_4 0x4 |
lilac0112_1 | 1:3e013ae7900d | 142 | #define DIS_5 0x5 |
lilac0112_1 | 1:3e013ae7900d | 143 | #define DIS_6 0x6 |
lilac0112_1 | 1:3e013ae7900d | 144 | #define DIS_7 0x7//high_value |
lilac0112_1 | 1:3e013ae7900d | 145 | |
lilac0112_1 | 0:ea35c18c85fc | 146 | //ping |
lilac0112_1 | 10:6df631c39f9b | 147 | #define L_PING 1 |
lilac0112_1 | 10:6df631c39f9b | 148 | #define R_PING 0 |
lilac0112_1 | 0:ea35c18c85fc | 149 | #define F_PING 2 |
lilac0112_1 | 0:ea35c18c85fc | 150 | #define B_PING 3 |
lilac0112_1 | 0:ea35c18c85fc | 151 | |
lilac0112_1 | 11:3efae754e6ef | 152 | #define X_PING 0 |
lilac0112_1 | 11:3efae754e6ef | 153 | #define Y_PING 1 |
lilac0112_1 | 11:3efae754e6ef | 154 | |
lilac0112_1 | 0:ea35c18c85fc | 155 | //0,1...main |
lilac0112_1 | 0:ea35c18c85fc | 156 | //2,3...debug board |
lilac0112_1 | 0:ea35c18c85fc | 157 | |
lilac0112_1 | 0:ea35c18c85fc | 158 | //line |
lilac0112_1 | 16:4fadb7a87497 | 159 | #define LINE_EMPTY 0xFF |
lilac0112_1 | 16:4fadb7a87497 | 160 | |
lilac0112_1 | 0:ea35c18c85fc | 161 | #define A_SPOT 0 |
lilac0112_1 | 0:ea35c18c85fc | 162 | #define B_SPOT 1 |
lilac0112_1 | 0:ea35c18c85fc | 163 | #define C_SPOT 2 |
lilac0112_1 | 0:ea35c18c85fc | 164 | #define AB_SPOT 3 |
lilac0112_1 | 0:ea35c18c85fc | 165 | |
lilac0112_1 | 0:ea35c18c85fc | 166 | #define LINE_RF 5 |
lilac0112_1 | 27:825c6835e3db | 167 | #define LINE_DELAY_1 1.0 |
lilac0112_1 | 27:825c6835e3db | 168 | #define LINE_DELAY_2 0.5 |
lilac0112_1 | 27:825c6835e3db | 169 | #define LINE_DELAY_3 0.25 |
lilac0112_1 | 0:ea35c18c85fc | 170 | |
lilac0112_1 | 12:bee8f883c33a | 171 | #define L_LINE 1 |
lilac0112_1 | 12:bee8f883c33a | 172 | #define R_LINE 0 |
lilac0112_1 | 12:bee8f883c33a | 173 | #define F_LINE 2 |
lilac0112_1 | 12:bee8f883c33a | 174 | #define B_LINE 3 |
lilac0112_1 | 12:bee8f883c33a | 175 | |
lilac0112_1 | 18:3a42a931c95a | 176 | #define X_LINE 0 |
lilac0112_1 | 18:3a42a931c95a | 177 | #define Y_LINE 1 |
lilac0112_1 | 12:bee8f883c33a | 178 | |
lilac0112_1 | 12:bee8f883c33a | 179 | #define LINE_INSIDE 0 |
lilac0112_1 | 12:bee8f883c33a | 180 | #define LINE_OUTSIDE 1 |
lilac0112_1 | 12:bee8f883c33a | 181 | |
lilac0112_1 | 26:6ca88eeaa2b4 | 182 | //hard error |
lilac0112_1 | 26:6ca88eeaa2b4 | 183 | |
lilac0112_1 | 11:3efae754e6ef | 184 | #ifdef RED_CAT |
lilac0112_1 | 11:3efae754e6ef | 185 | #define LINE_FIX 0x0 |
lilac0112_1 | 11:3efae754e6ef | 186 | #define LINE_FREE 0x7 |
lilac0112_1 | 26:6ca88eeaa2b4 | 187 | |
lilac0112_1 | 26:6ca88eeaa2b4 | 188 | //右後左ド |
lilac0112_1 | 26:6ca88eeaa2b4 | 189 | #define MD_1CH (1) |
lilac0112_1 | 26:6ca88eeaa2b4 | 190 | #define MD_2CH (1) |
lilac0112_1 | 26:6ca88eeaa2b4 | 191 | #define MD_3CH (1) |
lilac0112_1 | 26:6ca88eeaa2b4 | 192 | #define MD_4CH (-1) |
lilac0112_1 | 11:3efae754e6ef | 193 | #endif /*RED_CAT*/ |
lilac0112_1 | 11:3efae754e6ef | 194 | |
lilac0112_1 | 11:3efae754e6ef | 195 | #ifdef GREEN_CAT |
lilac0112_1 | 11:3efae754e6ef | 196 | #define LINE_FIX 0x7 |
lilac0112_1 | 11:3efae754e6ef | 197 | #define LINE_FREE 0x0 |
lilac0112_1 | 26:6ca88eeaa2b4 | 198 | |
lilac0112_1 | 26:6ca88eeaa2b4 | 199 | //右後左ド |
lilac0112_1 | 26:6ca88eeaa2b4 | 200 | #define MD_1CH (1) |
lilac0112_1 | 26:6ca88eeaa2b4 | 201 | #define MD_2CH (1) |
lilac0112_1 | 26:6ca88eeaa2b4 | 202 | #define MD_3CH (-1) |
lilac0112_1 | 26:6ca88eeaa2b4 | 203 | #define MD_4CH (-1) |
lilac0112_1 | 11:3efae754e6ef | 204 | #endif /*GREEN_CAT*/ |
lilac0112_1 | 11:3efae754e6ef | 205 | |
lilac0112_1 | 11:3efae754e6ef | 206 | |
lilac0112_1 | 0:ea35c18c85fc | 207 | //思考パターン |
lilac0112_1 | 0:ea35c18c85fc | 208 | #define STRATEGY_NUM 12 |
lilac0112_1 | 0:ea35c18c85fc | 209 | |
lilac0112_1 | 0:ea35c18c85fc | 210 | //計算 |
lilac0112_1 | 0:ea35c18c85fc | 211 | #define ROUND(x) ((x > 0) ? (x + 0.5) : (x - 0.5))//x...整数 |
lilac0112_1 | 0:ea35c18c85fc | 212 | #define PI 3.14159265358979323846 |
lilac0112_1 | 0:ea35c18c85fc | 213 | #define DEG2RAD(deg) (PI*(deg)/180.0) |
lilac0112_1 | 0:ea35c18c85fc | 214 | #define RAD2DEG(rad) (180.0(rad)/PI) |
lilac0112_1 | 0:ea35c18c85fc | 215 | |
lilac0112_1 | 0:ea35c18c85fc | 216 | //データ |
lilac0112_1 | 0:ea35c18c85fc | 217 | typedef struct { |
lilac0112_1 | 0:ea35c18c85fc | 218 | //cmps&pid |
lilac0112_1 | 19:967207de919d | 219 | double cmps, CmpsInitialValue, CmpsDiff;//0<x<360 |
lilac0112_1 | 25:a7460e23e02e | 220 | int16_t FrontDeg, AtkDeg, HoldDeg; |
lilac0112_1 | 25:a7460e23e02e | 221 | //正...右回転 |
lilac0112_1 | 25:a7460e23e02e | 222 | //負...左回転 |
lilac0112_1 | 0:ea35c18c85fc | 223 | double InputPID;//<<gyrosensor |
lilac0112_1 | 0:ea35c18c85fc | 224 | int16_t OutputPID;//>>motor |
lilac0112_1 | 0:ea35c18c85fc | 225 | } CompassVal; |
lilac0112_1 | 0:ea35c18c85fc | 226 | typedef struct { |
lilac0112_1 | 0:ea35c18c85fc | 227 | //ping |
lilac0112_1 | 0:ea35c18c85fc | 228 | uint8_t ping[4]; |
lilac0112_1 | 0:ea35c18c85fc | 229 | //line |
lilac0112_1 | 0:ea35c18c85fc | 230 | uint8_t lineSpot[3]; |
lilac0112_1 | 2:635947de1583 | 231 | uint8_t lnFlag[3]; |
lilac0112_1 | 16:4fadb7a87497 | 232 | uint8_t NonWall[4]; |
lilac0112_1 | 18:3a42a931c95a | 233 | uint8_t NearWall[2]; |
lilac0112_1 | 16:4fadb7a87497 | 234 | uint8_t ReturnDir[2]; |
lilac0112_1 | 14:b510adcb6065 | 235 | |
lilac0112_1 | 11:3efae754e6ef | 236 | uint8_t lnHold; |
lilac0112_1 | 11:3efae754e6ef | 237 | uint8_t lnRaw; |
lilac0112_1 | 27:825c6835e3db | 238 | uint8_t lnRawMemory[3]; |
lilac0112_1 | 27:825c6835e3db | 239 | uint8_t lnRawOrder[3];//first_second_third |
lilac0112_1 | 27:825c6835e3db | 240 | uint8_t lnRawOrderLog1[3];//first_second_third |
lilac0112_1 | 27:825c6835e3db | 241 | uint8_t lnRawOrderLog2[3];//first_second_third |
lilac0112_1 | 27:825c6835e3db | 242 | uint8_t lnRawRise[3]; |
lilac0112_1 | 27:825c6835e3db | 243 | uint8_t lnRawReturn; |
lilac0112_1 | 27:825c6835e3db | 244 | uint8_t lnRawLastRise; |
lilac0112_1 | 14:b510adcb6065 | 245 | uint8_t lnStop[2]; |
lilac0112_1 | 18:3a42a931c95a | 246 | //uint8_t lnStay[2]; |
lilac0112_1 | 24:34ef6379b0df | 247 | uint8_t lnStay[2]; |
lilac0112_1 | 14:b510adcb6065 | 248 | uint8_t lnCorner[4]; |
lilac0112_1 | 18:3a42a931c95a | 249 | uint8_t lnRepeat; |
lilac0112_1 | 15:17502a27a60b | 250 | uint8_t FieldSpot;//0...inside,1...outside |
lilac0112_1 | 16:4fadb7a87497 | 251 | uint8_t lnOrder[3];//first_second_third |
lilac0112_1 | 15:17502a27a60b | 252 | |
lilac0112_1 | 15:17502a27a60b | 253 | uint8_t lnState; |
lilac0112_1 | 2:635947de1583 | 254 | /*uint8_t LineFlag[3]; |
lilac0112_1 | 2:635947de1583 | 255 | uint8_t LinePriority[3]; |
lilac0112_1 | 2:635947de1583 | 256 | uint8_t LineBind[3];*/ |
lilac0112_1 | 0:ea35c18c85fc | 257 | //ir(spi) |
lilac0112_1 | 0:ea35c18c85fc | 258 | uint8_t irKey;//2bit |
lilac0112_1 | 1:3e013ae7900d | 259 | uint8_t irValPhase[2];//3*2bit |
lilac0112_1 | 2:635947de1583 | 260 | uint8_t irDif[2];//3bit |
lilac0112_1 | 2:635947de1583 | 261 | uint8_t irPosition;//5bit |
lilac0112_1 | 2:635947de1583 | 262 | |
lilac0112_1 | 2:635947de1583 | 263 | uint8_t irSpot[2];//4*2bit//old |
lilac0112_1 | 0:ea35c18c85fc | 264 | //ir(playing) |
lilac0112_1 | 0:ea35c18c85fc | 265 | uint8_t irNotice; |
lilac0112_1 | 0:ea35c18c85fc | 266 | //ball |
lilac0112_1 | 0:ea35c18c85fc | 267 | uint8_t ball; |
lilac0112_1 | 0:ea35c18c85fc | 268 | } SensorVal; |
lilac0112_1 | 0:ea35c18c85fc | 269 | typedef struct { |
lilac0112_1 | 0:ea35c18c85fc | 270 | //system,flag |
lilac0112_1 | 0:ea35c18c85fc | 271 | uint8_t strategy; |
lilac0112_1 | 4:52da8da146d4 | 272 | uint16_t jump_flag;//0<=x<=JUMP_TAG_NUM |
lilac0112_1 | 0:ea35c18c85fc | 273 | uint8_t stopflag; |
lilac0112_1 | 0:ea35c18c85fc | 274 | uint8_t KickOffFlag; |
lilac0112_1 | 0:ea35c18c85fc | 275 | uint8_t DribbleFlag; |
lilac0112_1 | 24:34ef6379b0df | 276 | uint8_t KickStopFlag; |
lilac0112_1 | 24:34ef6379b0df | 277 | uint8_t TurnStopFlag; |
lilac0112_1 | 25:a7460e23e02e | 278 | |
lilac0112_1 | 25:a7460e23e02e | 279 | uint8_t BallHoldJudgeFlag; |
lilac0112_1 | 25:a7460e23e02e | 280 | uint8_t BallHoldFlag; |
lilac0112_1 | 25:a7460e23e02e | 281 | |
lilac0112_1 | 8:25c8c75d182a | 282 | uint8_t BackHomeFlag; |
lilac0112_1 | 25:a7460e23e02e | 283 | uint8_t HomeStayFlag[2]; |
lilac0112_1 | 10:6df631c39f9b | 284 | uint8_t TurnStartFlag; |
lilac0112_1 | 0:ea35c18c85fc | 285 | uint8_t MotorFlag; |
lilac0112_1 | 19:967207de919d | 286 | uint8_t InfoFlag; |
lilac0112_1 | 21:378470320524 | 287 | //uint8_t PidFlag; |
lilac0112_1 | 18:3a42a931c95a | 288 | uint8_t DefenceFlag; |
lilac0112_1 | 8:25c8c75d182a | 289 | //blind//on...1/off...0 |
lilac0112_1 | 8:25c8c75d182a | 290 | uint8_t IrBlind; |
lilac0112_1 | 8:25c8c75d182a | 291 | uint8_t LineBlind; |
lilac0112_1 | 8:25c8c75d182a | 292 | uint8_t PingBlind; |
lilac0112_1 | 19:967207de919d | 293 | |
lilac0112_1 | 19:967207de919d | 294 | uint8_t DriBlind; |
lilac0112_1 | 19:967207de919d | 295 | uint8_t HomeBlind; |
lilac0112_1 | 0:ea35c18c85fc | 296 | //motor |
lilac0112_1 | 7:efe90188a49d | 297 | uint8_t pow_num; |
lilac0112_1 | 6:f9167470d819 | 298 | uint8_t s_pow; |
lilac0112_1 | 6:f9167470d819 | 299 | uint8_t m_pow; |
lilac0112_1 | 6:f9167470d819 | 300 | uint8_t l_pow; |
lilac0112_1 | 6:f9167470d819 | 301 | uint8_t dri_pow; |
lilac0112_1 | 2:635947de1583 | 302 | uint8_t ir_pow_table; |
lilac0112_1 | 0:ea35c18c85fc | 303 | } SystemVal; |
lilac0112_1 | 2:635947de1583 | 304 | |
lilac0112_1 | 0:ea35c18c85fc | 305 | #endif |