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-09-25
- Revision:
- 17:1409cdfb6043
- Parent:
- 16:621f04b15f86
File content as of revision 17:1409cdfb6043:
#define LIBNUM 44
//(X, Y, θ, speed, angle)
#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},//
{-1.740, 20, 0, 0, 90, 0},// USS
{-1.740, 20, 0, 0, 90, 0},// 発射
{-1.740, 1.5, 0, 0, 90, 0},//
{-2.740, 1.5, -45, 0, 90, 0},//
{-2.740, 2.5, -90, 0, 90, 0},//
{20, 2.5, -90, 0, 90, 0},// USS
{20, 2.5, -90, 0, 90, 0},// 発射
{-2.740, 2.5, -90, 0, 90, 0},//
{-2.740, 3.5, -135, 0, 90, 0},//
{-1.740, 3.5, -180, 0, 90, 0},//
{-1.740, -20, -180, 0, 90, 0},// USS
{-1.740, -20, -180, 0, 90, 0},// 発射
{-1.740, 3.5, -180, 0, 90, 0},//
{-0.740, 3.5, -225, 0, 90, 0},//
{-0.740, 2.5, -270, 0, 90, 0},//
{-20, 2.5, -270, 0, 90, 0},// USS
{-20, 2.5, -270, 0, 90, 0},// 発射
{-0.740, 2.5, -270, 0, 90, 0},//
{-0.740, 1.5, -270, 0, 90, 0},//
*/
//2段テーブル下段のみ
{-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, 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, 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, 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, NEUTRAL, 0},// 17
//移動テーブル ノーマル
{-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, 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, 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戻る, 角度戻る
/*
//移動テーブル アクティブムーブ
{-3.740, 0.0, 0, 0, 90, 0},// x移動, 補給
{-3.740, 25.0, 0, 0, 82, 0},// y移動, 角度変化
{-3.740, 25.0, 0, 0, 82, 0},// 発射
{-4.740, 2.0, 180, 0, 90, 0},// x移動, 補給
{-4.740, -25.0, 180, 0, 83, 0},// y移動, 角度変化
{-4.740, -25.0, 180, 0, 83, 0},// 発射
{-5.740, 2.0, 0, 0, 90, 0},// x移動, 補給
{-5.740, 25.0, 0, 0, 85, 0},// y移動, 角度変化
{-5.740, 25.0, 0, 0, 85, 0},// 発射
{-5.740, 0.0, 0, 0, 90, 0},// y戻る, 角度戻る
*/
//固定テーブル
{-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, 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, 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, NEUTRAL, 0},// 42
{0.0, 0.0, 0, 9, 0}// 補給, スタートゾーン戻る
};
float A_1[4][3] = {{0, 90, 1},
{0, 84, 0},
{28, 84, 0},
{0, 90, 0},
};
float A_2[4][3] = {{0, 90, 1},
{0, 84, 0},
{28, 84, 0},
{0, 90, 0},
};
float A_3[4][3] = {{0, 90, 1},
{0, 84, 0},
{28, 84, 0},
{0, 90, 0},
};
float B_1[4][3] = {{0, 90, 1},
{0, 82.5, 0},
{31, 82.5, 0},
{0, 90, 0},
};
float B_2[4][3] = {{0, 90, 1},
{0, 84.8, 0},
{58, 84.8, 0},
{0, 90, 0},
};
float C_1[4][3] = {{0, 90, 1},
{0, 82.5, 0},
{33, 82.5, 0},
{0, 90, 0},
};
float C_2[4][3] = {{0, 90, 1},
{0, 83.5, 0},
{40, 83.5, 0},
{0, 90, 0},
};
float C_3[4][3] = {{0, 90, 1},
{0, 85.5, 0},
{44, 85.5, 0},
{0, 90, 0},
};
float state_tops[4][3];
typedef struct state
{
float x, y , theta, shoot, angle, supply;
}state;
typedef struct elements
{
float x, y , theta;
}elements;
