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:
- 19:bdb503dd1e8c
- Parent:
- 18:268ab2ab0b2a
- Child:
- 20:1957c67ab740
--- a/stateLib.h Thu Sep 27 05:28:37 2018 +0000 +++ b/stateLib.h Wed Oct 03 08:10:17 2018 +0000 @@ -1,4 +1,4 @@ -#define LIBNUM 12 +#define LIBNUM 45 //(X, Y, θ, speed, angle) #define NEUTRAL 0 #define A1 1 @@ -10,17 +10,89 @@ #define C2 7 #define C3 8 -float state_lib[LIBNUM][10] ={{0.0, 0.0, 0, NEUTRAL, 0},//スタートゾーン - {0.1, 0.0, 0, A1, 0}, - {0.1, 0.0, 0, A1, 1}, - {0.1, 0.0, 0, B1, 0}, - {0.1, 0.0, 0, B1, 1}, - {0.1, 0.0, 0, B2, 0}, - {0.1, 0.0, 0, B2, 1}, - {0.1, 0.0, 0, C1, 0}, - {0.1, 0.0, 0, C1, 1}, - {0.1, 0.0, 0, C2, 0}, - {0.1, 0.0, 0, C2, 1}, +/* +#define B_x 1.740f +#define B_y 1.5f +#define e_posi 2.740f +#define C1_x 3.740f +#define C2_x 4.740f +#define C3_x 5.740f +#define A_x 0.8f +#define A1_y 1.5f +#define A2_y 2.5f +#define A3_y 3.5f +#define A_yow -90.0f +*/ +#define B_x 0.3f +#define B_y 0.3f +#define e_posi 0.4f +#define C1_x 0.5f +#define C2_x 0.7f +#define C3_x 0.9f +#define A_x 0.2f +#define A1_y 0.2f +#define A2_y 0.4f +#define A3_y 0.6f +#define A_yow 90.0f + +float state_lib[LIBNUM][5] ={{0.0, 0.0, 0, NEUTRAL, 0},//スタートゾーン + + {B_x, B_y, 0, B1, 0}, + {B_x, 20.0, 0, B1, 0}, + {B_x, 20.0, 0, B1, 1}, + {B_x, B_y, 0, B1, 0},//4 + + {B_x, B_y, 0, B2, 0}, + {B_x, 13.0, 0, B2, 0}, + {B_x, 13.0, 0, B2, 1}, + {B_x, B_y, 0, B2, 0},//8 + + {B_x, B_y, 0, B1, 0}, + {B_x, 20.0, 0, B1, 0}, + {B_x, 20.0, 0, B1, 1}, + {B_x, 20.0, 0, B1, 0},//12 + + {B_x, 20.0, 0, B2, 0}, + {B_x, 13.0, 0, B2, 0}, + {B_x, 13.0, 0, B2, 1}, + {B_x, B_y, 0, B2, 0},//16 + + {e_posi, 0.0, 0, NEUTRAL, 0},//17 + + {C1_x, 0.0, 0, C1, 0}, + {C1_x, 20.0, 0, C1, 0}, + {C1_x, 20.0, 0, C1, 1}, + {C1_x, 0.0, 0, C1, 0},//21 + + {C2_x, 0.0, 0, C2, 0}, + {C2_x, 20.0, 0, C2, 0}, + {C2_x, 20.0, 0, C2, 1}, + {C2_x, 0.0, 0, C2, 0},//25 + + {C3_x, 0.0, 0, C3, 0}, + {C3_x, 20.0, 0, C3, 0}, + {C3_x, 20.0, 0, C3, 1}, + {C3_x, 0.0, 0, C3, 0},//29 + + {e_posi, 0.0, 0, NEUTRAL, 0},//30 + + {0.1, A1_y, A_yow, A1, 0}, + {-25, A1_y, A_yow, A1, 0}, + {-25, A1_y, A_yow, A1, 1}, + {A_x, A1_y, A_yow, A1, 0},//34 + + {A_x, A2_y, A_yow, A2, 0}, + {-25, A2_y, A_yow, A2, 0}, + {-25, A2_y, A_yow, A2, 1}, + {A_x, A2_y, A_yow, A2, 0},//38 + + {A_x, A3_y, A_yow, A3, 0}, + {-25, A3_y, A_yow, A3, 0}, + {-25, A3_y, A_yow, A3, 1}, + {A_x, A3_y, A_yow, A3, 0},//42 + + {A_x, A1_y, 0, NEUTRAL, 0},// 43 + {0.0, 0.0, 0, NEUTRAL, 0}// 補給, スタートゾーン戻る }; @@ -39,23 +111,28 @@ topsPara para_NEUTRAL = {0, 90}; -topsPara para_A1 = {0, 84}; +/* +topsPara para_A1 = {28, 84}; topsPara para_A2 = {28, 84}; topsPara para_A3 = {28, 84}; -/* + topsPara para_B1 = {31, 82.5}; topsPara para_B2 = {58, 84.8}; topsPara para_C1 = {33, 82.5}; topsPara para_C2 = {40, 83.5}; +topsPara para_C3 = {44, 85.5}; */ -topsPara para_B1 = {0, 82.5}; -topsPara para_B2 = {0, 84.8}; +topsPara para_A1 = {15, 84}; +topsPara para_A2 = {15, 84}; +topsPara para_A3 = {15, 84}; -topsPara para_C1 = {0, 82.5}; -topsPara para_C2 = {0, 83.5}; +topsPara para_B1 = {15, 82.5}; +topsPara para_B2 = {15, 84.8}; -topsPara para_C3 = {44, 85.5}; +topsPara para_C1 = {15, 82.5}; +topsPara para_C2 = {15, 83.5}; +topsPara para_C3 = {15, 85.5}; topsPara para_lib[9] = {