carte_strategie_2019
Dependencies: mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac
Asservissement/Asservissement.h
- Committer:
- kyxstark
- Date:
- 2019-06-01
- Revision:
- 91:42ae63e5daf5
- Parent:
- 73:bf4d6d9db13b
File content as of revision 91:42ae63e5daf5:
#ifndef CRAC_ASSERVISSEMENT #define CRAC_ASSERVISSEMENT #include "global.h" void Send2Short(unsigned short id, unsigned short d1, unsigned short d2); void SendMsgCan(unsigned short id, unsigned char* data, int len); void SendCharCan(unsigned short id, unsigned char data); /*********************************************************************************************************/ /* FUNCTION NAME: SendRawId */ /* DESCRIPTION : Envoie un message sans donnée, c'est-à-dire contenant uniquement un ID, sur le bus CAN */ /*********************************************************************************************************/ void SendRawId (unsigned short id); /*********************************************************************************************/ /* FUNCTION NAME: SendAck */ /* DESCRIPTION : Envoyer un acknowledge */ /*********************************************************************************************/ void SendAck(unsigned short id, unsigned short from); /*********************************************************************************************/ /* FUNCTION NAME: GoToPosition */ /* DESCRIPTION : Transmission CAN correspondant à un asservissement en position (x,y,theta) */ /*********************************************************************************************/ void GoToPosition (unsigned short x,unsigned short y,signed short theta,signed char sens); /****************************************************************************************/ /* FUNCTION NAME: Rotate */ /* DESCRIPTION : Transmission CAN correspondant à une rotation */ /****************************************************************************************/ void Rotate (signed short angle); /*********************************************************************************************/ /* FUNCTION NAME: GoStraight */ /* DESCRIPTION : Transmission CAN correspondant à une ligne droite, avec ou sans recalage */ /* recalage : 0 => pas de recalage */ /* 1 => recalage en X */ /* 2 => Recalage en Y */ /* newValue : Uniquement en cas de recalage, indique la nouvelle valeur de l'odo */ /* isEnchainement : Indique si il faut executer l'instruction en enchainement */ /* 0 => non */ /* 1 => oui */ /* 2 => dernière instruction de l'enchainement */ /*********************************************************************************************/ void GoStraight (signed short distance,unsigned char recalage, unsigned short newValue, unsigned char isEnchainement); /********************************************************************************************/ /* FUNCTION NAME: BendRadius */ /* DESCRIPTION : Transmission CAN correspondant à un rayon de courbure */ /********************************************************************************************/ void BendRadius (unsigned short rayon,signed short angle,signed char sens, unsigned char enchainement); void SetOdometrie (unsigned short canId, unsigned short x,unsigned short y,signed short theta); /****************************************************************************************/ /* FUNCTION NAME: setAsservissementEtat */ /* DESCRIPTION : Activer ou désactiver l'asservissement */ /****************************************************************************************/ void setAsservissementEtat(unsigned char enable); /****************************************************************************************/ /* FUNCTION NAME: SendSpeed */ /* DESCRIPTION : Envoie un asservissement paramètre retournant à une vitesse */ /****************************************************************************************/ void SendSpeed (unsigned short vitesse); void SendSpeedAccelDecel (unsigned short vitesse, unsigned short acceleration,unsigned short deceleration); void SendAccel(unsigned short acceleration,unsigned short deceleration); void courbeBezier(int nbCourbes, short P1[][2], short C1[][2], short C2[][2], char sens); #endif