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-15
- Revision:
- 13:0479a4f3e997
- Parent:
- 12:91218718ae75
- Child:
- 14:8334c241bb0a
- Child:
- 18:268ab2ab0b2a
File content as of revision 13:0479a4f3e997:
#define LIBNUM 18
//(X, Y, θ, speed, angle)
float state_lib[LIBNUM][10] ={{0.0, 0.0, 0, 0, 90, 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, 0, 82, 0},// x移動, 角度変化
{-1.740, 25.0, 0, 0, 82, 0},// y移動
{-1.740, 20.0, 0, 0, 82, 0},// 下段に発射
*/
/*
//2段テーブル上段のみ
{-1.740, 1.5, 0, 0, 85, 0},// x移動, 角度変化
{-1.740, 13.0, 0, 0, 85, 0},// USS
{-1.740, 13.0, 0, 0, 85, 0},// 上段に発射
*/
/*
//2段テーブル上・下
{-1.740, 1.5, 0, 0, 82, 0},// x移動, 角度変化
{-1.740, 25.0, 0, 0, 82, 0},// y移動
{-1.740, 20.0, 0, 0, 82, 0},// 下段に発射
{-1.740, 20.0, 0, 0, 90, 0},// y戻る, 角度戻る
{-1.740, 25.0, 0, 0, 90, 0},// 補給
{-1.740, 13.0, 0, 0, 85, 0},// 角度変化
{-1.740, 13.0, 0, 0, 85, 0},// 上段に発射
{-2.740, 0.0, 0, 0, 90, 0},
*/
/*
//移動テーブル ノーマル
{-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},// 発射
{-3.740, 0.0, 0, 0, 90, 0},// y戻る, 角度戻る
{-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},// 発射
{-4.740, 0.0, 0, 0, 90, 0},// y戻る, 角度戻る
{-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戻る, 角度戻る
*/
//移動テーブル アクティブムーブ
{-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, 0, 90, 0},
{25, 1.5, -90, 0, 90, 0},
{25, 1.5, -90, 0, 90, 0},// 発射
{-0.8, 1.5, -90, 0, 90, 0},
{-0.8, 2.5, -90, 0, 90, 0},
{25, 2.5, -90, 0, 90, 0},
{25, 2.5, -90, 0, 90, 0},// 発射
{-0.8, 3.5, -90, 0, 90, 0},
{25, 3.5, -90, 0, 90, 0},
{25, 3.5, -90, 0, 90, 0},// 発射
{-0.8, 3.5, -90, 0, 90, 0},
{-0.8, 1.5, 0, 0, 90, 0},
*/
{0.0, 0.0, 0, 0, 90, 0}// 補給, スタートゾーン戻る
};
typedef struct state
{
float x, y , theta, shoot, angle, supply;
}state;
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;
}
}
