I have added CPR (centre point of rotation) to the code so we can change the body’s axis of rotation along the Z axis meaning we can have a more playful movement when doing rotations.
I am currently working on a Terrain Adaption part as well as implementing a MPU6050 so we can detect external movements so we can keep the body level. (just a bit of fun)
Along with this i have also added the movements for the fifth pair (pedipalps) on Right J/Stick. This will allow us to control the tilt angle in and out when walking as well as when Translating. The Pedipalps have been added into the gait engine also.
So with regards the the Gait engine i have developed a few gaits. some experimental until i have fully tested them.
if (GaitType == 0) { display.println (" TARANTULA");
// Left Right
GaitLegNr[cLP] = 1; GaitLegNr[cRP] = 8;
GaitLegNr[cLF] = 8; GaitLegNr[cRF] = 4;
GaitLegNr[cLMF]= 5; GaitLegNr[cRMF]= 1;
GaitLegNr[cLM] = 3; GaitLegNr[cRM] = 7;
GaitLegNr[cLR] = 6; GaitLegNr[cRR] = 2;
NrLiftedPos = 3;
HalfLiftHeigth = 0;
TLDivFactor = 6;
StepsInGait = 16;
NomGaitSpeed = 75;
}
//----------------
if (GaitType == 1) { display.println (" SCORPION");
// Left Right
GaitLegNr[cLP] = 0; GaitLegNr[cRP] = 0;
GaitLegNr[cLF] = 4; GaitLegNr[cRF] = 8;
GaitLegNr[cLMF]= 7; GaitLegNr[cRMF]= 3;
GaitLegNr[cLM] = 2; GaitLegNr[cRM] = 6;
GaitLegNr[cLR] = 5; GaitLegNr[cRR] = 1;
NrLiftedPos = 3;
HalfLiftHeigth = 0;
TLDivFactor = 4;
StepsInGait = 16;
NomGaitSpeed = 90;
}
//----------------
if (GaitType == 2) { display.println (" TICK");
// Left Right
GaitLegNr[cLP] = 0; GaitLegNr[cRP] = 0;
GaitLegNr[cLF] = 6; GaitLegNr[cRF] = 2;
GaitLegNr[cLMF]= 4; GaitLegNr[cRMF]= 8;
GaitLegNr[cLM] = 3; GaitLegNr[cRM] = 7;
GaitLegNr[cLR] = 1; GaitLegNr[cRR] = 5;
NrLiftedPos = 1;
HalfLiftHeigth = 0;
TLDivFactor = 5;
StepsInGait = 8;
NomGaitSpeed = 100;
}
//----------------
if (GaitType == 3) { display.println (" LOBSTER");
// Left Right
GaitLegNr[cLP] = 0; GaitLegNr[cRP] = 0;
GaitLegNr[cLF] = 3; GaitLegNr[cRF] = 1;
GaitLegNr[cLMF]= 6; GaitLegNr[cRMF]= 5;
GaitLegNr[cLM] = 1; GaitLegNr[cRM] = 3;
GaitLegNr[cLR] = 5; GaitLegNr[cRR] = 6;
NrLiftedPos = 2;
HalfLiftHeigth = 0;
TLDivFactor = 16;
StepsInGait = 18;
NomGaitSpeed = 85;
}
//----------------
if (GaitType == 4) { display.println ("TRIPPLER");
// Left Right
GaitLegNr[cLP] = 4; GaitLegNr[cRP] = 4;
GaitLegNr[cLF] = 3; GaitLegNr[cRF] = 1;
GaitLegNr[cLMF]= 2; GaitLegNr[cRMF]= 2;
GaitLegNr[cLM] = 1; GaitLegNr[cRM] = 1;
GaitLegNr[cLR] = 2; GaitLegNr[cRR] = 3;
NrLiftedPos = 2;
HalfLiftHeigth = 1;
TLDivFactor = 3;
StepsInGait = 12;
NomGaitSpeed = 85;
}
//----------------
if (GaitType == 5) { display.println ("TARANTULA2");
int LPPedistep =random (4, 8);
int RPPedistep =random (20, 24);
// Left Right
GaitLegNr[cLP] = LPPedistep; GaitLegNr[cRP] = RPPedistep;
GaitLegNr[cLF] = 28; GaitLegNr[cRF] = 12;
GaitLegNr[cLMF]= 16; GaitLegNr[cRMF]= 0;
GaitLegNr[cLM] = 8; GaitLegNr[cRM] = 24;
GaitLegNr[cLR] = 20; GaitLegNr[cRR] = 4;
NrLiftedPos = 3;
HalfLiftHeigth = 0;
TLDivFactor = 6;
StepsInGait = 32;
NomGaitSpeed = 75;
With regards the to last one "“Tarantula2” i have added the Pedipalps on a random number selection since these do not appear to have a set pattern unlike the rest of the legs. Not sure if that will do as i expect and again the code is totally untested but i feel it is the most accurate to real life. The sequence runs in this order;
RMF, RR, LP, LM, RF, LMF, LR, RP, RM, LF,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
The LP and RP are the Left and Right Pedipalps.
These are set to jump into play at random placements between the movements of the RR - LM (placements 4-8 ) for the Left Pedi and LR - RM (placements 20-24) for the right pedi directly within the gait engine. So no two steps the same. But again… untested at this point.
Below is the repository that i have added the full code too and this will be updated as i go and if anyone has any input or sees something that just simply wont work please let me know. As always when i post code i want to thank the people involved and so apart from the main contributors Xan. Zenta and Kurte i also thank the rest of the community back from years ago when we all watch this develop into what it is today.