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
stateLib.h
- Committer:
- TanakaTarou
- Date:
- 2018-10-24
- Revision:
- 27:ac970a07ef47
- Parent:
- 26:322309c42aa4
- Child:
- 28:f3d000638fe1
File content as of revision 27:ac970a07ef47:
#define LIBNUM 68 #define NEUTRAL 0 #define A1 1 #define A2 2 #define A3 3 #define B1 4 #define B2 5 #define B2_a 6 #define B2_b 7 #define C1 8 #define C2 9 #define C3 10 #define B_x_1 0.840f #define B_x_2 1.840f #define B_x_3 2.840f #define B_x_s1 1.750f #define B_x_s3 1.930f #define B_y_1 1.5f #define B_y_2 2.5f #define B_y_3 3.5f #define B_y_s1 2.4295f #define B_y_s3 2.5705f #define e_posi 2.840f #define C1_x 3.840f #define C2_x 4.840f #define C3_x 5.840f #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_1 0.280f #define B_x_2 0.613f #define B_x_3 0.947f #define B_x_s1 0.613f #define B_x_s3 0.613f #define B_y_1 0.5f #define B_y_2 0.833f #define B_y_3 1.167f #define B_y_s1 0.833f #define B_y_s3 0.833f #define e_posi 0.947f #define C1_x 1.28f #define C2_x 1.28f //1.613f #define C3_x 1.28f //1.947f #define A_x 0.3f #define A1_y 0.5f #define A2_y 0.833f #define A3_y 1.167f #define A_yow 90.0f */ float state_lib[LIBNUM][5] ={{0.0, 0.0, 0, NEUTRAL, 0},//スタートゾーン {B_x_2, B_y_1, 0, B1, 0}, {B_x_2, 105.0, 0, B1, 0}, {B_x_2, 105.0, 0, B1, 1}, {B_x_2, B_y_1, 0, B1, 0},//4 {B_x_2, B_y_1, 0, B2, 0}, {B_x_2, 105.0, 0, B2, 0}, {B_x_2, 105.0, 0, B2, 1}, {B_x_2, B_y_1, 0, B2, 0},//8 {B_x_2, B_y_1, 0, B2, 0}, {B_x_2, 105.0, 0, B2, 0}, {B_x_2, 105.0, 0, B2, 1}, {B_x_2, 105.0, 0, B2, 0},//12 {B_x_2, 105.0, 0, B1, 0}, {B_x_2, 105.0, 0, B1, 0}, {B_x_2, 105.0, 0, B1, 1}, {B_x_2, B_y_1, 0, B1, 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.3, A1_y, A_yow, A1, 0}, {-17, A1_y, A_yow, A1, 0}, {-17, A1_y, A_yow, A1, 1}, {A_x, A1_y, A_yow, A1, 0},//34 {A_x, A2_y, A_yow, A2, 0}, {-17, A2_y, A_yow, A2, 0}, {-17, A2_y, A_yow, A2, 1}, {A_x, A2_y, A_yow, A2, 0},//38 {A_x, A3_y, A_yow, A3, 0}, {-17, A3_y, A_yow, A3, 0}, {-17, A3_y, A_yow, A3, 1}, {A_x, A3_y, A_yow, A3, 0},//42 {A_x, A1_y, 0, NEUTRAL, 0},// 43 {B_x_s1, B_y_1, 0, B2_a, 0}, {B_x_s1, 105.0, 0, B2_a, 0}, {B_x_s1, 105.0, 0, B2_a, 1},//B2手前 手前 {B_x_2, 105.0, 0, B2_a, 0}, {B_x_2, 105.0, 0, B2_a, 1},//B2手前 真ん中 {B_x_s3, 105.0, 0, B2_a, 0}, {B_x_s3, 105.0, 0, B2_a, 1},//B2手前 奥 50 {B_x_1, B_y_2, -90, B2, 0}, {105.0, B_y_2, -90, B2, 0}, {105.0, B_y_2, -90, B2, 1}, {B_x_1, B_y_1, -90, B2, 0},//54 {B_x_s1, B_y_1, 0, B2_b, 0}, {B_x_s1, 105.0, 0, B2_b, 0}, {B_x_s1, 105.0, 0, B2_b, 1},//B2手前 手前 {B_x_2, 105.0, 0, B2_b, 0}, {B_x_2, 105.0, 0, B2_b, 1},//B2手前 真ん中 {B_x_s3, 105.0, 0, B2_b, 0}, {B_x_s3, 105.0, 0, B2_b, 1},//B2手前 奥 61 {B_x_2, 0, 0, B2, 0}, {B_x_3, B_y_2, 90, B2, 0}, {-105, B_y_2, 90, B2, 0}, {-105, B_y_2, 90, B2, 1}, {B_x_3, B_y_1, 0, B2, 0},//66 {0.0, 0.0, 0, NEUTRAL, 0}// 補給, スタートゾーン戻る }; float tops_lib[4][3] = { { 0, 89.5, 0}, { 0, 89.5, 1}, { 0, 89.5, 0}, { 0, 89.5, 0} }; typedef struct topsPara { float vel, angle; }topsPara; topsPara para_NEUTRAL = {0, 89.5}; topsPara para_A1 = {18, 83}; topsPara para_A2 = {26, 83.5}; topsPara para_A3 = {18, 83}; topsPara para_B1 = {32, 85.5}; topsPara para_B2 = {58, 84.8}; topsPara para_B2_a = {58, 84.8}; topsPara para_B2_b = {58, 84.0}; topsPara para_C1 = {33, 84.0}; topsPara para_C2 = {41, 85.0}; topsPara para_C3 = {47, 86.1}; /* topsPara para_A1 = {0, 83}; topsPara para_A2 = {0, 83.5}; topsPara para_A3 = {0, 83}; topsPara para_B1 = {0, 85.5}; topsPara para_B2 = {0, 84.8}; topsPara para_B2_b = {0, 83.8}; topsPara para_C1 = {0, 84.0}; topsPara para_C2 = {0, 85.0}; topsPara para_C3 = {0, 86.1}; */ topsPara para_lib[11] = { para_NEUTRAL, para_A1, para_A2, para_A3, para_B1, para_B2, para_B2_a, para_B2_b, para_C1, para_C2, para_C3 }; typedef struct state { float x, y , theta, shoot, angle, supply; }state; typedef struct elements { float x, y , theta; }elements;