Alexandre Salconi-Denis / Mbed 2 deprecated ProjetOctopode

Dependencies:   debug mbed

Files at this revision

API Documentation at this revision

Comitter:
salco
Date:
Tue Apr 28 01:57:07 2015 +0000
Parent:
19:0ac80045ba4c
Child:
21:5c17b7836733
Commit message:
walkingcrab is add but we need to compleet the fonction;

Changed in this revision

source/Motrice/homemadeSequence.cpp Show annotated file Show diff for this revision Revisions of this file
source/Motrice/homemadeSequence.h Show annotated file Show diff for this revision Revisions of this file
source/Motrice/mouvement.cpp Show annotated file Show diff for this revision Revisions of this file
source/Motrice/mouvement.h Show annotated file Show diff for this revision Revisions of this file
--- a/source/Motrice/homemadeSequence.cpp	Mon Apr 27 20:41:21 2015 +0000
+++ b/source/Motrice/homemadeSequence.cpp	Tue Apr 28 01:57:07 2015 +0000
@@ -23,7 +23,74 @@
                                            { {106, 220, 150}, {194, 80 , 150} },
                                            { {90 , 220, 160}, {200, 80 , 140} },
                                            { {80 , 220, 170}, {220, 80 , 130} },
-                                           { {80 , 100, 150}, {220, 200, 150} } };//fin de la seq il met ses patte sur sa tete**
+                                           { {80 , 100, 150}, {220, 200, 150} } };//fin de la seq il met ses patte sur sa tete**                                          
+                                           
+unsigned char table_seqCrabe[33][8][3] =  { { /* 0*/{  0,  0,  0}, /* 4*/{125, 184, 156}, /* 8*/{132, 215, 147}, /*12*/{  0,   0,  0},
+                                             /*16*/{203,101,128}, /*20*/{  0,   0,   0}, /*24*/{176,  87, 163}, /*28*/{191, 103,133} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{111, 185, 156}, /* 8*/{  0,   0,   0}, /*12*/{  0,   0,  0},
+                                             /*16*/{209, 99,140}, /*20*/{  0,   0,   0}, /*24*/{  0,   0,   0}, /*28*/{196, 105,142} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{103, 192, 155}, /* 8*/{  0,   0,   0}, /*12*/{  0,   0,  0},
+                                             /*16*/{203,108,137}, /*20*/{  0,   0,   0}, /*24*/{170,  88, 159}, /*28*/{191, 112,141} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{ 98, 199, 158}, /* 8*/{  0,   0,   0}, /*12*/{  0,   0,  0},
+                                             /*16*/{196,114,137}, /*20*/{  0,   0,   0}, /*24*/{  0,   0,   0}, /*28*/{184, 118,142} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{  0,   0,   0}, /* 8*/{  0,   0,   0}, /*12*/{  0,   0,  0},
+                                             /*16*/{182,115,144}, /*20*/{  0,   0,   0}, /*24*/{169,  83, 164}, /*28*/{172, 118,142} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{102, 201, 170}, /* 8*/{  0,   0,   0}, /*12*/{  0,   0,  0},
+                                             /*16*/{152,137,139}, /*20*/{  0,   0,   0}, /*24*/{169,  78, 155}, /*28*/{146, 137,142} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{102, 207, 179}, /* 8*/{  0,   0,   0}, /*12*/{  0,   0,  0},
+                                             /*16*/{  0,  0,  0}, /*20*/{  0,   0,   0}, /*24*/{181,  76, 137}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{ 94, 213, 183}, /* 8*/{  0,   0,   0}, /*12*/{  0,   0,  0},
+                                             /*16*/{  0,  0,  0}, /*20*/{  0,   0,   0}, /*24*/{181,  77, 131}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{106, 216, 175}, /* 8*/{  0,   0,   0}, /*12*/{  0,   0,  0},
+                                             /*16*/{  0,  0,  0}, /*20*/{  0,   0,   0}, /*24*/{208,  75, 116}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{129, 217, 165}, /* 8*/{  0,   0,   0}, /*12*/{  0,   0,  0},
+                                             /*16*/{  0,  0,  0}, /*20*/{  0,   0,   0}, /*24*/{225,  75, 109}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{129, 221, 156}, /* 8*/{  0,   0,   0}, /*12*/{  0,   0,  0},
+                                             /*16*/{  0,  0,  0}, /*20*/{161, 117, 148}, /*24*/{211,  85, 120}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{153,159,157}, /* 4*/{141, 210, 152}, /* 8*/{  0,   0,   0}, /*12*/{149, 158,159},
+                                             /*16*/{  0,  0,  0}, /*20*/{172,  92, 165}, /*24*/{211,  90, 127}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{121,180,156}, /* 4*/{139, 217, 134}, /* 8*/{  0,   0,   0}, /*12*/{121, 180,156},
+                                             /*16*/{  0,  0,  0}, /*20*/{  0,   0,   0}, /*24*/{215,  93, 140}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{113,176,156}, /* 4*/{  0,   0,   0}, /* 8*/{  0,   0,   0}, /*12*/{107, 182,156},
+                                             /*16*/{  0,  0,  0}, /*20*/{168,  94, 157}, /*24*/{209, 101, 142}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{105,183,155}, /* 4*/{  0,   0,   0}, /* 8*/{  0,   0,   0}, /*12*/{100, 187,150},
+                                             /*16*/{  0,  0,  0}, /*20*/{  0,   0,   0}, /*24*/{202, 106, 142}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{100,191,158}, /* 4*/{  0,   0,   0}, /* 8*/{  0,   0,   0}, /*12*/{ 96, 193,155},
+                                             /*16*/{  0,  0,  0}, /*20*/{167,  86, 166}, /*24*/{187, 109, 144}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{103,193,170}, /* 4*/{  0,   0,   0}, /* 8*/{  0,   0,   0}, /*12*/{ 99, 197,170},
+                                             /*16*/{  0,  0,  0}, /*20*/{166,  87, 150}, /*24*/{154, 133, 140}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{103,200,177}, /* 4*/{  0,   0,   0}, /* 8*/{  0,   0,   0}, /*12*/{ 99, 201,177},
+                                             /*16*/{  0,  0,  0}, /*20*/{177,  80, 145}, /*24*/{  0,   0,   0}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{ 96,205,182}, /* 4*/{  0,   0,   0}, /* 8*/{  0,   0,   0}, /*12*/{ 91, 208,176},
+                                             /*16*/{  0,  0,  0}, /*20*/{177,  87, 130}, /*24*/{  0,   0,   0}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{108,216,171}, /* 4*/{  0,   0,   0}, /* 8*/{  0,   0,   0}, /*12*/{102, 210,173},
+                                             /*16*/{  0,  0,  0}, /*20*/{192,  92, 123}, /*24*/{  0,   0,   0}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{108,216,171}, /* 4*/{  0,   0,   0}, /* 8*/{  0,   0,   0}, /*12*/{102, 210,173},
+                                             /*16*/{  0,  0,  0}, /*20*/{218,  79, 120}, /*24*/{  0,   0,   0}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{129,219,151}, /* 4*/{  0,   0,   0}, /* 8*/{  0,   0,   0}, /*12*/{125, 213,157},
+                                             /*16*/{162,115,150}, /*20*/{206,  93, 118}, /*24*/{  0,   0,   0}, /*28*/{154, 116,150} },
+                                           { /* 0*/{140,209,142}, /* 4*/{  0,   0,   0}, /* 8*/{145, 161, 157}, /*12*/{135, 215,145},
+                                             /*16*/{170, 93,167}, /*20*/{206,  97, 127}, /*24*/{  0,   0,   0}, /*28*/{163,  93,168} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{  0,   0,   0}, /* 8*/{115, 182, 158}, /*12*/{  0,   0,  0},
+                                             /*16*/{  0,  0,  0}, /*20*/{212,  97, 142}, /*24*/{  0,   0,   0}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{  0,   0,   0}, /* 8*/{101, 183, 156}, /*12*/{  0,   0,  0},
+                                             /*16*/{167, 93,159}, /*20*/{205, 107, 142}, /*24*/{  0,   0,   0}, /*28*/{160,  96,160} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{  0,   0,   0}, /* 8*/{ 94, 190, 154}, /*12*/{  0,   0,  0},
+                                             /*16*/{  0,  0,  0}, /*20*/{197, 113, 144}, /*24*/{  0,   0,   0}, /*28*/{  0,   0,  0} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{  0,   0,   0}, /* 8*/{ 89, 197, 158}, /*12*/{  0,   0,  0},
+                                             /*16*/{167, 86,167}, /*20*/{182, 115, 142}, /*24*/{  0,   0,   0}, /*28*/{161,  88,162} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{  0,   0,   0}, /* 8*/{ 92, 200, 171}, /*12*/{  0,   0,  0},
+                                             /*16*/{166, 86,156}, /*20*/{153, 136, 142}, /*24*/{  0,   0,   0}, /*28*/{166,  86,156} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{  0,   0,   0}, /* 8*/{ 92, 205, 175}, /*12*/{  0,   0,  0},
+                                             /*16*/{177, 82,133}, /*20*/{  0,   0,   0}, /*24*/{  0,   0,   0}, /*28*/{169,  82,143} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{  0,   0,   0}, /* 8*/{ 82, 215, 177}, /*12*/{  0,   0,  0},
+                                             /*16*/{177, 85,126}, /*20*/{  0,   0,   0}, /*24*/{  0,   0,   0}, /*28*/{169,  84,135} },  
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{  0,   0,   0}, /* 8*/{ 96, 214, 176}, /*12*/{  0,   0,  0},
+                                             /*16*/{191,101,113}, /*20*/{  0,   0,   0}, /*24*/{  0,   0,   0}, /*28*/{190,  86,124} },
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{  0,   0,   0}, /* 8*/{120, 213, 158}, /*12*/{  0,   0,  0},
+                                             /*16*/{213, 83,124}, /*20*/{  0,   0,   0}, /*24*/{  0,   0,   0}, /*28*/{202,  88,121} },            
+                                           { /* 0*/{  0,  0,  0}, /* 4*/{  0,   0,   0}, /* 8*/{120, 217, 154}, /*12*/{  0,   0,  0},
+                                             /*16*/{203, 95,110}, /*20*/{  0,   0,   0}, /*24*/{165, 109, 152}, /*28*/{191, 101,120} }};                                                                                   
 /*unsigned char table_seqUpDown[9][8][4] = { { {140, 80, 210, 160}, {165, 80, 210, 160}, {160, 80, 210, 160}, {150, 80, 210, 160},
                                              {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
                                            { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
--- a/source/Motrice/homemadeSequence.h	Mon Apr 27 20:41:21 2015 +0000
+++ b/source/Motrice/homemadeSequence.h	Tue Apr 28 01:57:07 2015 +0000
@@ -28,6 +28,7 @@
     // 08 - Repositioner        //
     // 09 - Crabe  Gauche       //
     // 10 - Crabe  Droite       //
+    // 11 - recalibration legs  //
     //////////////////////////////
     char m_SequenceChosen;
     char m_idFrame;
@@ -53,6 +54,7 @@
     }
     unsigned char* get_frame(/*char idSequence,*/char idOperation,char idLeg);
     unsigned char* get_frame(/*char idSequence,char idOperation,*/char idLeg);
+    void set_frameID(char position) {m_idFrame = position;};
     bool next_frame(void); //return true if you are not at the end
     bool prev_frame(void); //return true if you are not at the begining
 };
--- a/source/Motrice/mouvement.cpp	Mon Apr 27 20:41:21 2015 +0000
+++ b/source/Motrice/mouvement.cpp	Tue Apr 28 01:57:07 2015 +0000
@@ -65,11 +65,33 @@
 
 
 
-        switch(m_seq->get_Sequence()) {
-            default:
+        //switch(m_seq->get_Sequence()) {
+        //    default:
                 tempLeg=m_seq->get_frame(m_arr_D->id());
                 m_arr_D->move(tempLeg[0],tempLeg[1],tempLeg[2],tempLeg[3]);
-                //...//
+                
+                tempLeg=m_seq->get_frame(m_arr_G->id());
+                m_arr_G->move(tempLeg[0],tempLeg[1],tempLeg[2],tempLeg[3]);
+                
+                tempLeg=m_seq->get_frame(m_arr_mil_D->id());
+                m_arr_mil_D->move(tempLeg[0],tempLeg[1],tempLeg[2],tempLeg[3]);
+                
+                tempLeg=m_seq->get_frame(m_arr_mil_G->id());
+                m_arr_mil_G->move(tempLeg[0],tempLeg[1],tempLeg[2],tempLeg[3]);
+                
+                tempLeg=m_seq->get_frame(m_avv_mil_D->id());
+                m_avv_mil_D->move(tempLeg[0],tempLeg[1],tempLeg[2],tempLeg[3]);
+                
+                tempLeg=m_seq->get_frame(m_avv_mil_G->id());
+                m_avv_mil_G->move(tempLeg[0],tempLeg[1],tempLeg[2],tempLeg[3]);
+                
+                tempLeg=m_seq->get_frame(m_avv_D->id());
+                m_avv_D->move(tempLeg[0],tempLeg[1],tempLeg[2],tempLeg[3]);
+                
+                tempLeg=m_seq->get_frame(m_avv_G->id());
+                m_avv_G->move(tempLeg[0],tempLeg[1],tempLeg[2],tempLeg[3]);
+                
+        //        //...//
                 if(m_seq->next_frame() == false) {
                     m_ForceStop=true;
 
@@ -79,13 +101,13 @@
                 else
                     debug(DEBUG_EXEC,"    Flag next possible \n\r",m_ForceStop,m_seq->get_Sequence());
 
-                break;
-        }
+        //        break;
+        //}
         //char buffer[50];
         //scanf(buffer,"%s T%d\n\r",m_arr_D->toString(),DELAITESTE);
         //m_com->printf("%s T%d\n\r",m_arr_D->toString(),DELAITESTE); //move to sendSequence()
         
-        debug(DEBUG_MOUVEMENT,"\n\r   %s T%d\n\r",m_arr_D->toString(),DELAITESTE);
+        //debug(DEBUG_MOUVEMENT,"\n\r   %s T%d\n\r",m_arr_D->toString(),DELAITESTE);
         sendSequence();
         /*
                     tempLeg=m_seq->get_frame(m_arr_D->id());
--- a/source/Motrice/mouvement.h	Mon Apr 27 20:41:21 2015 +0000
+++ b/source/Motrice/mouvement.h	Tue Apr 28 01:57:07 2015 +0000
@@ -74,7 +74,8 @@
 #endif
     Faculter_motrice(Serial* com);
     virtual ~Faculter_motrice();
-
+    
+    
     void exec(void);
     void stop(void) {
         m_ForceStop= true;