v2019
Dependencies: CRAC-Strat_2019 SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac
Dependents: Codeprincipal_2019 CRAC-Strat_2019
Robots/Strategie_big.cpp@65:1789068cf5ab, 2019-05-25 (annotated)
- Committer:
- Artiom
- Date:
- Sat May 25 16:08:22 2019 +0000
- Revision:
- 65:1789068cf5ab
- Parent:
- 56:95c329e42200
c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Sitkah | 29:41e02746041d | 1 | #include "global.h" |
Sitkah | 29:41e02746041d | 2 | #ifdef ROBOT_BIG |
ClementBreteau | 15:c2fc239e85df | 3 | |
Sitkah | 29:41e02746041d | 4 | |
antbig | 12:14729d584500 | 5 | unsigned char isStopEnable = 1;//Permet de savoir si il faut autoriser le stop via les balises |
antbig | 12:14729d584500 | 6 | |
antbig | 0:ad97421fb1fb | 7 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 8 | /* FUNCTION NAME: doFunnyAction */ |
antbig | 0:ad97421fb1fb | 9 | /* DESCRIPTION : Permet de faire la funny action en fin de partie */ |
antbig | 0:ad97421fb1fb | 10 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 11 | void doFunnyAction(void) { |
ClementBreteau | 18:cc5fec34ed9c | 12 | //envoie de la funny action |
ClementBreteau | 18:cc5fec34ed9c | 13 | // 0x007, 01, 01 |
ClementBreteau | 18:cc5fec34ed9c | 14 | CANMessage msgTx=CANMessage(); |
ClementBreteau | 18:cc5fec34ed9c | 15 | msgTx.id=GLOBAL_FUNNY_ACTION; |
ClementBreteau | 18:cc5fec34ed9c | 16 | msgTx.format=CANStandard; |
ClementBreteau | 18:cc5fec34ed9c | 17 | msgTx.type=CANData; |
ClementBreteau | 18:cc5fec34ed9c | 18 | msgTx.len=2; |
ClementBreteau | 18:cc5fec34ed9c | 19 | msgTx.data[0]=0x01; |
ClementBreteau | 18:cc5fec34ed9c | 20 | msgTx.data[1]=0x01; |
ClementBreteau | 18:cc5fec34ed9c | 21 | can1.write(msgTx); |
antbig | 0:ad97421fb1fb | 22 | } |
antbig | 0:ad97421fb1fb | 23 | |
antbig | 0:ad97421fb1fb | 24 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 25 | /* FUNCTION NAME: doAction */ |
antbig | 0:ad97421fb1fb | 26 | /* DESCRIPTION : Effectuer une action specifique */ |
antbig | 0:ad97421fb1fb | 27 | /****************************************************************************************/ |
Sitkah | 30:a1e37af4bbde | 28 | unsigned char doAction(unsigned char id, unsigned short var1, short var2) { |
antbig | 12:14729d584500 | 29 | CANMessage msgTx=CANMessage(); |
Sitkah | 30:a1e37af4bbde | 30 | msgTx.format=CANStandard; |
Sitkah | 30:a1e37af4bbde | 31 | msgTx.type=CANData; |
Sitkah | 30:a1e37af4bbde | 32 | //affichage_debug(id); |
Sitkah | 30:a1e37af4bbde | 33 | |
antbig | 0:ad97421fb1fb | 34 | switch(id) { |
Sitkah | 30:a1e37af4bbde | 35 | /////////////////////////////////////////////////////////100 à 108 : ACTIONS HERKULEX///////////////////////////////////////////// |
kyxstark | 56:95c329e42200 | 36 | /*case 100: //Monte l'immeuble selon le code couleur |
Sitkah | 36:6dd30780bd8e | 37 | msgTx.id=MONTER_IMMEUBLE_DOUBLE; |
ClementBreteau | 18:cc5fec34ed9c | 38 | |
Sitkah | 30:a1e37af4bbde | 39 | msgTx.len=3; |
Sitkah | 30:a1e37af4bbde | 40 | msgTx.data[0]=couleur1; |
Sitkah | 30:a1e37af4bbde | 41 | msgTx.data[1]=couleur2; |
Sitkah | 30:a1e37af4bbde | 42 | msgTx.data[2]=couleur3; |
Sitkah | 36:6dd30780bd8e | 43 | can2.write(msgTx); |
Sitkah | 38:76f886a1c8e6 | 44 | break; |
ClementBreteau | 15:c2fc239e85df | 45 | |
Sitkah | 30:a1e37af4bbde | 46 | case 101: //baisser l'attrape bloc arrière |
kyxstark | 56:95c329e42200 | 47 | //SendRawId(BAISSER_ATTRAPE_BLOC); |
Sitkah | 30:a1e37af4bbde | 48 | break; |
Sitkah | 30:a1e37af4bbde | 49 | case 102: //Relever l'attrape bloc arrière |
kyxstark | 56:95c329e42200 | 50 | //SendRawId(RELEVER_ATTRAPE_BLOC); |
Sitkah | 30:a1e37af4bbde | 51 | break; |
Sitkah | 30:a1e37af4bbde | 52 | case 103: // |
kyxstark | 56:95c329e42200 | 53 | //SendRawId(BAISSER_ATTRAPE_BLOC_AvG); |
Sitkah | 30:a1e37af4bbde | 54 | break; |
Sitkah | 30:a1e37af4bbde | 55 | case 104: |
kyxstark | 56:95c329e42200 | 56 | //SendRawId(RELEVER_ATTRAPE_BLOC_AvG); |
Sitkah | 30:a1e37af4bbde | 57 | break; |
Sitkah | 30:a1e37af4bbde | 58 | case 105: |
kyxstark | 56:95c329e42200 | 59 | //SendRawId(BAISSER_ATTRAPE_BLOC_AvD); |
Sitkah | 30:a1e37af4bbde | 60 | break; |
Sitkah | 30:a1e37af4bbde | 61 | case 106: |
kyxstark | 56:95c329e42200 | 62 | //SendRawId(RELEVER_ATTRAPE_BLOC_AvD); |
Sitkah | 30:a1e37af4bbde | 63 | break; |
Sitkah | 30:a1e37af4bbde | 64 | case 107: |
Sitkah | 36:6dd30780bd8e | 65 | msgTx.id=MONTER_IMMEUBLE; |
Sitkah | 36:6dd30780bd8e | 66 | msgTx.len=4; |
Sitkah | 36:6dd30780bd8e | 67 | msgTx.data[0]=couleur1; |
Sitkah | 36:6dd30780bd8e | 68 | msgTx.data[1]=couleur2; |
Sitkah | 36:6dd30780bd8e | 69 | msgTx.data[2]=couleur3; |
Sitkah | 38:76f886a1c8e6 | 70 | msgTx.data[3]=var1; |
Sitkah | 40:21bb685b553b | 71 | msgTx.data[4]=var2; |
Sitkah | 36:6dd30780bd8e | 72 | can2.write(msgTx); |
Sitkah | 41:b029ddc4d60e | 73 | break; |
Sitkah | 38:76f886a1c8e6 | 74 | case 108: |
Sitkah | 38:76f886a1c8e6 | 75 | SendRawId(INTER_BAISSER_ATTRAPE_BLOC_AvG); |
Sitkah | 38:76f886a1c8e6 | 76 | break; |
Sitkah | 38:76f886a1c8e6 | 77 | case 109: |
Sitkah | 38:76f886a1c8e6 | 78 | SendRawId(INTER_BAISSER_ATTRAPE_BLOC_AvD); |
Sitkah | 38:76f886a1c8e6 | 79 | break; |
Sitkah | 30:a1e37af4bbde | 80 | case 111: |
Sitkah | 38:76f886a1c8e6 | 81 | SendRawId(RANGER_ATTRAPE_BLOC_AvD); |
Sitkah | 30:a1e37af4bbde | 82 | break; |
Sitkah | 30:a1e37af4bbde | 83 | case 112: |
Sitkah | 38:76f886a1c8e6 | 84 | SendRawId(RANGER_ATTRAPE_BLOC_AvG); |
Sitkah | 30:a1e37af4bbde | 85 | break; |
Sitkah | 41:b029ddc4d60e | 86 | case 113: |
Sitkah | 41:b029ddc4d60e | 87 | msgTx.id=LIRE_PANNEAU; |
Sitkah | 41:b029ddc4d60e | 88 | msgTx.len=1; |
Sitkah | 41:b029ddc4d60e | 89 | msgTx.data[0]=var1; |
Sitkah | 41:b029ddc4d60e | 90 | can2.write(msgTx); |
Sitkah | 41:b029ddc4d60e | 91 | break; |
Sitkah | 38:76f886a1c8e6 | 92 | |
Sitkah | 38:76f886a1c8e6 | 93 | case 150: |
Sitkah | 38:76f886a1c8e6 | 94 | SCORE_GR+=var1; |
Sitkah | 38:76f886a1c8e6 | 95 | SCORE_GLOBAL=SCORE_GR+SCORE_PR; |
Sitkah | 40:21bb685b553b | 96 | //liaison_Tx.envoyer_short(0x30,SCORE_GLOBAL); |
Sitkah | 38:76f886a1c8e6 | 97 | waitingAckFrom = 0; |
Sitkah | 38:76f886a1c8e6 | 98 | waitingAckID = 0; |
Sitkah | 38:76f886a1c8e6 | 99 | break; |
Sitkah | 38:76f886a1c8e6 | 100 | |
ClementBreteau | 18:cc5fec34ed9c | 101 | |
antbig | 12:14729d584500 | 102 | case 10://Désactiver le stop |
antbig | 12:14729d584500 | 103 | isStopEnable = 0; |
antbig | 12:14729d584500 | 104 | break; |
antbig | 12:14729d584500 | 105 | case 11://Activer le stop |
antbig | 12:14729d584500 | 106 | isStopEnable = 1; |
antbig | 12:14729d584500 | 107 | break; |
antbig | 12:14729d584500 | 108 | case 20://Désactiver l'asservissement |
antbig | 12:14729d584500 | 109 | setAsservissementEtat(0); |
antbig | 12:14729d584500 | 110 | break; |
antbig | 12:14729d584500 | 111 | case 21://Activer l'asservissement |
antbig | 12:14729d584500 | 112 | setAsservissementEtat(1); |
antbig | 12:14729d584500 | 113 | break; |
antbig | 12:14729d584500 | 114 | |
antbig | 12:14729d584500 | 115 | case 22://Changer la vitesse du robot |
Sitkah | 30:a1e37af4bbde | 116 | SendSpeed(var1,(unsigned short)var2); |
ClementBreteau | 26:2f4fcc2354f3 | 117 | waitingAckFrom = 0; |
ClementBreteau | 26:2f4fcc2354f3 | 118 | waitingAckID = 0; |
ClementBreteau | 26:2f4fcc2354f3 | 119 | wait(0.2); |
antbig | 12:14729d584500 | 120 | break; |
antbig | 12:14729d584500 | 121 | |
antbig | 12:14729d584500 | 122 | case 30://Action tempo |
Sitkah | 30:a1e37af4bbde | 123 | wait_ms(var1); |
Sitkah | 40:21bb685b553b | 124 | waitingAckFrom = 0; |
Sitkah | 40:21bb685b553b | 125 | waitingAckID = 0; |
antbig | 12:14729d584500 | 126 | break; |
kyxstark | 56:95c329e42200 | 127 | */ |
antbig | 12:14729d584500 | 128 | |
ClementBreteau | 18:cc5fec34ed9c | 129 | /*case 40: // demande au telemetre la position d'un objet |
ClementBreteau | 14:c8fc06c4887f | 130 | //SendRawId(TELEMETRE_RECHERCHE_OBJET); |
ClementBreteau | 15:c2fc239e85df | 131 | |
ClementBreteau | 15:c2fc239e85df | 132 | modeTelemetre = 1; |
ClementBreteau | 15:c2fc239e85df | 133 | |
ClementBreteau | 15:c2fc239e85df | 134 | //angle = angle /10; |
ClementBreteau | 15:c2fc239e85df | 135 | |
ClementBreteau | 15:c2fc239e85df | 136 | msgTx.id=TELEMETRE_OBJET; |
ClementBreteau | 15:c2fc239e85df | 137 | msgTx.format=CANStandard; |
ClementBreteau | 15:c2fc239e85df | 138 | msgTx.type=CANData; |
ClementBreteau | 15:c2fc239e85df | 139 | msgTx.len=1; |
ClementBreteau | 15:c2fc239e85df | 140 | // indice du module sur le terrain |
ClementBreteau | 15:c2fc239e85df | 141 | msgTx.data[0] = (unsigned char)speed; |
ClementBreteau | 15:c2fc239e85df | 142 | |
ClementBreteau | 18:cc5fec34ed9c | 143 | |
ClementBreteau | 15:c2fc239e85df | 144 | // x sur 2 octets |
ClementBreteau | 15:c2fc239e85df | 145 | msgTx.data[0]=(unsigned char)speed; |
ClementBreteau | 15:c2fc239e85df | 146 | msgTx.data[1]=(unsigned char)(speed>>8); |
ClementBreteau | 15:c2fc239e85df | 147 | // y sur 2 octets |
ClementBreteau | 15:c2fc239e85df | 148 | msgTx.data[2]=(unsigned char)angle; |
ClementBreteau | 15:c2fc239e85df | 149 | msgTx.data[3]=(unsigned char)(angle>>8); |
ClementBreteau | 15:c2fc239e85df | 150 | // theta signé sur 2 octets |
ClementBreteau | 15:c2fc239e85df | 151 | //msgTx.data[4]=(unsigned char)theta; |
ClementBreteau | 15:c2fc239e85df | 152 | //msgTx.data[5]=(unsigned char)(theta>>8); |
ClementBreteau | 15:c2fc239e85df | 153 | msgTx.data[4]=0; |
ClementBreteau | 18:cc5fec34ed9c | 154 | msgTx.data[5]=0; |
ClementBreteau | 15:c2fc239e85df | 155 | |
ClementBreteau | 15:c2fc239e85df | 156 | can1.write(msgTx); |
ClementBreteau | 15:c2fc239e85df | 157 | |
ClementBreteau | 18:cc5fec34ed9c | 158 | break;*/ |
ClementBreteau | 14:c8fc06c4887f | 159 | |
ClementBreteau | 18:cc5fec34ed9c | 160 | /* case 130://Lancer mouvement de sortie de la zone de départ |
ClementBreteau | 15:c2fc239e85df | 161 | msgTx.id=ACTION_BIG_DEMARRAGE; |
ClementBreteau | 15:c2fc239e85df | 162 | msgTx.format=CANStandard; |
ClementBreteau | 15:c2fc239e85df | 163 | msgTx.type=CANData; |
ClementBreteau | 15:c2fc239e85df | 164 | msgTx.len=1; |
ClementBreteau | 15:c2fc239e85df | 165 | msgTx.data[0] = (unsigned char)speed; |
ClementBreteau | 15:c2fc239e85df | 166 | can1.write(msgTx); |
ClementBreteau | 18:cc5fec34ed9c | 167 | break;*/ |
antbig | 12:14729d584500 | 168 | |
antbig | 0:ad97421fb1fb | 169 | default: |
antbig | 0:ad97421fb1fb | 170 | return 0;//L'action n'existe pas, il faut utiliser le CAN |
antbig | 0:ad97421fb1fb | 171 | |
antbig | 0:ad97421fb1fb | 172 | } |
antbig | 0:ad97421fb1fb | 173 | return 1;//L'action est spécifique. |
antbig | 0:ad97421fb1fb | 174 | |
antbig | 0:ad97421fb1fb | 175 | } |
antbig | 0:ad97421fb1fb | 176 | |
antbig | 0:ad97421fb1fb | 177 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 178 | /* FUNCTION NAME: initRobot */ |
antbig | 0:ad97421fb1fb | 179 | /* DESCRIPTION : initialiser le robot */ |
antbig | 0:ad97421fb1fb | 180 | /****************************************************************************************/ |
antbig | 9:d0042422d95a | 181 | void initRobot(void) |
antbig | 9:d0042422d95a | 182 | { |
antbig | 9:d0042422d95a | 183 | //Enregistrement de tous les AX12 présent sur la carte |
ClementBreteau | 15:c2fc239e85df | 184 | /*AX12_register(5, AX12_SERIAL2); |
antbig | 8:0edc7dfb7f7e | 185 | AX12_register(18, AX12_SERIAL2); |
antbig | 8:0edc7dfb7f7e | 186 | AX12_register(13, AX12_SERIAL2); |
antbig | 12:14729d584500 | 187 | AX12_register(1, AX12_SERIAL1); |
antbig | 12:14729d584500 | 188 | AX12_register(11, AX12_SERIAL1); |
antbig | 12:14729d584500 | 189 | AX12_register(8, AX12_SERIAL1); |
ClementBreteau | 15:c2fc239e85df | 190 | AX12_register(7, AX12_SERIAL2);*/ |
antbig | 9:d0042422d95a | 191 | |
antbig | 12:14729d584500 | 192 | //AX12_setGoal(AX12_ID_FUNNY_ACTION, AX12_ANGLE_FUNNY_ACTION_CLOSE,AX12_SPEED_FUNNY_ACTION); |
antbig | 12:14729d584500 | 193 | //AX12_processChange(); |
antbig | 11:ed13a480ddca | 194 | //runRobotTest(); |
ClementBreteau | 16:7321fb3bb396 | 195 | |
antbig | 9:d0042422d95a | 196 | } |
antbig | 9:d0042422d95a | 197 | |
antbig | 9:d0042422d95a | 198 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 199 | /* FUNCTION NAME: initRobotActionneur */ |
antbig | 12:14729d584500 | 200 | /* DESCRIPTION : Initialiser la position des actionneurs du robot */ |
antbig | 12:14729d584500 | 201 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 202 | void initRobotActionneur(void) |
antbig | 12:14729d584500 | 203 | { |
ClementBreteau | 23:ab87d308eaf9 | 204 | /*doAction(100,1,0); |
ClementBreteau | 23:ab87d308eaf9 | 205 | doAction(100,2,0); |
ClementBreteau | 23:ab87d308eaf9 | 206 | doAction(110,0,0); |
ClementBreteau | 23:ab87d308eaf9 | 207 | doAction(120,0,0); |
ClementBreteau | 23:ab87d308eaf9 | 208 | doAction(131,0,0);*/ |
ClementBreteau | 23:ab87d308eaf9 | 209 | |
antbig | 12:14729d584500 | 210 | } |
antbig | 12:14729d584500 | 211 | |
antbig | 12:14729d584500 | 212 | /****************************************************************************************/ |
antbig | 9:d0042422d95a | 213 | /* FUNCTION NAME: runTest */ |
antbig | 9:d0042422d95a | 214 | /* DESCRIPTION : tester l'ensemble des actionneurs du robot */ |
antbig | 9:d0042422d95a | 215 | /****************************************************************************************/ |
antbig | 9:d0042422d95a | 216 | void runRobotTest(void) |
antbig | 9:d0042422d95a | 217 | { |
ClementBreteau | 18:cc5fec34ed9c | 218 | /* |
antbig | 12:14729d584500 | 219 | int waitTime = 500; |
antbig | 12:14729d584500 | 220 | |
antbig | 9:d0042422d95a | 221 | //Test des AX12 dans l'ordre |
antbig | 9:d0042422d95a | 222 | doAction(111,0,0);//Fermeture pince arrière haute |
antbig | 12:14729d584500 | 223 | wait_ms(waitTime); |
antbig | 9:d0042422d95a | 224 | doAction(110,0,0);//Ouverture pince arrière haute |
antbig | 12:14729d584500 | 225 | wait_ms(waitTime); |
antbig | 9:d0042422d95a | 226 | doAction(113,0,0);//Fermeture pince arrière basse |
antbig | 12:14729d584500 | 227 | wait_ms(waitTime); |
antbig | 9:d0042422d95a | 228 | doAction(112,0,0);//Ouverture pince arrière basse |
antbig | 12:14729d584500 | 229 | wait_ms(waitTime); |
antbig | 9:d0042422d95a | 230 | doAction(115,0,0);//Fermeture porte arrière |
antbig | 12:14729d584500 | 231 | wait_ms(waitTime); |
antbig | 9:d0042422d95a | 232 | doAction(114,0,0);//Ouverture porte arrière |
antbig | 12:14729d584500 | 233 | wait_ms(waitTime); |
antbig | 12:14729d584500 | 234 | doAction(101,0,0);//Fermer les portes avant |
antbig | 12:14729d584500 | 235 | wait_ms(waitTime); |
antbig | 12:14729d584500 | 236 | doAction(100,0,0);//Ouvrir les portes avant |
antbig | 12:14729d584500 | 237 | wait_ms(waitTime); |
antbig | 12:14729d584500 | 238 | doAction(103,0,0);//Descendre le peigne |
antbig | 12:14729d584500 | 239 | wait_ms(waitTime); |
ClementBreteau | 18:cc5fec34ed9c | 240 | doAction(102,0,0);//Remonter le peigne*/ |
antbig | 0:ad97421fb1fb | 241 | } |
antbig | 3:19f2285a4757 | 242 | |
antbig | 4:88431b537477 | 243 | /****************************************************************************************/ |
antbig | 4:88431b537477 | 244 | /* FUNCTION NAME: SelectStrategy */ |
antbig | 4:88431b537477 | 245 | /* DESCRIPTION : Charger le fichier de stratégie correspondante à un id */ |
antbig | 4:88431b537477 | 246 | /* RETURN : 0=> Erreur, 1=> OK si le fichier existe */ |
antbig | 4:88431b537477 | 247 | /****************************************************************************************/ |
Sitkah | 29:41e02746041d | 248 | /*int SelectStrategy(unsigned char id) |
antbig | 4:88431b537477 | 249 | { |
antbig | 4:88431b537477 | 250 | switch(id) |
antbig | 4:88431b537477 | 251 | { |
ClementBreteau | 15:c2fc239e85df | 252 | // strat de match |
antbig | 4:88431b537477 | 253 | case 1: |
antbig | 11:ed13a480ddca | 254 | strcpy(cheminFileStart,"/local/strat1.txt"); |
antbig | 11:ed13a480ddca | 255 | return FileExists(cheminFileStart); |
antbig | 11:ed13a480ddca | 256 | case 2: |
antbig | 11:ed13a480ddca | 257 | strcpy(cheminFileStart,"/local/strat2.txt"); |
antbig | 11:ed13a480ddca | 258 | return FileExists(cheminFileStart); |
antbig | 11:ed13a480ddca | 259 | case 3: |
antbig | 11:ed13a480ddca | 260 | strcpy(cheminFileStart,"/local/strat3.txt"); |
antbig | 11:ed13a480ddca | 261 | return FileExists(cheminFileStart); |
antbig | 12:14729d584500 | 262 | case 4: |
antbig | 12:14729d584500 | 263 | strcpy(cheminFileStart,"/local/strat4.txt"); |
antbig | 12:14729d584500 | 264 | return FileExists(cheminFileStart); |
antbig | 12:14729d584500 | 265 | case 5: |
antbig | 12:14729d584500 | 266 | strcpy(cheminFileStart,"/local/strat5.txt"); |
antbig | 12:14729d584500 | 267 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 268 | case 6: |
ClementBreteau | 14:c8fc06c4887f | 269 | strcpy(cheminFileStart,"/local/strat6.txt"); |
ClementBreteau | 14:c8fc06c4887f | 270 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 271 | case 7: |
ClementBreteau | 14:c8fc06c4887f | 272 | strcpy(cheminFileStart,"/local/strat7.txt"); |
ClementBreteau | 14:c8fc06c4887f | 273 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 274 | case 8: |
ClementBreteau | 14:c8fc06c4887f | 275 | strcpy(cheminFileStart,"/local/strat8.txt"); |
ClementBreteau | 14:c8fc06c4887f | 276 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 277 | case 9: |
ClementBreteau | 14:c8fc06c4887f | 278 | strcpy(cheminFileStart,"/local/strat9.txt"); |
ClementBreteau | 14:c8fc06c4887f | 279 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 280 | case 10: |
ClementBreteau | 14:c8fc06c4887f | 281 | strcpy(cheminFileStart,"/local/strat10.txt"); |
ClementBreteau | 14:c8fc06c4887f | 282 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 283 | |
ClementBreteau | 15:c2fc239e85df | 284 | // strat de demo |
ClementBreteau | 14:c8fc06c4887f | 285 | case 0x10: |
ClementBreteau | 14:c8fc06c4887f | 286 | strcpy(cheminFileStart,"/local/moteur.txt"); |
ClementBreteau | 14:c8fc06c4887f | 287 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 288 | case 0x11: |
ClementBreteau | 15:c2fc239e85df | 289 | #ifdef ROBOT_BIG |
ClementBreteau | 15:c2fc239e85df | 290 | strcpy(cheminFileStart,"/local/bras.txt"); |
ClementBreteau | 15:c2fc239e85df | 291 | #else |
ClementBreteau | 15:c2fc239e85df | 292 | strcpy(cheminFileStart,"/local/porteAvant.txt"); |
ClementBreteau | 15:c2fc239e85df | 293 | #endif |
ClementBreteau | 14:c8fc06c4887f | 294 | return FileExists(cheminFileStart); |
ClementBreteau | 15:c2fc239e85df | 295 | case 0x12: |
ClementBreteau | 15:c2fc239e85df | 296 | #ifdef ROBOT_BIG |
ClementBreteau | 15:c2fc239e85df | 297 | strcpy(cheminFileStart,"/local/balancier.txt"); |
ClementBreteau | 15:c2fc239e85df | 298 | #else |
ClementBreteau | 15:c2fc239e85df | 299 | strcpy(cheminFileStart,"/local/mainTourneuse.txt"); |
ClementBreteau | 15:c2fc239e85df | 300 | #endif |
ClementBreteau | 15:c2fc239e85df | 301 | return FileExists(cheminFileStart); |
antbig | 11:ed13a480ddca | 302 | default: |
antbig | 12:14729d584500 | 303 | strcpy(cheminFileStart,"/local/strat1.txt"); |
antbig | 11:ed13a480ddca | 304 | return 0; |
antbig | 4:88431b537477 | 305 | } |
Sitkah | 29:41e02746041d | 306 | }*/ |
antbig | 4:88431b537477 | 307 | |
antbig | 12:14729d584500 | 308 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 309 | /* FUNCTION NAME: needToStop */ |
antbig | 12:14729d584500 | 310 | /* DESCRIPTION : Savoir si il faut autoriser le stop du robot via balise */ |
antbig | 12:14729d584500 | 311 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 312 | unsigned char needToStop(void) |
antbig | 12:14729d584500 | 313 | { |
antbig | 12:14729d584500 | 314 | return isStopEnable; |
antbig | 12:14729d584500 | 315 | } |
antbig | 12:14729d584500 | 316 | |
antbig | 12:14729d584500 | 317 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 318 | /* FUNCTION NAME: doBeforeEndAction */ |
antbig | 12:14729d584500 | 319 | /* DESCRIPTION : Terminer les actions du robot 1s avant la fin du match */ |
antbig | 12:14729d584500 | 320 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 321 | void doBeforeEndAction(void) |
antbig | 12:14729d584500 | 322 | { |
antbig | 12:14729d584500 | 323 | doAction(110,0,0);//Ouverture pince arrière haute |
antbig | 12:14729d584500 | 324 | doAction(112,0,0);//Ouverture pince arrière basse |
antbig | 12:14729d584500 | 325 | doAction(114,0,0);//Ouverture porte arrière |
antbig | 12:14729d584500 | 326 | doAction(100,0,0);//Ouvrir les portes avant |
antbig | 12:14729d584500 | 327 | doAction(102,0,0);//Remonter le peigne |
antbig | 12:14729d584500 | 328 | } |
antbig | 12:14729d584500 | 329 | |
antbig | 3:19f2285a4757 | 330 | #endif |