Alexandre Salconi-Denis
/
ProjetOctopode
Programme de contrôle de l'octopode 4DOF, Theraphosa-Salconi.
CtrlBridge
- fonction quelquonque pour communiquer avec les module
- fonction quelquonque pour faire des recherche dans les module dispo
- autre fonction pour jouer avec MemRegistre
Version 1.2.0
- Ajout d'un mode de simulation pour tester le code avec seulement un contrôleur stm32
directive.h@38:57d5f36a0333, 2015-10-05 (annotated)
- Committer:
- salco
- Date:
- Mon Oct 05 23:46:11 2015 +0000
- Revision:
- 38:57d5f36a0333
- Parent:
- 35:d81f6b927932
- Child:
- 39:34d7802e8d15
analise du labirinte pas fini pas implementer mais le plus gros de la carcasse est mont? reste a faire les point technique
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
salco | 2:4c5b0f6d0a6b | 1 | /** |
salco | 35:d81f6b927932 | 2 | * @file directive.h |
salco | 2:4c5b0f6d0a6b | 3 | * @brief Cette classe est le modele des 3 taches de controle. |
salco | 2:4c5b0f6d0a6b | 4 | * @author Salco |
salco | 2:4c5b0f6d0a6b | 5 | * @version 2.00 |
salco | 2:4c5b0f6d0a6b | 6 | * @date 11 mars 2015 |
salco | 2:4c5b0f6d0a6b | 7 | */ |
salco | 2:4c5b0f6d0a6b | 8 | #ifndef DIRECTIVE_H |
salco | 2:4c5b0f6d0a6b | 9 | #define DIRECTIVE_H |
salco | 2:4c5b0f6d0a6b | 10 | |
salco | 19:0ac80045ba4c | 11 | #define DEBUG_DIRECTIVE_TEST 1 |
salco | 28:ac5c6350ed9a | 12 | #define DEBUG_DIRECTIVE_LABYRINTH 1 |
salco | 28:ac5c6350ed9a | 13 | |
salco | 28:ac5c6350ed9a | 14 | |
salco | 28:ac5c6350ed9a | 15 | #define mvToADC(value)((value*1.023)/5) |
salco | 28:ac5c6350ed9a | 16 | #define ADCTomv(value)((value*5)/1.023) |
salco | 28:ac5c6350ed9a | 17 | #define ultrasonicToInch(value)(ADCTomv(value)/9.8) |
salco | 28:ac5c6350ed9a | 18 | |
salco | 28:ac5c6350ed9a | 19 | #define mvToInch(value)(value/9.8) |
salco | 28:ac5c6350ed9a | 20 | |
salco | 28:ac5c6350ed9a | 21 | |
salco | 19:0ac80045ba4c | 22 | |
salco | 3:e0d6e081a9d3 | 23 | #include "mbed.h" |
salco | 19:0ac80045ba4c | 24 | #include "debug.h" |
salco | 2:4c5b0f6d0a6b | 25 | #include "source/Task/TTask.h" |
salco | 3:e0d6e081a9d3 | 26 | #include "Motrice/mouvement.h" |
salco | 28:ac5c6350ed9a | 27 | #include <stdlib.h> /* srand, rand */ |
salco | 38:57d5f36a0333 | 28 | #include <list> |
salco | 28:ac5c6350ed9a | 29 | #include <time.h> /* time */ |
salco | 28:ac5c6350ed9a | 30 | #include "labyrinthe.h" |
salco | 35:d81f6b927932 | 31 | #include "settingDebug.h" |
salco | 2:4c5b0f6d0a6b | 32 | |
salco | 28:ac5c6350ed9a | 33 | ////////////////////////////// |
salco | 28:ac5c6350ed9a | 34 | // 00 - Nothing // |
salco | 28:ac5c6350ed9a | 35 | //X01 - Calibration(milieu) // |
salco | 28:ac5c6350ed9a | 36 | //X02 - Debout // |
salco | 28:ac5c6350ed9a | 37 | //X03 - Coucher // |
salco | 28:ac5c6350ed9a | 38 | //X04 - Tourne Gauche // |
salco | 28:ac5c6350ed9a | 39 | //X05 - Tourne Droite // |
salco | 28:ac5c6350ed9a | 40 | // 06 - Marche // |
salco | 28:ac5c6350ed9a | 41 | // 07 - Recule // |
salco | 28:ac5c6350ed9a | 42 | // 08 - Repositioner legs // |
salco | 28:ac5c6350ed9a | 43 | // 09 - Crabe Gauche // Dont use Crabe because it's really anoying |
salco | 28:ac5c6350ed9a | 44 | // 10 - Crabe Droite // Dont use Crabe because it's really anoying |
salco | 28:ac5c6350ed9a | 45 | // 11 - Position naturel // |
salco | 28:ac5c6350ed9a | 46 | ////////////////////////////// |
salco | 2:4c5b0f6d0a6b | 47 | class Directive : public TTask |
salco | 2:4c5b0f6d0a6b | 48 | { |
salco | 27:ea60d12dccdf | 49 | //CtrlBridge* m_CtrlBridge; |
salco | 3:e0d6e081a9d3 | 50 | Faculter_motrice *ctrDesPattes; |
salco | 27:ea60d12dccdf | 51 | /*Serial*//*Raw*/Serial *ssc32; |
salco | 27:ea60d12dccdf | 52 | string m_capteurUltrasonic,m_capteurIR,m_capteurProximiter; |
salco | 28:ac5c6350ed9a | 53 | //char c; |
salco | 28:ac5c6350ed9a | 54 | Labyrinthe* myMaze; |
salco | 28:ac5c6350ed9a | 55 | |
salco | 38:57d5f36a0333 | 56 | struct positionXY |
salco | 38:57d5f36a0333 | 57 | { |
salco | 38:57d5f36a0333 | 58 | signed char posX; |
salco | 38:57d5f36a0333 | 59 | signed char posY; |
salco | 38:57d5f36a0333 | 60 | }; |
salco | 38:57d5f36a0333 | 61 | std::list<positionXY> bufferNewWay; |
salco | 38:57d5f36a0333 | 62 | |
salco | 28:ac5c6350ed9a | 63 | int m_valueCapteurUltrasonic,m_valueCapteurIR,m_valueCapteurProximiter; |
salco | 28:ac5c6350ed9a | 64 | unsigned char tableauDeCommange[10]; |
salco | 28:ac5c6350ed9a | 65 | unsigned char size_tableauDeCommange; |
salco | 28:ac5c6350ed9a | 66 | void updateModuleValue(void); |
salco | 28:ac5c6350ed9a | 67 | |
salco | 38:57d5f36a0333 | 68 | |
salco | 2:4c5b0f6d0a6b | 69 | protected: |
salco | 28:ac5c6350ed9a | 70 | /* |
salco | 28:ac5c6350ed9a | 71 | * Tache principale de la classe |
salco | 28:ac5c6350ed9a | 72 | */ |
salco | 2:4c5b0f6d0a6b | 73 | virtual void task(void); |
salco | 28:ac5c6350ed9a | 74 | void analiseMaze(void); |
salco | 38:57d5f36a0333 | 75 | char checkOtherWay(char dir, bool checkExplorer=false); |
salco | 38:57d5f36a0333 | 76 | |
salco | 38:57d5f36a0333 | 77 | bool searchNewWay(void); |
salco | 38:57d5f36a0333 | 78 | bool isAnotherWay(void); |
salco | 2:4c5b0f6d0a6b | 79 | public: |
salco | 2:4c5b0f6d0a6b | 80 | Directive(); |
salco | 2:4c5b0f6d0a6b | 81 | virtual~Directive(); |
salco | 28:ac5c6350ed9a | 82 | double IRToCm (double miliVolt); |
salco | 28:ac5c6350ed9a | 83 | void addTableauDeCommande(unsigned char value); |
salco | 2:4c5b0f6d0a6b | 84 | |
salco | 2:4c5b0f6d0a6b | 85 | }; |
salco | 2:4c5b0f6d0a6b | 86 | #endif // DIRECTIVE_H |