code de start qui marche a la fin du premier match, base pour la suite
Fork of CRAC-Strat_2017_homologation_petit_rob by
Revision 22:a466d08ac42b, committed 2017-05-25
- Comitter:
- clementlignie
- Date:
- Thu May 25 14:40:49 2017 +0000
- Parent:
- 21:590cdacb6a35
- Commit message:
- code de strart qui marche, le 25-05, a 16h40, apres le premier match
Changed in this revision
Strategie/Strategie.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 590cdacb6a35 -r a466d08ac42b Strategie/Strategie.cpp --- a/Strategie/Strategie.cpp Thu May 25 06:34:53 2017 +0000 +++ b/Strategie/Strategie.cpp Thu May 25 14:40:49 2017 +0000 @@ -244,7 +244,13 @@ SetOdometrie(ODOMETRIE_BIG_POSITION, POSITION_DEBUT_X,localData3,localData2); #endif #ifdef ROBOT_SMALL - SetOdometrie(ODOMETRIE_SMALL_POSITION, POSITION_DEBUT_X,POSITION_DEBUT_Y,POSITION_DEBUT_T); + localData2 = POSITION_DEBUT_T; + localData3 = POSITION_DEBUT_Y; + if(InversStrat == 1) { + localData2 = -localData2;//Inversion theta + localData3 = 3000 - POSITION_DEBUT_Y;//Inversion du Y + } + SetOdometrie(ODOMETRIE_SMALL_POSITION, POSITION_DEBUT_X,localData3,localData2); #endif break; case ETAT_GAME_WAIT_FOR_JACK: @@ -338,17 +344,16 @@ } else {//C'est un rotation absolu, il faut la convertir en relative localData2 = instruction.arg3; - if(InversStrat == 1) { - localData2 = -localData2; - } - localData2 = (localData2 - theta_robot)%3600; if(localData2 > 1800) { localData2 = localData2-3600; } } - + + if(InversStrat == 1) { + localData2 = -localData2; + } Rotate(localData2); waitingAckID = ASSERVISSEMENT_ROTATION; waitingAckFrom = ACKNOWLEDGE_MOTEUR;