Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DriveConroller IMU MDD Mycan Odometer PID RotaryEncoder UART USS mbed
Fork of AR_MastarNode by
Diff: stateLib.h
- Revision:
- 17:1409cdfb6043
- Parent:
- 16:621f04b15f86
--- a/stateLib.h Mon Sep 24 08:03:55 2018 +0000 +++ b/stateLib.h Tue Sep 25 08:53:56 2018 +0000 @@ -1,6 +1,16 @@ -#define LIBNUM 43 +#define LIBNUM 44 //(X, Y, θ, speed, angle) -float state_lib[LIBNUM][10] ={{0.0, 0.0, 0, 0, 0},//スタートゾーン +#define NEUTRAL 0 +#define A1 1 +#define A2 2 +#define A3 3 +#define B1 4 +#define B2 5 +#define C1 6 +#define C2 7 +#define C3 8 + +float state_lib[LIBNUM][10] ={{0.0, 0.0, 0, NEUTRAL, 0},//スタートゾーン /* //2段テーブル1周 {-1.740, 1.5, 0, 0, 90, 0},// @@ -26,45 +36,45 @@ */ //2段テーブル下段のみ - {-1.740, 1.5, 0, 4, 0},// x移動, 角度変化 - {-1.740, 20.0, 0, 4, 0},// y移動 - {-1.740, 20.0, 0, 4, 1},// 下段に発射 - {-1.740, 1.5, 0, 4, 0},// 4 + {-1.740, 1.5, 0, B1, 0},// x移動, 角度変化 + {-1.740, 20.0, 0, B1, 0},// y移動 + {-1.740, 20.0, 0, B1, 1},// 下段に発射 + {-1.740, 1.5, 0, B1, 0},// 4 //2段テーブル上段のみ - {-1.740, 1.5, 0, 5, 0},// x移動, 角度変化 - {-1.740, 13.0, 0, 5, 0},// USS - {-1.740, 13.0, 0, 5, 1},// 上段に発射 - {-1.740, 1.5, 0, 5, 0},// 8 + {-1.740, 1.5, 0, B2, 0},// x移動, 角度変化 + {-1.740, 13.0, 0, B2, 0},// USS + {-1.740, 13.0, 0, B2, 1},// 上段に発射 + {-1.740, 1.5, 0, B2, 0},// 8 //2段テーブル上・下 - {-1.740, 1.5, 0, 4, 0},// x移動, 角度変化 - {-1.740, 25.0, 0, 4, 0},// y移動 - {-1.740, 20.0, 0, 4, 1},// 下段に発射 - {-1.740, 20.0, 0, 4, 0},// 12 角度戻る + {-1.740, 1.5, 0, B1, 0},// x移動, 角度変化 + {-1.740, 25.0, 0, B1, 0},// y移動 + {-1.740, 20.0, 0, B1, 1},// 下段に発射 + {-1.740, 20.0, 0, B1, 0},// 12 角度戻る - {-1.740, 20.0, 0, 5, 0},// 補給 - {-1.740, 13.0, 0, 5, 0},// 角度変化 - {-1.740, 13.0, 0, 5, 1},// 上段に発射 - {-1.740, 1.5, 0, 5, 0},// 16 角度変化 + {-1.740, 20.0, 0, B2, 0},// 補給 + {-1.740, 13.0, 0, B2, 0},// 角度変化 + {-1.740, 13.0, 0, B2, 1},// 上段に発射 + {-1.740, 1.5, 0, B2, 0},// 16 角度変化 - {-2.740, 0.0, 0, 0, 0},// 17 + {-2.740, 0.0, 0, NEUTRAL, 0},// 17 //移動テーブル ノーマル - {-3.740, 0.0, 0, 6, 0},// x移動, 補給 - {-3.740, 20.0, 0, 6, 0},// y移動, 角度変化 - {-3.740, 20.0, 0, 6, 1},// 発射 - {-3.740, 0.0, 0, 6, 0},// 21 y戻る, 角度戻る + {-3.740, 0.0, 0, C1, 0},// x移動, 補給 + {-3.740, 20.0, 0, C1, 0},// y移動, 角度変化 + {-3.740, 20.0, 0, C1, 1},// 発射 + {-3.740, 0.0, 0, C1, 0},// 21 y戻る, 角度戻る - {-4.740, 0.0, 0, 7, 0},// x移動, 補給 - {-4.740, 20.0, 0, 7, 0},// y移動, 角度変化 - {-4.740, 20.0, 0, 7, 1},// 発射 - {-4.740, 0.0, 0, 7, 0},// 25 y戻る, 角度戻る + {-4.740, 0.0, 0, C2, 0},// x移動, 補給 + {-4.740, 20.0, 0, C2, 0},// y移動, 角度変化 + {-4.740, 20.0, 0, C2, 1},// 発射 + {-4.740, 0.0, 0, C2, 0},// 25 y戻る, 角度戻る - {-5.740, 0.0, 0, 8, 0},// x移動, 補給 - {-5.740, 20.0, 0, 8, 0},// y移動, 角度変化 - {-5.740, 20.0, 0, 8, 1},// 発射 - {-5.740, 0.0, 0, 8, 0},// 29 y戻る, 角度戻る + {-5.740, 0.0, 0, C3, 0},// x移動, 補給 + {-5.740, 20.0, 0, C3, 0},// y移動, 角度変化 + {-5.740, 20.0, 0, C3, 1},// 発射 + {-5.740, 0.0, 0, C3, 0},// 29 y戻る, 角度戻る /* //移動テーブル アクティブムーブ @@ -83,22 +93,22 @@ */ //固定テーブル - {-0.3, 1.5, -90, 1, 0}, - {25, 1.5, -90, 1, 0}, - {25, 1.5, -90, 1, 1},// 発射 - {-0.8, 1.5, -90, 1, 0},// 33 + {-0.3, 1.5, -90, A1, 0}, + {25, 1.5, -90, A1, 0}, + {25, 1.5, -90, A1, 1},// 発射 + {-0.8, 1.5, -90, A1, 0},// 33 - {-0.8, 2.5, -90, 2, 0}, - {25, 2.5, -90, 2, 0}, - {25, 2.5, -90, 2, 1},// 発射 - {-0.8, 2.5, -90, 2, 0},// 37 + {-0.8, 2.5, -90, A2, 0}, + {25, 2.5, -90, A2, 0}, + {25, 2.5, -90, A2, 1},// 発射 + {-0.8, 2.5, -90, A2, 0},// 37 - {-0.8, 3.5, -90, 3, 0}, - {25, 3.5, -90, 3, 0}, - {25, 3.5, -90, 3, 1},// 発射 - {-0.8, 3.5, -90, 3, 0},// 41 + {-0.8, 3.5, -90, A3, 0}, + {25, 3.5, -90, A3, 0}, + {25, 3.5, -90, A3, 1},// 発射 + {-0.8, 3.5, -90, A3, 0},// 41 - {-0.8, 1.5, 0, 0, 0},// 42 + {-0.8, 1.5, 0, NEUTRAL, 0},// 42 {0.0, 0.0, 0, 9, 0}// 補給, スタートゾーン戻る }; @@ -162,13 +172,4 @@ typedef struct elements { float x, y , theta; -}elements; - -void changeToBlueZone() -{ - for(int i = 0; i < LIBNUM; i++) - { - state_lib[i][0] *= -1; - state_lib[i][2] *= -1; - } -} \ No newline at end of file +}elements; \ No newline at end of file