ロボカップ2013のジャパンオープンメインプログラム

Dependencies:   PID TextLCD mbed

common.h

Committer:
ryuna
Date:
2014-04-27
Revision:
0:fb4c529248d7

File content as of revision 0:fb4c529248d7:


enum{
    FRONT = 0,
    LEFT,
    BACK,
    RIGHT,
};
enum{
    VX = 0,
    VY,
};

const double way16[16][2] = {
    {0,1},
    {0.5,0.866},
    {0.707,0.707},
    {0.866,0.5},
    {1.0},
    {0.866,-0.5},
    {0.707,-0.707},
    {0.5,-0.866},
    {0,-1},
    {-0.5,-0.866},
    {-0.707,-0.707},
    {-0.866,-0.5},
    {-1,0},
    {-0.866,0.5},
    {-0.707,0.707},
    {-0.5,0.866}
    };

/*距離に応じた調整値、ボールの指定範囲外なら進む向きが大きい?,
範囲内なら外に出ようとする力nearに大きな
調整がかかる、これも配列*/

const double modulate_near[17] = {//0~4 = -5,-4,-3,-2,-1,,5 = 0,,6~16=1,2,3.....10
    1.20,1.1,1.05,1.02,1.01,1,1,1,1,1,1,1,1,1,1,1,1
    };
    
const double modulate_go[17] = {
    1,1,1,1,1,1,1.01,1.02,1.03,1.05,1.07,1.08,1.10,1.12,1.15,1.15,1.15
    };

const double modulate[17] = {
    1.1,1.05,1.02,1.02,1.01,1,1.01,1.02,1.03,1.05,1.07,1.08,1.15,1.15,1.15,1.15,1.20
    };

//defense move action support.
const double apply[9] = {
    1.4,1.4,1.3,1.2,1.15,1.15,1.10,1.05,1.0
    };


const double near0[10][2] = {//go go goボールと一定感覚を保とうとする輩,これまた角度ではなく値を直接投げておく
    {-1,0},
    {-0.505,0.505},
    {-0.3,0.866},
    {0,1},
    {0.3,0.866},
    {0.505,0.505},
    {1,0},
    {0.3,-0.3},//0.707,-0.707
    {0,-1.0},
    {-0.3,-0.3}//-0.707,-0.707
    };
    
const double near1[10][2] = {//back back back
    {1,0},
    {0.5,-0.5},
    {0.25,0},//0.5,-0.866
    {0,0.2},
    {-0.25,0},//-0.5,-0.866
    {-0.5,-0.5},
    {-1,0},
    {-0.707,0.303},//-0.707,0.707
    {0,0.4},
    {0.707,0.303}//0.707,0.707
    };
    
const double go[10][2] = {//ir_numに沿ったそれぞれの動きを直接配列に投げて置く参照、ir_action0~9
    {0,-0.433},
    {-0.303,-0.757},//0.303
    {-0.3,0},
    {0,0.8},//other block
    {0.3,0},
    {0.303,-0.757},//0.303
    {0,-0.433},
    {0,-1},
    {0,-0.5},//other block@ir_action8
    {0,-1},
    };
    
const int keep_dist[10] = {//ir_num[0~9]
    45,48,45,44,45,50,49,41,49,39//45,49,444444,
    };
    
const int keep_ping[4] = {
    0,58,30,56
    };
    
const int keep_pingSTRONG[4] = {
    0,40,20,36
    };
    
const int keep_ball[10] = {
    37,33,27,27,27,30,34,31,32,32//28
    };

const double goal_state1[12][2] = {
    {0.866,0.5},
    {0.866,0.5},
    {0.866,0.5},
    {0.866,0.5},
    {0.866,0.5},
    {0.433,0.25},
    {0.433,0.25},
    {0.433,0.25},
    {0.433,0},
    {0,0},
    {0,0},
    {0.0}
    };

const double goal_state2[12][2] = {
    {0,-1},
    {0,-0.8},
    {0,-0.6},
    {0,-0.4},
    {0,-0.2},
    {0,0},
    {0,0},
    {0,0},
    {0,0},
    {0,0.1},
    {0,0.3},
    {0,0.4}
    };
    
const double goal_state3[12][2] = {
    {-0.866,0.5},
    {-0.866,0.5},
    {-0.866,0.5},
    {-0.866,0.5},
    {-0.866,0.5},
    {-0.433,0.25},
    {-0.433,0.25},
    {-0.433,0.25},
    {-0.433,0},
    {0,0},
    {0,0},
    {0.0}
    };

const double ball_state0[10][2] = {//ir_num[0~9]
    {-1,-0.5},
    {-0.866,0.2},
    {-0.707,0.5},
    {0,0},
    {0.707,0.5},
    {0.866,0.2},
    {1,-0.5},
    {0.7,-1},
    {0,-1},
    {-0.7,-1}
    };
    
const double ball_state1[10][2] = {//ir_num[0~9]
    {-1.0,-0.3},
    {-0.9,-0.4},
    {-0.9,0.866},
    {0,1},
    {0.9,0.866},
    {0.9,-0.4},
    {1.0,-0.3},
    {-0.404,-0.7},
    {0,0},//other comand
    {0.404,-0.7}  
    };
    

const double strongPing1[12][2] = {
    {0.866,0.5},
    {0.866,0.5},
    {0.866,0.5},
    {0.866,0.5},
    {0.577,0.5},
    {0.577,0.5},
    {0.577,0.25},
    {0.577,0.25},
    {0.433,0.1},
    {0.211,0.1},
    {0,0},
    {0.0}
    };

const double strongPing2[12][2] = {
    {0,0},
    {0,0},
    {0,0},
    {0,0},
    {0,0},
    {0,0},
    {0,0},
    {0,0},
    {0,0},
    {0,0},
    {0,0.3},
    {0,0.5}
    };
   
const double strongPing3[12][2] ={
    {-0.866,0.5},
    {-0.866,0.5},
    {-0.866,0.5},
    {-0.866,0.5},
    {-0.866,0.5},
    {-0.577,0.5},
    {-0.577,0.25},
    {-0.577,0.25},
    {-0.433,0.1},
    {-0.211,0.1},
    {0,0},
    {0.0}
  };    

/*
ir_number position

    2   3   4
 1 /----------\5
  /            \
0|              |6
 \              /
9 \____________/ 7
        8



*/