Programme de contrôle de l'octopode 4DOF, Theraphosa-Salconi.

Dependencies:   debug mbed

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
Committer:
salco
Date:
Fri May 08 19:57:25 2015 +0000
Revision:
22:a2c875629f2d
Parent:
21:5c17b7836733
Child:
23:7b296b6d8285
turn + recalibrement is donne

Who changed what in which revision?

UserRevisionLine numberNew contents of line
salco 0:e4151abdff23 1 /*
salco 0:e4151abdff23 2 * homemadeSequence.cpp
salco 0:e4151abdff23 3 *
salco 0:e4151abdff23 4 * Created on: Mar 03, 2015
salco 0:e4151abdff23 5 * Author: salco
salco 0:e4151abdff23 6 */
salco 0:e4151abdff23 7 #include "homemadeSequence.h"
salco 19:0ac80045ba4c 8 unsigned char table_seqUp[9][2][3] = { { {80 , 210, 160}, {220, 90 , 114} },
salco 22:a2c875629f2d 9 { {80 , 220, 170}, {220, 80 , 130} },
salco 22:a2c875629f2d 10 { {90 , 220, 160}, {200, 80 , 140} },
salco 22:a2c875629f2d 11 { {106, 220, 150}, {194, 80 , 150} },
salco 22:a2c875629f2d 12 { {128, 220, 127}, {172, 80 , 173} },
salco 22:a2c875629f2d 13 { {144, 205, 130}, {156, 95 , 170} },
salco 22:a2c875629f2d 14 { {144, 210, 123}, {156, 89 , 177} },
salco 22:a2c875629f2d 15 { {172, 185, 124}, {128, 115, 176} },
salco 22:a2c875629f2d 16 { {194, 166, 118}, {106, 134, 182} }
salco 22:a2c875629f2d 17 };
salco 22:a2c875629f2d 18
salco 19:0ac80045ba4c 19 unsigned char table_seqDown[9][2][3] = { { {172, 185, 124}, {128, 115, 176} },
salco 22:a2c875629f2d 20 { {172, 185, 124}, {128, 115, 176} },
salco 22:a2c875629f2d 21 { {144, 210, 123}, {156, 89 , 177} },
salco 22:a2c875629f2d 22 { {144, 205, 130}, {156, 95 , 170} },
salco 22:a2c875629f2d 23 { {128, 220, 127}, {172, 80 , 173} },
salco 22:a2c875629f2d 24 { {106, 220, 150}, {194, 80 , 150} },
salco 22:a2c875629f2d 25 { {90 , 220, 160}, {200, 80 , 140} },
salco 22:a2c875629f2d 26 { {80 , 220, 170}, {220, 80 , 130} },
salco 22:a2c875629f2d 27 { {80 , 100, 150}, {220, 200, 150} }
salco 22:a2c875629f2d 28 };//fin de la seq il met ses patte sur sa tete**
salco 22:a2c875629f2d 29
salco 21:5c17b7836733 30 unsigned char table_seqCrabe[33][8][3] = {{ /* 0*/{255,255,255}, /* 4*/{125, 184, 156}, /* 8*/{132, 215, 147}, /*12*/{255,255,255},
salco 22:a2c875629f2d 31 /*16*/{203,101,128}, /*20*/{255,255,255}, /*24*/{176, 87, 163}, /*28*/{191, 103,133}
salco 22:a2c875629f2d 32 },
salco 22:a2c875629f2d 33 { /* 0*/{255,255,255}, /* 4*/{111, 185, 156}, /* 8*/{255, 255, 255}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 34 /*16*/{209, 99,140}, /*20*/{255, 255, 255}, /*24*/{255, 255, 255}, /*28*/{196, 105,142}
salco 22:a2c875629f2d 35 },
salco 22:a2c875629f2d 36 { /* 0*/{255,255,255}, /* 4*/{103, 192, 155}, /* 8*/{255, 255, 255}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 37 /*16*/{203,108,137}, /*20*/{255, 255, 255}, /*24*/{170, 88, 159}, /*28*/{191, 112,141}
salco 22:a2c875629f2d 38 },
salco 22:a2c875629f2d 39 { /* 0*/{255,255,255}, /* 4*/{ 98, 199, 158}, /* 8*/{255, 255, 255}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 40 /*16*/{196,114,137}, /*20*/{255, 255, 255}, /*24*/{255, 255, 255}, /*28*/{184, 118,142}
salco 22:a2c875629f2d 41 },
salco 22:a2c875629f2d 42 { /* 0*/{255,255,255}, /* 4*/{255, 255, 255}, /* 8*/{255, 255, 255}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 43 /*16*/{182,115,144}, /*20*/{255, 255, 255}, /*24*/{169, 83, 164}, /*28*/{172, 118,142}
salco 22:a2c875629f2d 44 },
salco 22:a2c875629f2d 45 { /* 0*/{255,255,255}, /* 4*/{102, 201, 170}, /* 8*/{255, 255, 255}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 46 /*16*/{152,137,139}, /*20*/{255, 255, 255}, /*24*/{169, 78, 155}, /*28*/{146, 137,142}
salco 22:a2c875629f2d 47 },
salco 22:a2c875629f2d 48 { /* 0*/{255,255,255}, /* 4*/{102, 207, 179}, /* 8*/{255, 255, 255}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 49 /*16*/{255,255,255}, /*20*/{255, 255, 255}, /*24*/{181, 76, 137}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 50 },
salco 22:a2c875629f2d 51 { /* 0*/{255,255,255}, /* 4*/{ 94, 213, 183}, /* 8*/{255, 255, 255}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 52 /*16*/{255,255,255}, /*20*/{255, 255, 255}, /*24*/{181, 77, 131}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 53 },
salco 22:a2c875629f2d 54 { /* 0*/{255,255,255}, /* 4*/{106, 216, 175}, /* 8*/{255, 255, 255}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 55 /*16*/{255,255,255}, /*20*/{255, 255, 255}, /*24*/{208, 75, 116}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 56 },
salco 22:a2c875629f2d 57 { /* 0*/{255,255,255}, /* 4*/{129, 217, 165}, /* 8*/{255, 255, 255}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 58 /*16*/{255,255,255}, /*20*/{255, 255, 255}, /*24*/{225, 75, 109}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 59 },
salco 22:a2c875629f2d 60 { /* 0*/{255,255,255}, /* 4*/{129, 221, 156}, /* 8*/{255, 255, 255}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 61 /*16*/{255,255,255}, /*20*/{161, 117, 148}, /*24*/{211, 85, 120}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 62 },
salco 22:a2c875629f2d 63 { /* 0*/{153,159,157}, /* 4*/{141, 210, 152}, /* 8*/{255, 255, 255}, /*12*/{149, 158,159},
salco 22:a2c875629f2d 64 /*16*/{255,255,255}, /*20*/{172, 92, 165}, /*24*/{211, 90, 127}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 65 },
salco 22:a2c875629f2d 66 { /* 0*/{121,180,156}, /* 4*/{139, 217, 134}, /* 8*/{255, 255, 255}, /*12*/{121, 180,156},
salco 22:a2c875629f2d 67 /*16*/{255,255,255}, /*20*/{255, 255, 255}, /*24*/{215, 93, 140}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 68 },
salco 22:a2c875629f2d 69 { /* 0*/{113,176,156}, /* 4*/{255, 255, 255}, /* 8*/{255, 255, 255}, /*12*/{107, 182,156},
salco 22:a2c875629f2d 70 /*16*/{255,255,255}, /*20*/{168, 94, 157}, /*24*/{209, 101, 142}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 71 },
salco 22:a2c875629f2d 72 { /* 0*/{105,183,155}, /* 4*/{255, 255, 255}, /* 8*/{255, 255, 255}, /*12*/{100, 187,150},
salco 22:a2c875629f2d 73 /*16*/{255,255,255}, /*20*/{255, 255, 255}, /*24*/{202, 106, 142}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 74 },
salco 22:a2c875629f2d 75 { /* 0*/{100,191,158}, /* 4*/{255, 255, 255}, /* 8*/{255, 255, 255}, /*12*/{ 96, 193,155},
salco 22:a2c875629f2d 76 /*16*/{255,255,255}, /*20*/{167, 86, 166}, /*24*/{187, 109, 144}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 77 },
salco 22:a2c875629f2d 78 { /* 0*/{103,193,170}, /* 4*/{255, 255, 255}, /* 8*/{255, 255, 255}, /*12*/{ 99, 197,170},
salco 22:a2c875629f2d 79 /*16*/{255,255,255}, /*20*/{166, 87, 150}, /*24*/{154, 133, 140}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 80 },
salco 22:a2c875629f2d 81 { /* 0*/{103,200,177}, /* 4*/{255, 255, 255}, /* 8*/{255, 255, 255}, /*12*/{ 99, 201,177},
salco 22:a2c875629f2d 82 /*16*/{255,255,255}, /*20*/{177, 80, 145}, /*24*/{255, 255, 255}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 83 },
salco 22:a2c875629f2d 84 { /* 0*/{ 96,205,182}, /* 4*/{255, 255, 255}, /* 8*/{255, 255, 255}, /*12*/{ 91, 208,176},
salco 22:a2c875629f2d 85 /*16*/{255,255,255}, /*20*/{177, 87, 130}, /*24*/{255, 255, 255}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 86 },
salco 22:a2c875629f2d 87 { /* 0*/{108,216,171}, /* 4*/{255, 255, 255}, /* 8*/{255, 255, 255}, /*12*/{102, 210,173},
salco 22:a2c875629f2d 88 /*16*/{255,255,255}, /*20*/{192, 92, 123}, /*24*/{255, 255, 255}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 89 },
salco 22:a2c875629f2d 90 { /* 0*/{108,216,171}, /* 4*/{255, 255, 255}, /* 8*/{255, 255, 255}, /*12*/{102, 210,173},
salco 22:a2c875629f2d 91 /*16*/{255,255,255}, /*20*/{218, 79, 120}, /*24*/{255, 255, 255}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 92 },
salco 22:a2c875629f2d 93 { /* 0*/{129,219,151}, /* 4*/{255, 255, 255}, /* 8*/{255, 255, 255}, /*12*/{125, 213,157},
salco 22:a2c875629f2d 94 /*16*/{162,115,150}, /*20*/{206, 93, 118}, /*24*/{255, 255, 255}, /*28*/{154, 116,150}
salco 22:a2c875629f2d 95 },
salco 22:a2c875629f2d 96 { /* 0*/{140,209,142}, /* 4*/{255, 255, 255}, /* 8*/{145, 161, 157}, /*12*/{135, 215,145},
salco 22:a2c875629f2d 97 /*16*/{170, 93,167}, /*20*/{206, 97, 127}, /*24*/{255, 255, 255}, /*28*/{163, 93,168}
salco 22:a2c875629f2d 98 },
salco 22:a2c875629f2d 99 { /* 0*/{255,255,255}, /* 4*/{255, 255, 255}, /* 8*/{115, 182, 158}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 100 /*16*/{255,255,255}, /*20*/{212, 97, 142}, /*24*/{255, 255, 255}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 101 },
salco 22:a2c875629f2d 102 { /* 0*/{255,255,255}, /* 4*/{255, 255, 255}, /* 8*/{101, 183, 156}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 103 /*16*/{167, 93,159}, /*20*/{205, 107, 142}, /*24*/{255, 255, 255}, /*28*/{160, 96,160}
salco 22:a2c875629f2d 104 },
salco 22:a2c875629f2d 105 { /* 0*/{255,255,255}, /* 4*/{255, 255, 255}, /* 8*/{ 94, 190, 154}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 106 /*16*/{255,255,255}, /*20*/{197, 113, 144}, /*24*/{255, 255, 255}, /*28*/{255, 255,255}
salco 22:a2c875629f2d 107 },
salco 22:a2c875629f2d 108 { /* 0*/{255,255,255}, /* 4*/{255, 255, 255}, /* 8*/{ 89, 197, 158}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 109 /*16*/{167, 86,167}, /*20*/{182, 115, 142}, /*24*/{255, 255, 255}, /*28*/{161, 88,162}
salco 22:a2c875629f2d 110 },
salco 22:a2c875629f2d 111 { /* 0*/{255,255,255}, /* 4*/{255, 255, 255}, /* 8*/{ 92, 200, 171}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 112 /*16*/{166, 86,156}, /*20*/{153, 136, 142}, /*24*/{255, 255, 255}, /*28*/{166, 86,156}
salco 22:a2c875629f2d 113 },
salco 22:a2c875629f2d 114 { /* 0*/{255,255,255}, /* 4*/{255, 255, 255}, /* 8*/{ 92, 205, 175}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 115 /*16*/{177, 82,133}, /*20*/{255, 255, 255}, /*24*/{255, 255, 255}, /*28*/{169, 82,143}
salco 22:a2c875629f2d 116 },
salco 22:a2c875629f2d 117 { /* 0*/{255,255,255}, /* 4*/{255, 255, 255}, /* 8*/{ 82, 215, 177}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 118 /*16*/{177, 85,126}, /*20*/{255, 255, 255}, /*24*/{255, 255, 255}, /*28*/{169, 84,135}
salco 22:a2c875629f2d 119 },
salco 22:a2c875629f2d 120 { /* 0*/{255,255,255}, /* 4*/{255, 255, 255}, /* 8*/{ 96, 214, 176}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 121 /*16*/{191,101,113}, /*20*/{255, 255, 255}, /*24*/{255, 255, 255}, /*28*/{190, 86,124}
salco 22:a2c875629f2d 122 },
salco 22:a2c875629f2d 123 { /* 0*/{255,255,255}, /* 4*/{255, 255, 255}, /* 8*/{120, 213, 158}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 124 /*16*/{213, 83,124}, /*20*/{255, 255, 255}, /*24*/{255, 255, 255}, /*28*/{202, 88,121}
salco 22:a2c875629f2d 125 },
salco 22:a2c875629f2d 126 { /* 0*/{255,255,255}, /* 4*/{255, 255, 255}, /* 8*/{120, 217, 154}, /*12*/{255, 255,255},
salco 22:a2c875629f2d 127 /*16*/{203, 95,110}, /*20*/{255, 255, 255}, /*24*/{165, 109, 152}, /*28*/{191, 101,120}
salco 22:a2c875629f2d 128 }
salco 22:a2c875629f2d 129 };
salco 22:a2c875629f2d 130
salco 22:a2c875629f2d 131 unsigned char table_seqTurn_PAUSE_TIME[32][2] = {{ 30, 30},{ 20, 20},{ 25, 25},{ 20, 30},{ 25, 20},{ 21, 30},{ 30, 30},
salco 22:a2c875629f2d 132 { 30, 30},{ 20, 20},{ 20, 20},{ 20, 30},{ 20, 20},{ 20, 20},{ 30, 30},{ 31, 30},
salco 22:a2c875629f2d 133 { 20, 20},{ 30, 30},{ 20, 30},{ 30, 30},{ 20, 20},{ 20, 30},{ 30, 30},{ 30, 30}
salco 22:a2c875629f2d 134 };
salco 21:5c17b7836733 135
salco 22:a2c875629f2d 136 unsigned char table_seqTurn[31][8][3] = {{ /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{ 92,211,171}, /*12*/{255,255,255},
salco 22:a2c875629f2d 137 /*16*/{255,255,255}, /*20*/{213, 85,118}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 138 },
salco 22:a2c875629f2d 139 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{ 89,193,186}, /*12*/{255,255,255},
salco 22:a2c875629f2d 140 /*16*/{255,255,255}, /*20*/{212, 99,119}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 141 },
salco 22:a2c875629f2d 142 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{ 90,196,170}, /*12*/{255,255,255},
salco 22:a2c875629f2d 143 /*16*/{255,255,255}, /*20*/{205,107,129}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 144 },
salco 22:a2c875629f2d 145 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{101,183,165}, /*12*/{255,255,255},
salco 22:a2c875629f2d 146 /*16*/{255,255,255}, /*20*/{197,113,135}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 147 },
salco 22:a2c875629f2d 148 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{ 88,207,190}, /*12*/{255,255,255},
salco 22:a2c875629f2d 149 /*16*/{255,255,255}, /*20*/{211,114,129}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 150 },
salco 22:a2c875629f2d 151 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{118,219,139}, /*12*/{255,255,255},
salco 22:a2c875629f2d 152 /*16*/{255,255,255}, /*20*/{207,110,100}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 153 },
salco 22:a2c875629f2d 154 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{117,217,137}, /*12*/{255,255,255},
salco 22:a2c875629f2d 155 /*16*/{255,255,255}, /*20*/{189, 76,160}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 156 },
salco 22:a2c875629f2d 157 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{113,217,137}, /*12*/{255,255,255},
salco 22:a2c875629f2d 158 /*16*/{255,255,255}, /*20*/{187, 78,161}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 159 },
salco 22:a2c875629f2d 160 { /* 0*/{103,206,176}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 161 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{200, 86,124}
salco 22:a2c875629f2d 162 },
salco 22:a2c875629f2d 163 { /* 0*/{100,188,184}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 164 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{200, 95,124}
salco 22:a2c875629f2d 165 },
salco 22:a2c875629f2d 166 { /* 0*/{105,182,166}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 167 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{208, 99,127}
salco 22:a2c875629f2d 168 },
salco 22:a2c875629f2d 169 { /* 0*/{113,176,165}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 170 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{204,103,133}
salco 22:a2c875629f2d 171 },
salco 22:a2c875629f2d 172 { /* 0*/{ 93,187,203}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 173 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{203,103,115}
salco 22:a2c875629f2d 174 },
salco 22:a2c875629f2d 175 { /* 0*/{123,220,139}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 176 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{178, 78,169}
salco 22:a2c875629f2d 177 },
salco 22:a2c875629f2d 178 { /* 0*/{123,217,215}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 179 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{181, 81,167}
salco 22:a2c875629f2d 180 },
salco 22:a2c875629f2d 181 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{ 99,211,176},
salco 22:a2c875629f2d 182 /*16*/{210, 86,121}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 183 },
salco 22:a2c875629f2d 184 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{ 96,193,185},
salco 22:a2c875629f2d 185 /*16*/{209, 99,115}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 186 },
salco 22:a2c875629f2d 187 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{ 94,196,168},
salco 22:a2c875629f2d 188 /*16*/{203,103,125}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 189 },
salco 22:a2c875629f2d 190 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{107,182,165},
salco 22:a2c875629f2d 191 /*16*/{196,114,128}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 192 },
salco 22:a2c875629f2d 193 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{ 88,192,168},
salco 22:a2c875629f2d 194 /*16*/{206,115,125}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 195 },
salco 22:a2c875629f2d 196 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{ 92,198,168},
salco 22:a2c875629f2d 197 /*16*/{206,115,125}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 198 },
salco 22:a2c875629f2d 199 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{118,206,145},
salco 22:a2c875629f2d 200 /*16*/{179, 82,167}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 201 },
salco 22:a2c875629f2d 202 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{111,213,142},
salco 22:a2c875629f2d 203 /*16*/{181, 83,166}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 204 },
salco 22:a2c875629f2d 205 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 206 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{204, 88,116}, /*28*/{255,255,255}
salco 22:a2c875629f2d 207 },
salco 22:a2c875629f2d 208 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 209 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{190, 76,160}, /*28*/{255,255,255}
salco 22:a2c875629f2d 210 },
salco 22:a2c875629f2d 211 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 212 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{192, 78,156}, /*28*/{255,255,255}
salco 22:a2c875629f2d 213 },
salco 22:a2c875629f2d 214 { /* 0*/{255,255,255}, /* 4*/{255,255,255}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 215 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{194, 78,161}, /*28*/{255,255,255}
salco 22:a2c875629f2d 216 },
salco 22:a2c875629f2d 217 { /* 0*/{255,255,255}, /* 4*/{ 86,196,161}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 218 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 219 },
salco 22:a2c875629f2d 220 { /* 0*/{255,255,255}, /* 4*/{ 88,202,195}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 221 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 222 },
salco 22:a2c875629f2d 223 { /* 0*/{255,255,255}, /* 4*/{125,225,133}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 224 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 225 },
salco 22:a2c875629f2d 226 { /* 0*/{255,255,255}, /* 4*/{120,222,135}, /* 8*/{255,255,255}, /*12*/{255,255,255},
salco 22:a2c875629f2d 227 /*16*/{255,255,255}, /*20*/{255,255,255}, /*24*/{255,255,255}, /*28*/{255,255,255}
salco 22:a2c875629f2d 228 }
salco 22:a2c875629f2d 229 };
salco 22:a2c875629f2d 230 unsigned char table_seqRepositionne_PAUSE_TIME[6][2] = {{ 11, 10},{ 16, 15},{ 15, 15},{ 21, 20},{ 21, 20},{ 51, 50}};
salco 22:a2c875629f2d 231 unsigned char table_seqRepositionne[6][8][3] = {
salco 22:a2c875629f2d 232 { /* 0*/{103,206,176}, /* 4*/{102,213,176}, /* 8*/{ 92,211,171}, /*12*/{ 99,211,176},
salco 22:a2c875629f2d 233 /*16*/{210, 86,121}, /*20*/{213, 85,118}, /*24*/{217, 83,118}, /*28*/{200, 86,124}
salco 22:a2c875629f2d 234 },
salco 22:a2c875629f2d 235 { /* 0*/{100,188,184}, /* 4*/{ 98,193,185}, /* 8*/{ 89,193,186}, /*12*/{ 96,193,185},
salco 22:a2c875629f2d 236 /*16*/{209, 99,115}, /*20*/{212, 99,119}, /*24*/{215, 95,119}, /*28*/{205, 95,124}
salco 22:a2c875629f2d 237 },
salco 22:a2c875629f2d 238 { /* 0*/{ 93,182,166}, /* 4*/{ 86,196,161}, /* 8*/{ 75,196,170}, /*12*/{ 88,192,168},
salco 22:a2c875629f2d 239 /*16*/{206,115,125}, /*20*/{211,114,129}, /*24*/{213,110,129}, /*28*/{206,108,127}
salco 22:a2c875629f2d 240 },
salco 22:a2c875629f2d 241 { /* 0*/{ 93,187,203}, /* 4*/{ 88,202,195}, /* 8*/{ 88,207,190}, /*12*/{ 92,198,199},
salco 22:a2c875629f2d 242 /*16*/{204,110,107}, /*20*/{207,110,100}, /*24*/{204, 88,116}, /*28*/{203,103,115}
salco 22:a2c875629f2d 243 },
salco 22:a2c875629f2d 244 { /* 0*/{123,220,139}, /* 4*/{125,225,133}, /* 8*/{118,219,139}, /*12*/{118,206,145},
salco 22:a2c875629f2d 245 /*16*/{179, 82,167}, /*20*/{189, 76,160}, /*24*/{190, 76,160}, /*28*/{178, 78,169}
salco 22:a2c875629f2d 246 },
salco 22:a2c875629f2d 247 { /* 0*/{123,217,135}, /* 4*/{120,222,135}, /* 8*/{113,217,137}, /*12*/{111,213,142},
salco 22:a2c875629f2d 248 /*16*/{181, 83,166}, /*20*/{187, 78,161}, /*24*/{194, 78,161}, /*28*/{181, 81,167}
salco 22:a2c875629f2d 249 }
salco 22:a2c875629f2d 250 };
salco 19:0ac80045ba4c 251 /*unsigned char table_seqUpDown[9][8][4] = { { {140, 80, 210, 160}, {165, 80, 210, 160}, {160, 80, 210, 160}, {150, 80, 210, 160},
salco 19:0ac80045ba4c 252 {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
salco 19:0ac80045ba4c 253 { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
salco 19:0ac80045ba4c 254 {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
salco 19:0ac80045ba4c 255 { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
salco 19:0ac80045ba4c 256 {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
salco 19:0ac80045ba4c 257 { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
salco 19:0ac80045ba4c 258 {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
salco 19:0ac80045ba4c 259 { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
salco 19:0ac80045ba4c 260 {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
salco 19:0ac80045ba4c 261 { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
salco 19:0ac80045ba4c 262 {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
salco 19:0ac80045ba4c 263 { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
salco 19:0ac80045ba4c 264 {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
salco 19:0ac80045ba4c 265 { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
salco 19:0ac80045ba4c 266 {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
salco 19:0ac80045ba4c 267 { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4},
salco 19:0ac80045ba4c 268 {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} } };*/
salco 0:e4151abdff23 269 homemadeSequence::homemadeSequence()
salco 0:e4151abdff23 270 {
salco 19:0ac80045ba4c 271 m_SequenceChosen=0;
salco 19:0ac80045ba4c 272 m_idFrame=0;
salco 22:a2c875629f2d 273 m_idLegUse =0;
salco 0:e4151abdff23 274 }
salco 0:e4151abdff23 275 homemadeSequence::~homemadeSequence()
salco 0:e4151abdff23 276 {
salco 0:e4151abdff23 277
salco 0:e4151abdff23 278 }
salco 0:e4151abdff23 279 unsigned char* homemadeSequence::get_frame(/*char idSequence,char idOperation,*/char idLeg)
salco 0:e4151abdff23 280 {
salco 19:0ac80045ba4c 281 debug(DEBUG_HOMEMADE_GETFRAME,"\n\r In Get Frame");
salco 0:e4151abdff23 282 m_posLeg[0] = 0;
salco 0:e4151abdff23 283 m_posLeg[1] = 0;
salco 0:e4151abdff23 284 m_posLeg[2] = 0;
salco 0:e4151abdff23 285 m_posLeg[3] = 0;
salco 19:0ac80045ba4c 286 debug(DEBUG_HOMEMADE_GETFRAME,"\n\r idLeg: %i",idLeg);
salco 19:0ac80045ba4c 287 debug(DEBUG_HOMEMADE_GETFRAME,"\n\r m_SequenceChosen: %i",m_SequenceChosen);
salco 19:0ac80045ba4c 288 debug(DEBUG_HOMEMADE_GETFRAME,"\n\r m_idFrame: %i",m_idFrame);
salco 0:e4151abdff23 289 switch(m_SequenceChosen) {
salco 0:e4151abdff23 290 case 1:// 01 - Calibration(milieu) //
salco 0:e4151abdff23 291 if(m_idFrame == 1) {//if(idOperation == 1) {
salco 0:e4151abdff23 292 m_posLeg[0] = 150;
salco 0:e4151abdff23 293 m_posLeg[1] = 150;
salco 0:e4151abdff23 294 m_posLeg[2] = 150;
salco 0:e4151abdff23 295 m_posLeg[3] = 150;
salco 19:0ac80045ba4c 296 } else {
salco 19:0ac80045ba4c 297 m_posLeg[0] = 0;
salco 19:0ac80045ba4c 298 m_posLeg[1] = 0;
salco 19:0ac80045ba4c 299 m_posLeg[2] = 0;
salco 19:0ac80045ba4c 300 m_posLeg[3] = 0;
salco 0:e4151abdff23 301 }
salco 0:e4151abdff23 302 break;
salco 0:e4151abdff23 303
salco 0:e4151abdff23 304 case 2:// 02 - Debout //
salco 0:e4151abdff23 305 seqUpDown(true,m_idFrame,idLeg);//seqUpDown(true,idOperation,idLeg);
salco 0:e4151abdff23 306 break;
salco 0:e4151abdff23 307 case 3:// 03 - Coucher //
salco 0:e4151abdff23 308 seqUpDown(false,m_idFrame,idLeg);//seqUpDown(false,idOperation,idLeg);
salco 0:e4151abdff23 309 break;
salco 0:e4151abdff23 310 case 4:// 04 - Tourne Gauche //
salco 0:e4151abdff23 311 break;
salco 0:e4151abdff23 312 case 5:// 05 - Tourne Droite //
salco 0:e4151abdff23 313 break;
salco 0:e4151abdff23 314 case 6:// 06 - Marche //
salco 0:e4151abdff23 315 break;
salco 0:e4151abdff23 316 case 7:// 07 - Recule //
salco 0:e4151abdff23 317 break;
salco 0:e4151abdff23 318 case 8:// 07 - Repositioner //
salco 22:a2c875629f2d 319 seqRepositioner(m_idFrame,idLeg);
salco 0:e4151abdff23 320 break;
salco 0:e4151abdff23 321 case 9:// 09 - Crabe Gauche //
salco 21:5c17b7836733 322 seqCrabe(false,m_idFrame,idLeg);
salco 0:e4151abdff23 323 break;
salco 0:e4151abdff23 324 case 10:// 10 - Crabe Droite //
salco 21:5c17b7836733 325 seqCrabe(true,m_idFrame,idLeg);
salco 0:e4151abdff23 326 break;
salco 0:e4151abdff23 327 }
salco 19:0ac80045ba4c 328 debug(DEBUG_HOMEMADE_GETFRAME,"\n\r posLeg: [0]:%i, [1]:%i, [2]:%i, [3]:%i,",m_posLeg[0],m_posLeg[1],m_posLeg[2],m_posLeg[3]);
salco 19:0ac80045ba4c 329 debug(DEBUG_HOMEMADE_GETFRAME,"\n\r Out Get Frame");
salco 0:e4151abdff23 330 return m_posLeg;
salco 0:e4151abdff23 331 }
salco 0:e4151abdff23 332
salco 0:e4151abdff23 333 void homemadeSequence::seqUpDown(bool downUP,char idOperation,char idLeg)
salco 0:e4151abdff23 334 {
salco 0:e4151abdff23 335 if((idOperation<10)&&(idOperation>0)) {
salco 19:0ac80045ba4c 336 switch(idLeg) { //moving hips
salco 22:a2c875629f2d 337 case 1://#0
salco 0:e4151abdff23 338 m_posLeg[0] = 140;
salco 0:e4151abdff23 339 break;
salco 22:a2c875629f2d 340 case 2://#4
salco 0:e4151abdff23 341 m_posLeg[0] = 165;
salco 0:e4151abdff23 342 break;
salco 22:a2c875629f2d 343 case 3://#8
salco 0:e4151abdff23 344 m_posLeg[0] = 160;
salco 0:e4151abdff23 345 break;
salco 22:a2c875629f2d 346 case 6://#20
salco 0:e4151abdff23 347 m_posLeg[0] = 133;
salco 0:e4151abdff23 348 break;
salco 22:a2c875629f2d 349 case 7://#24
salco 0:e4151abdff23 350 m_posLeg[0] = 170;
salco 0:e4151abdff23 351 break;
salco 22:a2c875629f2d 352 default://#12 #28
salco 0:e4151abdff23 353 m_posLeg[0] = 150;
salco 0:e4151abdff23 354 break;
salco 0:e4151abdff23 355 }
salco 22:a2c875629f2d 356 if(downUP) {
salco 19:0ac80045ba4c 357 if(idLeg<5)
salco 19:0ac80045ba4c 358 for(int i=1; i <= 3; i++) m_posLeg[i]=table_seqUp[idOperation-1][0][i-1];
salco 19:0ac80045ba4c 359 else
salco 19:0ac80045ba4c 360 for(int i=1; i <= 3; i++) m_posLeg[i]=table_seqUp[idOperation-1][1][i-1];
salco 22:a2c875629f2d 361 } else {
salco 19:0ac80045ba4c 362 if(idLeg<5)
salco 19:0ac80045ba4c 363 for(int i=1; i <= 3; i++) m_posLeg[i]=table_seqDown[idOperation-1][0][i-1];
salco 19:0ac80045ba4c 364 else
salco 19:0ac80045ba4c 365 for(int i=1; i <= 3; i++) m_posLeg[i]=table_seqDown[idOperation-1][1][i-1];
salco 22:a2c875629f2d 366 }
salco 19:0ac80045ba4c 367 /*if(idOperation == 1) {
salco 0:e4151abdff23 368 if(idLeg<5) {
salco 0:e4151abdff23 369 m_posLeg[1] = 80;
salco 0:e4151abdff23 370 m_posLeg[2] = 210;
salco 0:e4151abdff23 371 m_posLeg[3] = 160;
salco 0:e4151abdff23 372 } else {
salco 0:e4151abdff23 373 m_posLeg[1] = 220;
salco 0:e4151abdff23 374 m_posLeg[2] = 90;
salco 0:e4151abdff23 375 m_posLeg[3] = 114;
salco 0:e4151abdff23 376 }
salco 0:e4151abdff23 377
salco 0:e4151abdff23 378 } else {
salco 0:e4151abdff23 379 if(!downUP) {
salco 0:e4151abdff23 380 if(idOperation == 9) {
salco 0:e4151abdff23 381 if(idLeg<5) {
salco 0:e4151abdff23 382 m_posLeg[1] = 80;
salco 0:e4151abdff23 383 m_posLeg[2] = 100;
salco 0:e4151abdff23 384 m_posLeg[3] = 150;
salco 0:e4151abdff23 385 } else {
salco 0:e4151abdff23 386 m_posLeg[1] = 220;
salco 0:e4151abdff23 387 m_posLeg[2] = 200;
salco 0:e4151abdff23 388 m_posLeg[3] = 150;
salco 0:e4151abdff23 389 }
salco 0:e4151abdff23 390 }
salco 0:e4151abdff23 391 idOperation = 10 - idOperation;
salco 0:e4151abdff23 392 }
salco 0:e4151abdff23 393
salco 0:e4151abdff23 394 switch(idOperation) {
salco 19:0ac80045ba4c 395 case 1:
salco 0:e4151abdff23 396
salco 19:0ac80045ba4c 397 break;
salco 0:e4151abdff23 398 case 2:
salco 0:e4151abdff23 399 if(idLeg<5) {
salco 0:e4151abdff23 400 m_posLeg[1] = 80;
salco 0:e4151abdff23 401 m_posLeg[2] = 220;
salco 0:e4151abdff23 402 m_posLeg[3] = 170;
salco 0:e4151abdff23 403 } else {
salco 0:e4151abdff23 404 m_posLeg[1] = 220;
salco 0:e4151abdff23 405 m_posLeg[2] = 80;
salco 0:e4151abdff23 406 m_posLeg[3] = 130;
salco 0:e4151abdff23 407 }
salco 0:e4151abdff23 408 break;
salco 0:e4151abdff23 409 case 3:
salco 0:e4151abdff23 410 if(idLeg<5) {
salco 0:e4151abdff23 411 m_posLeg[1] = 90;
salco 0:e4151abdff23 412 m_posLeg[2] = 220;
salco 0:e4151abdff23 413 m_posLeg[3] = 160;
salco 0:e4151abdff23 414 } else {
salco 0:e4151abdff23 415 m_posLeg[1] = 200;
salco 0:e4151abdff23 416 m_posLeg[2] = 200;
salco 0:e4151abdff23 417 m_posLeg[3] = 140;
salco 0:e4151abdff23 418 }
salco 0:e4151abdff23 419 break;
salco 0:e4151abdff23 420 case 4:
salco 0:e4151abdff23 421 if(idLeg<5) {
salco 0:e4151abdff23 422 m_posLeg[1] = 106;
salco 0:e4151abdff23 423 m_posLeg[2] = 220;
salco 0:e4151abdff23 424 m_posLeg[3] = 150;
salco 0:e4151abdff23 425 } else {
salco 0:e4151abdff23 426 m_posLeg[1] = 195;
salco 0:e4151abdff23 427 m_posLeg[2] = 80;
salco 0:e4151abdff23 428 m_posLeg[3] = 150;
salco 0:e4151abdff23 429 }
salco 0:e4151abdff23 430 break;
salco 0:e4151abdff23 431 case 5:
salco 0:e4151abdff23 432 if(idLeg<5) {
salco 0:e4151abdff23 433 m_posLeg[1] = 128;
salco 0:e4151abdff23 434 m_posLeg[2] = 220;
salco 0:e4151abdff23 435 m_posLeg[3] = 128;
salco 0:e4151abdff23 436 } else {
salco 0:e4151abdff23 437 m_posLeg[1] = 172;
salco 0:e4151abdff23 438 m_posLeg[2] = 80;
salco 0:e4151abdff23 439 m_posLeg[3] = 173;
salco 0:e4151abdff23 440 }
salco 0:e4151abdff23 441 break;
salco 0:e4151abdff23 442 case 6:
salco 0:e4151abdff23 443 if(idLeg<5) {
salco 0:e4151abdff23 444 m_posLeg[1] = 144;
salco 0:e4151abdff23 445 m_posLeg[2] = 205;
salco 0:e4151abdff23 446 m_posLeg[3] = 130;
salco 0:e4151abdff23 447 } else {
salco 0:e4151abdff23 448 m_posLeg[1] = 156;
salco 0:e4151abdff23 449 m_posLeg[2] = 95;
salco 0:e4151abdff23 450 m_posLeg[3] = 170;
salco 0:e4151abdff23 451 }
salco 0:e4151abdff23 452 break;
salco 0:e4151abdff23 453 case 7:
salco 0:e4151abdff23 454 if(idLeg<5) {
salco 0:e4151abdff23 455 m_posLeg[1] = 144;
salco 0:e4151abdff23 456 m_posLeg[2] = 211;
salco 0:e4151abdff23 457 m_posLeg[3] = 123;
salco 0:e4151abdff23 458 } else {
salco 0:e4151abdff23 459 m_posLeg[1] = 156;
salco 0:e4151abdff23 460 m_posLeg[2] = 89;
salco 0:e4151abdff23 461 m_posLeg[3] = 177;
salco 0:e4151abdff23 462 }
salco 0:e4151abdff23 463 break;
salco 0:e4151abdff23 464 case 8:
salco 0:e4151abdff23 465 if(idLeg<5) {
salco 0:e4151abdff23 466 m_posLeg[1] = 172;
salco 0:e4151abdff23 467 m_posLeg[2] = 185;
salco 0:e4151abdff23 468 m_posLeg[3] = 124;
salco 0:e4151abdff23 469 } else {
salco 0:e4151abdff23 470 m_posLeg[1] = 128;
salco 0:e4151abdff23 471 m_posLeg[2] = 115;
salco 0:e4151abdff23 472 m_posLeg[3] = 176;
salco 0:e4151abdff23 473 }
salco 0:e4151abdff23 474 break;
salco 0:e4151abdff23 475 case 9:
salco 0:e4151abdff23 476 if(idLeg<5) {
salco 0:e4151abdff23 477 m_posLeg[1] = 194;
salco 0:e4151abdff23 478 m_posLeg[2] = 166;
salco 0:e4151abdff23 479 m_posLeg[3] = 118;
salco 0:e4151abdff23 480 } else {
salco 0:e4151abdff23 481 m_posLeg[1] = 106;
salco 0:e4151abdff23 482 m_posLeg[2] = 134;
salco 0:e4151abdff23 483 m_posLeg[3] = 182;
salco 0:e4151abdff23 484 }
salco 0:e4151abdff23 485 break;
salco 19:0ac80045ba4c 486 default:
salco 19:0ac80045ba4c 487 m_posLeg[0] = 0;
salco 19:0ac80045ba4c 488 m_posLeg[1] = 0;
salco 19:0ac80045ba4c 489 m_posLeg[2] = 0;
salco 19:0ac80045ba4c 490 m_posLeg[3] = 0;
salco 19:0ac80045ba4c 491 break;
salco 0:e4151abdff23 492 }
salco 19:0ac80045ba4c 493 }*/
salco 0:e4151abdff23 494 }
salco 0:e4151abdff23 495 }
salco 0:e4151abdff23 496 void homemadeSequence::seqTurn(bool leftRIGHT,char idOperation,char idLeg)
salco 22:a2c875629f2d 497 {
salco 22:a2c875629f2d 498 if(idOperation<32) {
salco 22:a2c875629f2d 499 for(int i=1; i <= 3; i++) m_posLeg[i]=table_seqTurn[idOperation-1][idLeg-1][i-1];
salco 22:a2c875629f2d 500 delaisNeed = (table_seqTurn_PAUSE_TIME[idOperation-1][0])*10;
salco 22:a2c875629f2d 501 timeSequence[idLeg-1] = table_seqTurn_PAUSE_TIME[idOperation-1][1];
salco 22:a2c875629f2d 502
salco 22:a2c875629f2d 503 switch(idOperation) {
salco 22:a2c875629f2d 504
salco 22:a2c875629f2d 505 case 3:
salco 22:a2c875629f2d 506 switch(idLeg) { //moving hips
salco 22:a2c875629f2d 507 case 3://#8
salco 22:a2c875629f2d 508 m_posLeg[0]= (leftRIGHT)? 180:140;
salco 22:a2c875629f2d 509 break;
salco 22:a2c875629f2d 510 case 6://#20
salco 22:a2c875629f2d 511 m_posLeg[0]= (leftRIGHT)? 150:114;
salco 22:a2c875629f2d 512 break;
salco 22:a2c875629f2d 513 }
salco 22:a2c875629f2d 514 break;
salco 22:a2c875629f2d 515 case 11:
salco 22:a2c875629f2d 516 switch(idLeg) { //moving hips
salco 22:a2c875629f2d 517 case 1://#0
salco 22:a2c875629f2d 518 m_posLeg[0]= (leftRIGHT)? 150:110;
salco 22:a2c875629f2d 519 break;
salco 22:a2c875629f2d 520 case 7://28
salco 22:a2c875629f2d 521 m_posLeg[0]= (leftRIGHT)? 164:104;
salco 22:a2c875629f2d 522 break;
salco 22:a2c875629f2d 523 }
salco 22:a2c875629f2d 524 break;
salco 22:a2c875629f2d 525 case 17:
salco 22:a2c875629f2d 526 switch(idLeg) { //moving hips
salco 22:a2c875629f2d 527 case 1://#0
salco 22:a2c875629f2d 528 m_posLeg[0]= 140;
salco 22:a2c875629f2d 529 break;
salco 22:a2c875629f2d 530 case 2://4
salco 22:a2c875629f2d 531 m_posLeg[0]= (leftRIGHT)? 150:176;
salco 22:a2c875629f2d 532 break;
salco 22:a2c875629f2d 533 case 3://8
salco 22:a2c875629f2d 534 m_posLeg[0]= 160;
salco 22:a2c875629f2d 535 break;
salco 22:a2c875629f2d 536 case 6://20
salco 22:a2c875629f2d 537 m_posLeg[0]= 133;
salco 22:a2c875629f2d 538 break;
salco 22:a2c875629f2d 539 case 7://24
salco 22:a2c875629f2d 540 m_posLeg[0]= (leftRIGHT)? 153:183;
salco 22:a2c875629f2d 541 break;
salco 22:a2c875629f2d 542 case 8://28
salco 22:a2c875629f2d 543 m_posLeg[0]= 133;
salco 22:a2c875629f2d 544 break;
salco 22:a2c875629f2d 545 }
salco 22:a2c875629f2d 546 if((idLeg != 4) || (idLeg != 5))
salco 22:a2c875629f2d 547 timeSequence[idLeg-1] = 30;
salco 22:a2c875629f2d 548
salco 22:a2c875629f2d 549 break;
salco 22:a2c875629f2d 550
salco 22:a2c875629f2d 551 case 25:
salco 22:a2c875629f2d 552 if(idLeg == 7)
salco 22:a2c875629f2d 553 m_posLeg[0] = 170;
salco 22:a2c875629f2d 554 break;
salco 22:a2c875629f2d 555
salco 22:a2c875629f2d 556 case 29:
salco 22:a2c875629f2d 557 if(idLeg == 2)
salco 22:a2c875629f2d 558 m_posLeg[0] = 165;
salco 22:a2c875629f2d 559 break;
salco 22:a2c875629f2d 560 //case :
salco 22:a2c875629f2d 561 //break;
salco 22:a2c875629f2d 562 default:
salco 22:a2c875629f2d 563 m_posLeg[0]= 255;
salco 22:a2c875629f2d 564 break;
salco 22:a2c875629f2d 565 }
salco 22:a2c875629f2d 566
salco 22:a2c875629f2d 567
salco 22:a2c875629f2d 568
salco 22:a2c875629f2d 569 } else
salco 22:a2c875629f2d 570 for(int i=0; i <= 3; i++) m_posLeg[i]=0;
salco 22:a2c875629f2d 571 }
salco 0:e4151abdff23 572 void homemadeSequence::seqWalk(bool backFRONT,char idOperation,char idLeg)
salco 0:e4151abdff23 573 {}
salco 0:e4151abdff23 574 void homemadeSequence::seqRepositioner(char idOperation,char idLeg)
salco 22:a2c875629f2d 575 {
salco 22:a2c875629f2d 576 if(idOperation<6) {
salco 22:a2c875629f2d 577 if(m_idLegUse == idLeg) {
salco 22:a2c875629f2d 578 for(int i=1; i <= 3; i++) m_posLeg[i]=table_seqRepositionne[idOperation-1][idLeg-1][i-1];
salco 22:a2c875629f2d 579
salco 22:a2c875629f2d 580 timeSequence[idLeg-1] = table_seqTurn_PAUSE_TIME[idOperation-1][1];
salco 22:a2c875629f2d 581
salco 22:a2c875629f2d 582 if(idOperation == 5) {
salco 22:a2c875629f2d 583 switch(idLeg) {
salco 22:a2c875629f2d 584 case 1:
salco 22:a2c875629f2d 585 m_posLeg[0] = 137;
salco 22:a2c875629f2d 586 break;
salco 22:a2c875629f2d 587 case 2:
salco 22:a2c875629f2d 588 m_posLeg[0] = 165;
salco 22:a2c875629f2d 589 break;
salco 22:a2c875629f2d 590 case 3:
salco 22:a2c875629f2d 591 m_posLeg[0] = 160;
salco 22:a2c875629f2d 592 break;
salco 22:a2c875629f2d 593 case 4:
salco 22:a2c875629f2d 594 m_posLeg[0] = 150;
salco 22:a2c875629f2d 595 break;
salco 22:a2c875629f2d 596 case 5:
salco 22:a2c875629f2d 597 m_posLeg[0] = 153;
salco 22:a2c875629f2d 598 break;
salco 22:a2c875629f2d 599 case 6:
salco 22:a2c875629f2d 600 m_posLeg[0] = 133;
salco 22:a2c875629f2d 601 break;
salco 22:a2c875629f2d 602 case 7:
salco 22:a2c875629f2d 603 m_posLeg[0] = 170;
salco 22:a2c875629f2d 604 break;
salco 22:a2c875629f2d 605 case 8:
salco 22:a2c875629f2d 606 m_posLeg[0] = 144;
salco 22:a2c875629f2d 607 break;
salco 22:a2c875629f2d 608 }
salco 22:a2c875629f2d 609 }
salco 22:a2c875629f2d 610
salco 22:a2c875629f2d 611 } else
salco 22:a2c875629f2d 612 for(int i=0; i <= 3; i++)m_posLeg[i]=255;
salco 22:a2c875629f2d 613 delaisNeed = (table_seqRepositionne_PAUSE_TIME[idOperation-1][0])*10;
salco 22:a2c875629f2d 614 } else
salco 22:a2c875629f2d 615 for(int i=0; i <= 3; i++) m_posLeg[i]=0;
salco 22:a2c875629f2d 616 }
salco 0:e4151abdff23 617 void homemadeSequence::seqCrabe(bool leftRIGHT,char idOperation,char idLeg)
salco 21:5c17b7836733 618 {
salco 22:a2c875629f2d 619 if(idOperation<33) {
salco 22:a2c875629f2d 620 if(leftRIGHT)
salco 22:a2c875629f2d 621 idOperation=33-idOperation;
salco 22:a2c875629f2d 622
salco 21:5c17b7836733 623 switch(idLeg) { //moving hips
salco 21:5c17b7836733 624 case 1:
salco 21:5c17b7836733 625 m_posLeg[0] = 140;
salco 21:5c17b7836733 626 break;
salco 21:5c17b7836733 627 case 2:
salco 21:5c17b7836733 628 m_posLeg[0] = 165;
salco 21:5c17b7836733 629 break;
salco 21:5c17b7836733 630 case 3:
salco 21:5c17b7836733 631 m_posLeg[0] = 160;
salco 21:5c17b7836733 632 break;
salco 21:5c17b7836733 633 case 6:
salco 21:5c17b7836733 634 m_posLeg[0] = 133;
salco 21:5c17b7836733 635 break;
salco 21:5c17b7836733 636 case 7:
salco 21:5c17b7836733 637 m_posLeg[0] = 170;
salco 21:5c17b7836733 638 break;
salco 21:5c17b7836733 639 default:
salco 21:5c17b7836733 640 m_posLeg[0] = 150;
salco 21:5c17b7836733 641 break;
salco 21:5c17b7836733 642 }
salco 22:a2c875629f2d 643
salco 21:5c17b7836733 644 for(int i=1; i <= 3; i++) m_posLeg[i]=table_seqCrabe[idOperation-1][idLeg-1][i-1];
salco 22:a2c875629f2d 645
salco 22:a2c875629f2d 646
salco 21:5c17b7836733 647 //inclure ici un truc de gestion des 0 parce que sa veux pas dire erreur mais juste pas changer cette patte la a ce frame la
salco 22:a2c875629f2d 648 } else
salco 22:a2c875629f2d 649 for(int i=0; i <= 3; i++) m_posLeg[i]=0;
salco 22:a2c875629f2d 650
salco 22:a2c875629f2d 651
salco 21:5c17b7836733 652 }
salco 0:e4151abdff23 653 bool homemadeSequence::next_frame(void)
salco 0:e4151abdff23 654 {
salco 19:0ac80045ba4c 655 debug(DEBUG_HOMEMADE_NEXTFRAME,"\n\r in Next Frame");
salco 19:0ac80045ba4c 656 bool temp=false;
salco 19:0ac80045ba4c 657 debug(DEBUG_HOMEMADE_NEXTFRAME,"\n\r m_idframe == %d",m_idFrame);
salco 19:0ac80045ba4c 658
salco 22:a2c875629f2d 659
salco 19:0ac80045ba4c 660 //if(m_idFrame > 1){
salco 0:e4151abdff23 661 m_idFrame++;
salco 19:0ac80045ba4c 662 unsigned char* tmpTable = get_frame(1);
salco 0:e4151abdff23 663
salco 22:a2c875629f2d 664 if((tmpTable[0]!=0) && (tmpTable[1]!=0) && (tmpTable[2]!=0) && (tmpTable[3]!=0)) {
salco 19:0ac80045ba4c 665 temp=true;
salco 22:a2c875629f2d 666 //m_idFrame++;//get_frame(m_idFrame);
salco 22:a2c875629f2d 667 if((delaisNextSeq.read_ms() >= delaisNeed) || (delaisNeed == -1)) {
salco 22:a2c875629f2d 668 delaisNextSeq.reset();
salco 22:a2c875629f2d 669 delaisNeed=-1;
salco 22:a2c875629f2d 670 for(int i=0; i<8; i++)timeSequence[i]=0;
salco 22:a2c875629f2d 671 } else
salco 22:a2c875629f2d 672 m_idFrame--;
salco 22:a2c875629f2d 673 } else
salco 19:0ac80045ba4c 674 m_idFrame--;
salco 19:0ac80045ba4c 675
salco 19:0ac80045ba4c 676 //}
salco 19:0ac80045ba4c 677 //}
salco 19:0ac80045ba4c 678 debug(DEBUG_HOMEMADE_NEXTFRAME,"\n\r m_idframe == %d",m_idFrame);
salco 19:0ac80045ba4c 679 debug(DEBUG_HOMEMADE_NEXTFRAME,"\n\r out Next Frame");
salco 22:a2c875629f2d 680
salco 0:e4151abdff23 681 return temp;
salco 0:e4151abdff23 682 }
salco 19:0ac80045ba4c 683 bool homemadeSequence::prev_frame(void) //true == prev is ok
salco 0:e4151abdff23 684 {
salco 19:0ac80045ba4c 685 //false == impossible
salco 19:0ac80045ba4c 686 debug(DEBUG_HOMEMADE_PREVFRAME,"\n\r in Prev Frame");
salco 19:0ac80045ba4c 687 bool temp=false;
salco 19:0ac80045ba4c 688 debug(DEBUG_HOMEMADE_PREVFRAME,"\n\r m_idframe == %d",m_idFrame);
salco 19:0ac80045ba4c 689
salco 22:a2c875629f2d 690
salco 19:0ac80045ba4c 691 if(m_idFrame > 1) {
salco 19:0ac80045ba4c 692 m_idFrame--;
salco 19:0ac80045ba4c 693 unsigned char* tmpTable = get_frame(1);
salco 0:e4151abdff23 694
salco 22:a2c875629f2d 695 if((tmpTable[0]!=0) && (tmpTable[1]!=0) && (tmpTable[2]!=0) && (tmpTable[3]!=0)) {
salco 19:0ac80045ba4c 696 temp=true;
salco 22:a2c875629f2d 697 //m_idFrame++;//get_frame(m_idFrame);
salco 22:a2c875629f2d 698 if((delaisNextSeq.read_ms() >= delaisNeed) || (delaisNeed == -1)) {
salco 22:a2c875629f2d 699 delaisNextSeq.reset();
salco 22:a2c875629f2d 700 delaisNeed=-1;
salco 22:a2c875629f2d 701 for(int i=0; i<8; i++)timeSequence[i]=0;
salco 22:a2c875629f2d 702 } else
salco 22:a2c875629f2d 703 m_idFrame++;
salco 22:a2c875629f2d 704 } else
salco 19:0ac80045ba4c 705 m_idFrame++;
salco 19:0ac80045ba4c 706
salco 19:0ac80045ba4c 707 //}
salco 19:0ac80045ba4c 708 }
salco 19:0ac80045ba4c 709 debug(DEBUG_HOMEMADE_PREVFRAME,"\n\r m_idframe == %d",m_idFrame);
salco 19:0ac80045ba4c 710 debug(DEBUG_HOMEMADE_PREVFRAME,"\n\r out Prev Frame");
salco 22:a2c875629f2d 711
salco 0:e4151abdff23 712 return temp;
salco 0:e4151abdff23 713 }