Sounds good.
I found the code I mentioned It was in an older version of the code that I modified to use Zenta’s version of the DIY with the extra knobs… If you were in walk mode and hit the 9 key it would update the positions of the legs. The code below is specific to round hexs… As I mentioned earlier, Kåre has far more eloquent code as demonstrated in MorpHex…
[code] elseif iNumButton = 9
’ We wish to play with the leg positions… to see if I can make them more up and down…
'The Y from Pep is computed normally something like:
’ Y = FemurLengthCos(90-FemurAngle)
’ + Tibia Lengthcos((90-FemurAngle)+(TibiaAngle - 90))
'Note: the 90s cancel out if we want the foot flat we know the whole Tibialength will go into Y
’ so we can compute the needed femur angle
’ FemurAngle =90 - ACOS(( Y-TibiaLength)/FemurLength)
'From that we compute TibiaAngle = -90+FemurAngle
GOSUB GetArcCos ((CHexInitY+BodyPosY-cTibiaLength) * c4DEC)/cFemurLength ] ' not sure yet of the appropriate scale here...
FemurAngle1H = 900 - AngleRad4*180/3141 ; Convert to 1/10 degrees
TibiaAngle1H = FemurAngle1H - 900;
' now legs compute XZ value for how far the leg will be from the body given the above angles...
' should be: CoxaLen + sin(90-FemurAngle)*FemurLength
gosub GetSinCos[900 - FemurAngle1H]
XZLength1 = cCoxaLength + (sin4*cFemurLength )/c4dec ; get our length from body...
' now print this out and see if it looks right..
; now lets see what happens when we change the leg positions...
for LegIndex = 0 to 5
gosub GetSinCos[cCoxaAngle1(LegIndex)]
LegPosX(LegIndex) = (cos4 * XZLength1)/c4dec ;Set start positions for each leg
LegPosZ(LegIndex) = -(sin4 * XZLength1)/c4dec
#ifdef HSP_DEBUG
hserout HSP_DEBUG, “(”, sdec LegPosX(LegIndex), “,”, sdec LegPosZ(LegIndex),") “]
#else
serout s_out, i9600, “(”, sdec LegPosX(LegIndex), “,”, sdec LegPosZ(LegIndex),”) "]
#endif
next
#ifdef HSP_DEBUG
hserout HSP_DEBUG, [13]
#else
serout s_out, i9600, [13]
#endif
bPacket(PKT_RJOYUD) = 127-cTravelDeadZone ; Hack see if we can make it walk 1 step to get to new positions…
ENDIF
[/code]
So may try playing around. Again not sure if it should be automatically done when the robot rises and lowers or if there should be some input to do so…
Kurt
Edit: I see Zenta gave some more info here that I will look at… Thanks Zenta