carte_strategie_2019
Dependencies: mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac
Robots/Strategie_big.cpp@14:c8fc06c4887f, 2017-03-31 (annotated)
- Committer:
- ClementBreteau
- Date:
- Fri Mar 31 16:20:26 2017 +0000
- Revision:
- 14:c8fc06c4887f
- Parent:
- 12:14729d584500
- Child:
- 15:c2fc239e85df
code strategie du robot, version 31 mars 2017
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
antbig | 1:116040d14164 | 1 | #include "StrategieManager.h" |
antbig | 3:19f2285a4757 | 2 | #ifdef ROBOT_BIG |
antbig | 3:19f2285a4757 | 3 | #include "Config_big.h" |
antbig | 0:ad97421fb1fb | 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) { |
antbig | 12:14729d584500 | 12 | AX12_setGoal(AX12_ID_FUNNY_ACTION, AX12_ANGLE_FUNNY_ACTION_OPEN,AX12_SPEED_FUNNY_ACTION); |
antbig | 9:d0042422d95a | 13 | AX12_processChange(); |
antbig | 0:ad97421fb1fb | 14 | |
antbig | 0:ad97421fb1fb | 15 | } |
antbig | 0:ad97421fb1fb | 16 | |
antbig | 0:ad97421fb1fb | 17 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 18 | /* FUNCTION NAME: doAction */ |
antbig | 0:ad97421fb1fb | 19 | /* DESCRIPTION : Effectuer une action specifique */ |
antbig | 0:ad97421fb1fb | 20 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 21 | unsigned char doAction(unsigned char id, unsigned short speed, short angle) { |
antbig | 12:14729d584500 | 22 | CANMessage msgTx=CANMessage(); |
antbig | 0:ad97421fb1fb | 23 | switch(id) { |
antbig | 3:19f2285a4757 | 24 | |
antbig | 12:14729d584500 | 25 | case 100://Ouvrir les portes avant |
antbig | 12:14729d584500 | 26 | AX12_setGoal(AX12_ID_PORTE_AVANT_GAUCHE, AX12_ANGLE_PORTE_AVANT_GAUCHE_OUVERTE); |
antbig | 12:14729d584500 | 27 | AX12_setGoal(AX12_ID_PORTE_AVANT_DROITE, AX12_ANGLE_PORTE_AVANT_DROITE_OUVERTE); |
antbig | 12:14729d584500 | 28 | AX12_processChange(); |
antbig | 12:14729d584500 | 29 | break; |
antbig | 12:14729d584500 | 30 | case 101://Fermer les portes avant |
antbig | 12:14729d584500 | 31 | AX12_setGoal(AX12_ID_PORTE_AVANT_GAUCHE, AX12_ANGLE_PORTE_AVANT_GAUCHE_FERMER); |
antbig | 12:14729d584500 | 32 | AX12_setGoal(AX12_ID_PORTE_AVANT_DROITE, AX12_ANGLE_PORTE_AVANT_DROITE_FERMER); |
antbig | 12:14729d584500 | 33 | AX12_processChange(); |
antbig | 12:14729d584500 | 34 | break; |
antbig | 12:14729d584500 | 35 | |
antbig | 12:14729d584500 | 36 | case 102://Remonter le peigne |
antbig | 12:14729d584500 | 37 | AX12_setGoal(AX12_ID_PEIGNE, AX12_ANGLE_PEIGNE_UP); |
ClementBreteau | 14:c8fc06c4887f | 38 | SendRawId(0x123); |
antbig | 12:14729d584500 | 39 | AX12_processChange(); |
antbig | 12:14729d584500 | 40 | break; |
antbig | 12:14729d584500 | 41 | case 103://Descendre le peigne |
antbig | 12:14729d584500 | 42 | AX12_setGoal(AX12_ID_PEIGNE, AX12_ANGLE_PEIGNE_DOWN); |
antbig | 12:14729d584500 | 43 | AX12_processChange(); |
antbig | 12:14729d584500 | 44 | break; |
antbig | 12:14729d584500 | 45 | |
antbig | 12:14729d584500 | 46 | case 104://Monter le support ventouse haut |
antbig | 12:14729d584500 | 47 | AX12_setGoal(AX12_ID_VENTOUSE, AX12_ANGLE_VENTOUSE_UP); |
antbig | 12:14729d584500 | 48 | AX12_processChange(); |
antbig | 12:14729d584500 | 49 | break; |
antbig | 12:14729d584500 | 50 | case 105://Descendre le support ventouse haut |
antbig | 12:14729d584500 | 51 | AX12_setGoal(AX12_ID_VENTOUSE, AX12_ANGLE_VENTOUSE_DOWN); |
antbig | 12:14729d584500 | 52 | AX12_processChange(); |
antbig | 12:14729d584500 | 53 | break; |
antbig | 12:14729d584500 | 54 | case 106://Remonter le support du cone arriere |
antbig | 12:14729d584500 | 55 | AX12_setGoal(AX12_ID_CONE, AX12_ANGLE_CONE_INSIDE); |
antbig | 12:14729d584500 | 56 | AX12_processChange(); |
antbig | 12:14729d584500 | 57 | break; |
antbig | 12:14729d584500 | 58 | case 107://Descendre le support du cone arriere |
antbig | 12:14729d584500 | 59 | AX12_setGoal(AX12_ID_CONE, AX12_ANGLE_CONE_OUTSIDE); |
antbig | 12:14729d584500 | 60 | AX12_processChange(); |
antbig | 12:14729d584500 | 61 | break; |
antbig | 12:14729d584500 | 62 | |
antbig | 8:0edc7dfb7f7e | 63 | case 110://Ouvrir la pince arrière haute |
antbig | 8:0edc7dfb7f7e | 64 | AX12_setGoal(AX12_ID_PINCE_ARRIERE_HAUTE_GAUCHE, 205); |
antbig | 8:0edc7dfb7f7e | 65 | AX12_setGoal(AX12_ID_PINCE_ARRIERE_HAUTE_DROITE, 95); |
antbig | 8:0edc7dfb7f7e | 66 | AX12_processChange(); |
antbig | 8:0edc7dfb7f7e | 67 | break; |
antbig | 8:0edc7dfb7f7e | 68 | case 111://Fermer la pince arrière haute |
antbig | 8:0edc7dfb7f7e | 69 | AX12_setGoal(AX12_ID_PINCE_ARRIERE_HAUTE_GAUCHE, 145); |
antbig | 8:0edc7dfb7f7e | 70 | AX12_setGoal(AX12_ID_PINCE_ARRIERE_HAUTE_DROITE, 155); |
antbig | 8:0edc7dfb7f7e | 71 | AX12_processChange(); |
antbig | 12:14729d584500 | 72 | /*waitingAckID = AX12_ID_PINCE_ARRIERE_HAUTE_DROITE; |
antbig | 12:14729d584500 | 73 | waitingAckFrom = SERVO_AX12_DONE;*/ |
antbig | 8:0edc7dfb7f7e | 74 | break; |
antbig | 9:d0042422d95a | 75 | |
antbig | 8:0edc7dfb7f7e | 76 | case 112://Ouvrir la pince arrière basse |
antbig | 12:14729d584500 | 77 | AX12_setGoal(AX12_ID_PINCE_ARRIERE_BASSE_GAUCHE, 215); |
antbig | 12:14729d584500 | 78 | AX12_setGoal(AX12_ID_PINCE_ARRIERE_BASSE_DROITE, 85); |
antbig | 9:d0042422d95a | 79 | AX12_processChange(); |
antbig | 8:0edc7dfb7f7e | 80 | break; |
antbig | 8:0edc7dfb7f7e | 81 | case 113://Fermer la pince arrière basse |
antbig | 9:d0042422d95a | 82 | AX12_setGoal(AX12_ID_PINCE_ARRIERE_BASSE_GAUCHE, 145); |
antbig | 9:d0042422d95a | 83 | AX12_setGoal(AX12_ID_PINCE_ARRIERE_BASSE_DROITE, 155); |
antbig | 9:d0042422d95a | 84 | AX12_processChange(); |
antbig | 12:14729d584500 | 85 | /* waitingAckID = AX12_ID_PINCE_ARRIERE_BASSE_DROITE; |
antbig | 12:14729d584500 | 86 | waitingAckFrom = SERVO_AX12_DONE;*/ |
antbig | 9:d0042422d95a | 87 | break; |
antbig | 8:0edc7dfb7f7e | 88 | |
antbig | 8:0edc7dfb7f7e | 89 | case 114://Ouvrir les portes arrières |
antbig | 8:0edc7dfb7f7e | 90 | AX12_setGoal(AX12_ID_PORTE_ARRIERE_GAUCHE, 250); |
antbig | 8:0edc7dfb7f7e | 91 | AX12_setGoal(AX12_ID_PORTE_ARRIERE_DROITE, 50); |
antbig | 8:0edc7dfb7f7e | 92 | AX12_processChange(); |
antbig | 8:0edc7dfb7f7e | 93 | break; |
antbig | 8:0edc7dfb7f7e | 94 | case 115://Fermer les portes arrière |
antbig | 12:14729d584500 | 95 | //AX12_setGoal(AX12_ID_PORTE_ARRIERE_GAUCHE, 145); |
antbig | 12:14729d584500 | 96 | //AX12_setGoal(AX12_ID_PORTE_ARRIERE_DROITE, 155); |
antbig | 12:14729d584500 | 97 | AX12_setGoal(AX12_ID_PORTE_ARRIERE_GAUCHE, 142); |
antbig | 12:14729d584500 | 98 | AX12_setGoal(AX12_ID_PORTE_ARRIERE_DROITE, 158); |
antbig | 12:14729d584500 | 99 | AX12_processChange(); |
antbig | 12:14729d584500 | 100 | //waitingAckID = AX12_ID_PORTE_ARRIERE_DROITE; |
antbig | 12:14729d584500 | 101 | //waitingAckFrom = SERVO_AX12_DONE; |
antbig | 12:14729d584500 | 102 | break; |
antbig | 12:14729d584500 | 103 | |
antbig | 12:14729d584500 | 104 | case 120://Activer les pompes |
antbig | 12:14729d584500 | 105 | AX12_setGoal(AX12_ID_VENTOUSE, AX12_ANGLE_VENTOUSE_UP,AX12_SPEED_VENTOUSE); |
antbig | 8:0edc7dfb7f7e | 106 | AX12_processChange(); |
antbig | 12:14729d584500 | 107 | |
antbig | 12:14729d584500 | 108 | |
antbig | 12:14729d584500 | 109 | msgTx.id=POMPE_PWM; |
antbig | 12:14729d584500 | 110 | msgTx.format=CANStandard; |
antbig | 12:14729d584500 | 111 | msgTx.type=CANData; |
antbig | 12:14729d584500 | 112 | msgTx.len=6; |
antbig | 12:14729d584500 | 113 | |
antbig | 12:14729d584500 | 114 | // x sur 2 octets |
antbig | 12:14729d584500 | 115 | msgTx.data[0]=(unsigned char)POMPES_PWM; |
antbig | 12:14729d584500 | 116 | msgTx.data[1]=(unsigned char)POMPES_PWM; |
antbig | 12:14729d584500 | 117 | msgTx.data[2]=(unsigned char)POMPES_PWM; |
antbig | 12:14729d584500 | 118 | msgTx.data[3]=(unsigned char)POMPES_PWM; |
antbig | 12:14729d584500 | 119 | msgTx.data[4]=(unsigned char)POMPES_PWM; |
antbig | 12:14729d584500 | 120 | msgTx.data[5]=(unsigned char)POMPES_PWM; |
antbig | 12:14729d584500 | 121 | |
antbig | 12:14729d584500 | 122 | can1.write(msgTx); |
antbig | 8:0edc7dfb7f7e | 123 | break; |
antbig | 12:14729d584500 | 124 | case 121://Désactiver les pompes |
antbig | 12:14729d584500 | 125 | msgTx.id=POMPE_PWM; |
antbig | 12:14729d584500 | 126 | msgTx.format=CANStandard; |
antbig | 12:14729d584500 | 127 | msgTx.type=CANData; |
antbig | 12:14729d584500 | 128 | msgTx.len=6; |
antbig | 12:14729d584500 | 129 | |
antbig | 12:14729d584500 | 130 | // x sur 2 octets |
antbig | 12:14729d584500 | 131 | msgTx.data[0]=(unsigned char)0; |
antbig | 12:14729d584500 | 132 | msgTx.data[1]=(unsigned char)0; |
antbig | 12:14729d584500 | 133 | msgTx.data[2]=(unsigned char)0; |
antbig | 12:14729d584500 | 134 | msgTx.data[3]=(unsigned char)0; |
antbig | 12:14729d584500 | 135 | msgTx.data[4]=(unsigned char)0; |
antbig | 12:14729d584500 | 136 | msgTx.data[5]=(unsigned char)0; |
antbig | 12:14729d584500 | 137 | |
antbig | 12:14729d584500 | 138 | can1.write(msgTx); |
antbig | 12:14729d584500 | 139 | break; |
antbig | 12:14729d584500 | 140 | |
antbig | 12:14729d584500 | 141 | case 10://Désactiver le stop |
antbig | 12:14729d584500 | 142 | isStopEnable = 0; |
antbig | 12:14729d584500 | 143 | break; |
antbig | 12:14729d584500 | 144 | case 11://Activer le stop |
antbig | 12:14729d584500 | 145 | isStopEnable = 1; |
antbig | 12:14729d584500 | 146 | break; |
antbig | 12:14729d584500 | 147 | case 20://Désactiver l'asservissement |
antbig | 12:14729d584500 | 148 | setAsservissementEtat(0); |
antbig | 12:14729d584500 | 149 | break; |
antbig | 12:14729d584500 | 150 | case 21://Activer l'asservissement |
antbig | 12:14729d584500 | 151 | setAsservissementEtat(1); |
antbig | 12:14729d584500 | 152 | break; |
antbig | 12:14729d584500 | 153 | |
antbig | 12:14729d584500 | 154 | case 22://Changer la vitesse du robot |
antbig | 12:14729d584500 | 155 | SendSpeed(speed,(unsigned short)angle); |
antbig | 12:14729d584500 | 156 | break; |
antbig | 12:14729d584500 | 157 | |
antbig | 12:14729d584500 | 158 | case 30://Action tempo |
antbig | 12:14729d584500 | 159 | wait_ms(speed); |
antbig | 12:14729d584500 | 160 | break; |
antbig | 12:14729d584500 | 161 | |
ClementBreteau | 14:c8fc06c4887f | 162 | case 40: // demande au telemetre la position d'un objet |
ClementBreteau | 14:c8fc06c4887f | 163 | //SendRawId(TELEMETRE_RECHERCHE_OBJET); |
ClementBreteau | 14:c8fc06c4887f | 164 | waitingAckID = ACKNOWLEDGE_TELEMETRE; |
ClementBreteau | 14:c8fc06c4887f | 165 | waitingAckFrom = 0; |
ClementBreteau | 14:c8fc06c4887f | 166 | modeTelemetre =1; |
ClementBreteau | 14:c8fc06c4887f | 167 | |
antbig | 12:14729d584500 | 168 | case 130://Lancer mouvement de sortie de la zone de départ |
antbig | 12:14729d584500 | 169 | SendRawId(ACTION_BIG_DEMARRAGE); |
antbig | 12:14729d584500 | 170 | waitingAckID = ACTION_BIG_DEMARRAGE; |
antbig | 12:14729d584500 | 171 | waitingAckFrom = INSTRUCTION_END_MOTEUR; |
antbig | 12:14729d584500 | 172 | break; |
antbig | 12:14729d584500 | 173 | |
antbig | 0:ad97421fb1fb | 174 | default: |
antbig | 0:ad97421fb1fb | 175 | return 0;//L'action n'existe pas, il faut utiliser le CAN |
antbig | 0:ad97421fb1fb | 176 | |
antbig | 0:ad97421fb1fb | 177 | } |
antbig | 0:ad97421fb1fb | 178 | return 1;//L'action est spécifique. |
antbig | 0:ad97421fb1fb | 179 | |
antbig | 0:ad97421fb1fb | 180 | } |
antbig | 0:ad97421fb1fb | 181 | |
antbig | 0:ad97421fb1fb | 182 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 183 | /* FUNCTION NAME: initRobot */ |
antbig | 0:ad97421fb1fb | 184 | /* DESCRIPTION : initialiser le robot */ |
antbig | 0:ad97421fb1fb | 185 | /****************************************************************************************/ |
antbig | 9:d0042422d95a | 186 | void initRobot(void) |
antbig | 9:d0042422d95a | 187 | { |
antbig | 9:d0042422d95a | 188 | //Enregistrement de tous les AX12 présent sur la carte |
antbig | 8:0edc7dfb7f7e | 189 | AX12_register(5, AX12_SERIAL2); |
antbig | 8:0edc7dfb7f7e | 190 | AX12_register(18, AX12_SERIAL2); |
antbig | 8:0edc7dfb7f7e | 191 | AX12_register(13, AX12_SERIAL2); |
antbig | 12:14729d584500 | 192 | AX12_register(1, AX12_SERIAL1); |
antbig | 12:14729d584500 | 193 | AX12_register(11, AX12_SERIAL1); |
antbig | 12:14729d584500 | 194 | AX12_register(8, AX12_SERIAL1); |
antbig | 12:14729d584500 | 195 | AX12_register(7, AX12_SERIAL2); |
antbig | 9:d0042422d95a | 196 | |
antbig | 12:14729d584500 | 197 | //AX12_setGoal(AX12_ID_FUNNY_ACTION, AX12_ANGLE_FUNNY_ACTION_CLOSE,AX12_SPEED_FUNNY_ACTION); |
antbig | 12:14729d584500 | 198 | //AX12_processChange(); |
antbig | 11:ed13a480ddca | 199 | //runRobotTest(); |
antbig | 9:d0042422d95a | 200 | } |
antbig | 9:d0042422d95a | 201 | |
antbig | 9:d0042422d95a | 202 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 203 | /* FUNCTION NAME: initRobotActionneur */ |
antbig | 12:14729d584500 | 204 | /* DESCRIPTION : Initialiser la position des actionneurs du robot */ |
antbig | 12:14729d584500 | 205 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 206 | void initRobotActionneur(void) |
antbig | 12:14729d584500 | 207 | { |
antbig | 12:14729d584500 | 208 | doAction(110,0,0);//Ouverture pince arrière haute |
antbig | 12:14729d584500 | 209 | doAction(112,0,0);//Ouverture pince arrière basse |
antbig | 12:14729d584500 | 210 | doAction(114,0,0);//Ouverture porte arrière |
antbig | 12:14729d584500 | 211 | doAction(100,0,0);//Ouvrir les portes avant |
antbig | 12:14729d584500 | 212 | doAction(102,0,0);//Remonter le peigne |
antbig | 12:14729d584500 | 213 | doAction(106,0,0);//Remonter le support du cone arriere |
antbig | 12:14729d584500 | 214 | } |
antbig | 12:14729d584500 | 215 | |
antbig | 12:14729d584500 | 216 | /****************************************************************************************/ |
antbig | 9:d0042422d95a | 217 | /* FUNCTION NAME: runTest */ |
antbig | 9:d0042422d95a | 218 | /* DESCRIPTION : tester l'ensemble des actionneurs du robot */ |
antbig | 9:d0042422d95a | 219 | /****************************************************************************************/ |
antbig | 9:d0042422d95a | 220 | void runRobotTest(void) |
antbig | 9:d0042422d95a | 221 | { |
antbig | 12:14729d584500 | 222 | int waitTime = 500; |
antbig | 12:14729d584500 | 223 | |
antbig | 9:d0042422d95a | 224 | //Test des AX12 dans l'ordre |
antbig | 9:d0042422d95a | 225 | doAction(111,0,0);//Fermeture pince arrière haute |
antbig | 12:14729d584500 | 226 | wait_ms(waitTime); |
antbig | 9:d0042422d95a | 227 | doAction(110,0,0);//Ouverture pince arrière haute |
antbig | 12:14729d584500 | 228 | wait_ms(waitTime); |
antbig | 9:d0042422d95a | 229 | doAction(113,0,0);//Fermeture pince arrière basse |
antbig | 12:14729d584500 | 230 | wait_ms(waitTime); |
antbig | 9:d0042422d95a | 231 | doAction(112,0,0);//Ouverture pince arrière basse |
antbig | 12:14729d584500 | 232 | wait_ms(waitTime); |
antbig | 9:d0042422d95a | 233 | doAction(115,0,0);//Fermeture porte arrière |
antbig | 12:14729d584500 | 234 | wait_ms(waitTime); |
antbig | 9:d0042422d95a | 235 | doAction(114,0,0);//Ouverture porte arrière |
antbig | 12:14729d584500 | 236 | wait_ms(waitTime); |
antbig | 12:14729d584500 | 237 | doAction(101,0,0);//Fermer les portes avant |
antbig | 12:14729d584500 | 238 | wait_ms(waitTime); |
antbig | 12:14729d584500 | 239 | doAction(100,0,0);//Ouvrir les portes avant |
antbig | 12:14729d584500 | 240 | wait_ms(waitTime); |
antbig | 12:14729d584500 | 241 | doAction(103,0,0);//Descendre le peigne |
antbig | 12:14729d584500 | 242 | wait_ms(waitTime); |
antbig | 12:14729d584500 | 243 | doAction(102,0,0);//Remonter le peigne |
antbig | 0:ad97421fb1fb | 244 | } |
antbig | 3:19f2285a4757 | 245 | |
antbig | 4:88431b537477 | 246 | /****************************************************************************************/ |
antbig | 4:88431b537477 | 247 | /* FUNCTION NAME: SelectStrategy */ |
antbig | 4:88431b537477 | 248 | /* DESCRIPTION : Charger le fichier de stratégie correspondante à un id */ |
antbig | 4:88431b537477 | 249 | /* RETURN : 0=> Erreur, 1=> OK si le fichier existe */ |
antbig | 4:88431b537477 | 250 | /****************************************************************************************/ |
antbig | 4:88431b537477 | 251 | int SelectStrategy(unsigned char id) |
antbig | 4:88431b537477 | 252 | { |
antbig | 4:88431b537477 | 253 | switch(id) |
antbig | 4:88431b537477 | 254 | { |
antbig | 4:88431b537477 | 255 | case 1: |
antbig | 11:ed13a480ddca | 256 | strcpy(cheminFileStart,"/local/strat1.txt"); |
antbig | 11:ed13a480ddca | 257 | return FileExists(cheminFileStart); |
antbig | 11:ed13a480ddca | 258 | case 2: |
antbig | 11:ed13a480ddca | 259 | strcpy(cheminFileStart,"/local/strat2.txt"); |
antbig | 11:ed13a480ddca | 260 | return FileExists(cheminFileStart); |
antbig | 11:ed13a480ddca | 261 | case 3: |
antbig | 11:ed13a480ddca | 262 | strcpy(cheminFileStart,"/local/strat3.txt"); |
antbig | 11:ed13a480ddca | 263 | return FileExists(cheminFileStart); |
antbig | 12:14729d584500 | 264 | case 4: |
antbig | 12:14729d584500 | 265 | strcpy(cheminFileStart,"/local/strat4.txt"); |
antbig | 12:14729d584500 | 266 | return FileExists(cheminFileStart); |
antbig | 12:14729d584500 | 267 | case 5: |
antbig | 12:14729d584500 | 268 | strcpy(cheminFileStart,"/local/strat5.txt"); |
antbig | 12:14729d584500 | 269 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 270 | case 6: |
ClementBreteau | 14:c8fc06c4887f | 271 | strcpy(cheminFileStart,"/local/strat6.txt"); |
ClementBreteau | 14:c8fc06c4887f | 272 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 273 | case 7: |
ClementBreteau | 14:c8fc06c4887f | 274 | strcpy(cheminFileStart,"/local/strat7.txt"); |
ClementBreteau | 14:c8fc06c4887f | 275 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 276 | case 8: |
ClementBreteau | 14:c8fc06c4887f | 277 | strcpy(cheminFileStart,"/local/strat8.txt"); |
ClementBreteau | 14:c8fc06c4887f | 278 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 279 | case 9: |
ClementBreteau | 14:c8fc06c4887f | 280 | strcpy(cheminFileStart,"/local/strat9.txt"); |
ClementBreteau | 14:c8fc06c4887f | 281 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 282 | case 10: |
ClementBreteau | 14:c8fc06c4887f | 283 | strcpy(cheminFileStart,"/local/strat10.txt"); |
ClementBreteau | 14:c8fc06c4887f | 284 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 285 | |
ClementBreteau | 14:c8fc06c4887f | 286 | // |
ClementBreteau | 14:c8fc06c4887f | 287 | case 0x10: |
ClementBreteau | 14:c8fc06c4887f | 288 | strcpy(cheminFileStart,"/local/moteur.txt"); |
ClementBreteau | 14:c8fc06c4887f | 289 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 290 | case 0x11: |
ClementBreteau | 14:c8fc06c4887f | 291 | strcpy(cheminFileStart,"/local/moteur2.txt"); |
ClementBreteau | 14:c8fc06c4887f | 292 | return FileExists(cheminFileStart); |
ClementBreteau | 14:c8fc06c4887f | 293 | |
antbig | 11:ed13a480ddca | 294 | default: |
antbig | 12:14729d584500 | 295 | strcpy(cheminFileStart,"/local/strat1.txt"); |
antbig | 11:ed13a480ddca | 296 | return 0; |
antbig | 4:88431b537477 | 297 | } |
antbig | 4:88431b537477 | 298 | } |
antbig | 4:88431b537477 | 299 | |
antbig | 12:14729d584500 | 300 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 301 | /* FUNCTION NAME: needToStop */ |
antbig | 12:14729d584500 | 302 | /* DESCRIPTION : Savoir si il faut autoriser le stop du robot via balise */ |
antbig | 12:14729d584500 | 303 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 304 | unsigned char needToStop(void) |
antbig | 12:14729d584500 | 305 | { |
antbig | 12:14729d584500 | 306 | return isStopEnable; |
antbig | 12:14729d584500 | 307 | } |
antbig | 12:14729d584500 | 308 | |
antbig | 12:14729d584500 | 309 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 310 | /* FUNCTION NAME: doBeforeEndAction */ |
antbig | 12:14729d584500 | 311 | /* DESCRIPTION : Terminer les actions du robot 1s avant la fin du match */ |
antbig | 12:14729d584500 | 312 | /****************************************************************************************/ |
antbig | 12:14729d584500 | 313 | void doBeforeEndAction(void) |
antbig | 12:14729d584500 | 314 | { |
antbig | 12:14729d584500 | 315 | doAction(110,0,0);//Ouverture pince arrière haute |
antbig | 12:14729d584500 | 316 | doAction(112,0,0);//Ouverture pince arrière basse |
antbig | 12:14729d584500 | 317 | doAction(114,0,0);//Ouverture porte arrière |
antbig | 12:14729d584500 | 318 | doAction(100,0,0);//Ouvrir les portes avant |
antbig | 12:14729d584500 | 319 | doAction(102,0,0);//Remonter le peigne |
antbig | 12:14729d584500 | 320 | } |
antbig | 12:14729d584500 | 321 | |
antbig | 3:19f2285a4757 | 322 | #endif |