Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
homemadeSequence.h
00001 /** 00002 * homemadeSequence.h 00003 * 00004 * Created on: Mar 03, 2015 00005 * Author: salco 00006 */ 00007 00008 #ifndef HOMEMADESEQUENCE_H_ 00009 #define HOMEMADESEQUENCE_H_ 00010 00011 00012 00013 00014 #include "debug.h" 00015 #include "mbed.h" 00016 #include "settingDebug.h" 00017 00018 class homemadeSequence 00019 { 00020 ////////////////////////////// 00021 // 00 - Nothing // 00022 //X01 - Calibration(milieu) // 00023 //X02 - Debout // 00024 //X03 - Coucher // 00025 //X04 - Tourne Gauche // 00026 //X05 - Tourne Droite // 00027 // 06 - Marche // 00028 // 07 - Recule // 00029 // 08 - Repositioner legs // 00030 // 09 - Crabe Gauche // Dont use Crabe because it's really anoying 00031 // 10 - Crabe Droite // Dont use Crabe because it's really anoying 00032 // 11 - Position naturel // 00033 ////////////////////////////// 00034 char m_SequenceChosen; 00035 char m_idFrame; 00036 00037 //Timer delaisNextSeq;//move to movement.h 00038 int delaisNeed; 00039 unsigned char m_posLeg[4]; 00040 unsigned char timeSequence[8]; 00041 char m_idLegUse; // pour seqRepositioner 00042 00043 /* 00044 * Fonction contenant les sequences pour faire monter et decendre le robot 00045 */ 00046 void seqUpDown(bool downUP,char idOperation,char idLeg); 00047 /* 00048 * Fonction contenant les sequences pour faire tourner le robot 00049 */ 00050 void seqTurn(bool leftRIGHT,char idOperation,char idLeg); 00051 /* 00052 * Fonction contenant les sequences pour faire marcher et reculer le robot 00053 */ 00054 void seqWalk(bool backFRONT,char idOperation,char idLeg); 00055 /* 00056 * Fonction contenant les sequences pour faire Repositioner le robot 00057 */ 00058 void seqRepositioner(char idOperation,char idLeg); 00059 /* 00060 * Fonction contenant les sequences pour faire marcher en crabe le robot 00061 */ 00062 void seqCrabe(bool leftRIGHT,char idOperation,char idLeg); 00063 /* 00064 * Fonction contenant les sequences pour positioner en default le robot 00065 */ 00066 void defaultPosition(char idLeg); 00067 00068 /* 00069 * Fonction remise a la valeur par defaut le Délais entre les sequences 00070 */ 00071 int patchDelais(char idMode); 00072 00073 public: 00074 /* 00075 * Constructeur de la class 00076 */ 00077 homemadeSequence(); 00078 /* 00079 * Destructeur de la class 00080 */ 00081 ~homemadeSequence(); 00082 /* 00083 * set_Sequence 00084 */ 00085 void set_Sequence(char idSequence) { 00086 m_SequenceChosen = idSequence; 00087 m_idFrame = 1; 00088 00089 //delaisNeed=patchDelais(idSequence); 00090 } 00091 char get_Sequence(void) { 00092 return m_SequenceChosen; 00093 } 00094 void set_leg(char idLeg){m_idLegUse = idLeg;} 00095 int get_msTime(char idLeg){ 00096 int result = timeSequence[idLeg-1]; 00097 00098 debug(DEBUG_HOMEMADE_GETTIME,"\n\r idLeg:%i \n\r timeSequence:%i\n\r delais:%i\n\r delais plus define:%i",idLeg,result,delaisNeed,(((result==255)? DELAITESTE/2:result*10)*DEBUG_HOMEMADESEQ_PERCENT_DELAIS)/100); 00099 return ((((result==255)? DELAITESTE/2:result*10)*DEBUG_HOMEMADESEQ_PERCENT_DELAIS)/100); //ici je crois quil faut metre le pourcentage vitesse setter avec un define 00100 } 00101 int get_delaisNeed_Ms(){return ((delaisNeed*DEBUG_HOMEMADESEQ_PERCENT_DELAIS_PAUSE)/100);} 00102 unsigned char* get_frame(/*char idSequence,*/char idOperation,char idLeg); 00103 unsigned char* get_frame(/*char idSequence,char idOperation,*/char idLeg); 00104 unsigned char get_frame(){return m_idFrame;} 00105 void set_frameID(char position) {m_idFrame = position;}; 00106 bool next_frame(void); //return true if you are not at the end 00107 bool prev_frame(void); //return true if you are not at the begining 00108 }; 00109 #endif /* HOMEMADESEQUENCE_H_ */
Generated on Tue Jul 12 2022 19:04:22 by
1.7.2