code avec modifs, programme mit dans les robots pour les derniers matchs

Dependencies:   mbed SerialHalfDuplex SDFileSystem liaison_Bluetooth ident_crac DISCO-F469NI_portrait

Committer:
goldmas
Date:
Sat Jul 17 11:07:17 2021 +0000
Revision:
38:9d6a3ccc0582
Parent:
21:d137ec53c3a9
Dernier code de la coupe de fracne 2021

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gabrieltetar 0:41cc45429aba 1 #ifndef CRAC_ASSERVISSEMENT
gabrieltetar 0:41cc45429aba 2 #define CRAC_ASSERVISSEMENT
gabrieltetar 0:41cc45429aba 3
gabrieltetar 0:41cc45429aba 4 void Send2Short(unsigned short id, unsigned short d1, unsigned short d2);
gabrieltetar 0:41cc45429aba 5 void SendMsgCan(unsigned short id, unsigned char* data, int len);
gabrieltetar 0:41cc45429aba 6 void SendCharCan(unsigned short id, unsigned char data);
gabrieltetar 0:41cc45429aba 7 /*********************************************************************************************************/
gabrieltetar 0:41cc45429aba 8 /* FUNCTION NAME: SendRawId */
gabrieltetar 0:41cc45429aba 9 /* DESCRIPTION : Envoie un message sans donnée, c'est-à-dire contenant uniquement un ID, sur le bus CAN */
gabrieltetar 0:41cc45429aba 10 /*********************************************************************************************************/
gabrieltetar 0:41cc45429aba 11 void SendRawId (unsigned short id);
gabrieltetar 0:41cc45429aba 12
gabrieltetar 0:41cc45429aba 13 /*********************************************************************************************/
gabrieltetar 0:41cc45429aba 14 /* FUNCTION NAME: SendAck */
gabrieltetar 0:41cc45429aba 15 /* DESCRIPTION : Envoyer un acknowledge */
gabrieltetar 0:41cc45429aba 16 /*********************************************************************************************/
gabrieltetar 0:41cc45429aba 17 void SendAck(unsigned short id, unsigned short from);
gabrieltetar 0:41cc45429aba 18
gabrieltetar 0:41cc45429aba 19 /*********************************************************************************************/
gabrieltetar 0:41cc45429aba 20 /* FUNCTION NAME: GoToPosition */
gabrieltetar 0:41cc45429aba 21 /* DESCRIPTION : Transmission CAN correspondant à un asservissement en position (x,y,theta) */
gabrieltetar 0:41cc45429aba 22 /*********************************************************************************************/
gabrieltetar 0:41cc45429aba 23
gabrieltetar 0:41cc45429aba 24 void GoToPosition (unsigned short x,unsigned short y,signed short theta,signed char sens);
gabrieltetar 0:41cc45429aba 25
gabrieltetar 0:41cc45429aba 26 /****************************************************************************************/
gabrieltetar 0:41cc45429aba 27 /* FUNCTION NAME: Rotate */
gabrieltetar 0:41cc45429aba 28 /* DESCRIPTION : Transmission CAN correspondant à une rotation */
gabrieltetar 0:41cc45429aba 29 /****************************************************************************************/
gabrieltetar 0:41cc45429aba 30
gabrieltetar 0:41cc45429aba 31 void Rotate (signed short angle);
gabrieltetar 0:41cc45429aba 32
gabrieltetar 0:41cc45429aba 33 /*********************************************************************************************/
gabrieltetar 0:41cc45429aba 34 /* FUNCTION NAME: GoStraight */
gabrieltetar 0:41cc45429aba 35 /* DESCRIPTION : Transmission CAN correspondant à une ligne droite, avec ou sans recalage */
gabrieltetar 0:41cc45429aba 36 /* recalage : 0 => pas de recalage */
gabrieltetar 0:41cc45429aba 37 /* 1 => recalage en X */
gabrieltetar 0:41cc45429aba 38 /* 2 => Recalage en Y */
gabrieltetar 0:41cc45429aba 39 /* newValue : Uniquement en cas de recalage, indique la nouvelle valeur de l'odo */
gabrieltetar 0:41cc45429aba 40 /* isEnchainement : Indique si il faut executer l'instruction en enchainement */
gabrieltetar 0:41cc45429aba 41 /* 0 => non */
gabrieltetar 0:41cc45429aba 42 /* 1 => oui */
gabrieltetar 0:41cc45429aba 43 /* 2 => dernière instruction de l'enchainement */
gabrieltetar 0:41cc45429aba 44 /*********************************************************************************************/
gabrieltetar 0:41cc45429aba 45 void GoStraight (signed short distance,unsigned char recalage, unsigned short newValue, unsigned char isEnchainement);
gabrieltetar 0:41cc45429aba 46
gabrieltetar 0:41cc45429aba 47 /********************************************************************************************/
gabrieltetar 0:41cc45429aba 48 /* FUNCTION NAME: BendRadius */
gabrieltetar 0:41cc45429aba 49 /* DESCRIPTION : Transmission CAN correspondant à un rayon de courbure */
gabrieltetar 0:41cc45429aba 50 /********************************************************************************************/
gabrieltetar 0:41cc45429aba 51 void BendRadius (unsigned short rayon,signed short angle,signed char sens, unsigned char enchainement);
gabrieltetar 0:41cc45429aba 52
gabrieltetar 0:41cc45429aba 53 void SetOdometrie (unsigned short canId, unsigned short x,unsigned short y,signed short theta);
gabrieltetar 0:41cc45429aba 54
gabrieltetar 0:41cc45429aba 55 /****************************************************************************************/
gabrieltetar 0:41cc45429aba 56 /* FUNCTION NAME: setAsservissementEtat */
gabrieltetar 0:41cc45429aba 57 /* DESCRIPTION : Activer ou désactiver l'asservissement */
gabrieltetar 0:41cc45429aba 58 /****************************************************************************************/
gabrieltetar 0:41cc45429aba 59 void setAsservissementEtat(unsigned char enable);
gabrieltetar 0:41cc45429aba 60
gabrieltetar 0:41cc45429aba 61 /****************************************************************************************/
gabrieltetar 0:41cc45429aba 62 /* FUNCTION NAME: SendSpeed */
gabrieltetar 0:41cc45429aba 63 /* DESCRIPTION : Envoie un asservissement paramètre retournant à une vitesse */
gabrieltetar 0:41cc45429aba 64 /****************************************************************************************/
gabrieltetar 0:41cc45429aba 65 void SendSpeed (unsigned short vitesse);
gabrieltetar 0:41cc45429aba 66 void SendSpeedAccelDecel (unsigned short vitesse, unsigned short acceleration,unsigned short deceleration);
gabrieltetar 0:41cc45429aba 67 void SendAccel(unsigned short acceleration,unsigned short deceleration);
gabrieltetar 0:41cc45429aba 68 void courbeBezier(int nbCourbes, short P1[][2], short C1[][2], short C2[][2], char sens);
gabrieltetar 0:41cc45429aba 69 #endif