OK i got control again. a rouge command was left unnoticed.
am having battery problems. i charge up both batts (1600 and a 2800) but im only getting about 1min of play out of them at a time intill the servos start to die.
so no further testing tonight but i have managed to see what the current code is doing and it doesnt seem to be responding in the way we had hoped.
i will post a vid or something tomrrow night.
IF(IKCF < TOFLOAT(FemurLength+TibiaLength-30)) THEN
IKSolution = POSITIVE ;Output POSITIVE IF the solution is possible
ELSE
IF(IKCF < TOFLOAT(FemurLength+TibiaLength)) THEN
IKSolutionWarning = POSITIVE ;Output POSITIVE IF the solution is NEARLY possible
ELSE
IKSolutionError = POSITIVE ;Output POSITIVE IF the solution is NOT possible
ENDIF
ENDIF
this is a great site that i have been browsing over for the last 24 hours.
here it explains more about Axis Vs Angle and Euler Angles and Rotation Points Around an Arbitrary Axis.
the math is quite well documented but understanding most of it is not my field unfortunatly.
i have tried to find anything on tilted axis but i cannot find it. someone else might have more luck.
I have seen equations that rotate 3d data around a 3d (x,y,z) axis. I donāt understand that complex equations. Anyway,
function rotateZ(x, y, center, dAngle)
{
//note: here dAngle is in arc unit PI format
var dy = y-center.y;
var dx = x-center.x;
var orgAngle = Math.atan2(dy, dx);
var hypo = Math.sqrt(dy*dy+dx*dx);
var newAngle = orgAngle+dAngle;
var xx = hypo*Math.cos(newAngle)+center.x;
var yy = hypo*Math.sin(newAngle)+center.y;
var pt = {x:xx, y:yy};
return pt;
}
The above code is to limit the IK calculation solution when it approach the reach limit. I am writing similar code for my quad as well. Without these code, the leg will go hair-wire! Itās ok to leave it alone
These are really good reference. I didnāt go through all the line, but from your explaination, you have already got the concept. But the old test you found, the one which you refer to, is not correct for your application. Sorry to point out, but the code you wrote is incorrect
By the way, I have PMed you some new codes, just hours after my last post here.
I added negative(-) sign in front of both equation. I have shared the new IK model, in excel format.
I believe using a successive rotation about global cartesian axes is one way to go. Remeber the correct order of rotation: Y rotate followed by a Z rotate (Iām refering to the axis used in PEP and Xanās code). I also sent you a PM I hope you donāt get confused
Ok while trying to get the tilted coxa calculations corrected i have also hit
another problem. even with the tilted coxa calculations sorted i would still
need to sort out the COG. now im open to all answers ābutā adding
motors/servos to redirect the COG while walking really isnt on my list.
i need to work out how to program this.
i think the intended plane would be Z & X and the body would have to move
into the triangle created by the tripod in each step. (as each leg lifts)
im not sure how to get these globe positions āon the flyā and add them to the code.
any help will be critical.
how is this done?
with this being said i would also need to get the timing right so that once
the COG has been transfered away from the fly leg i will need it to return
back when leg is returning to ground again.
well the first vid (robot) called StarLight using the same motion as a lizard and can only transverse in one direction. non-omnidirectional.
āParkā did a great job with his creation. it was one of his works from uni.
you may think the second vid does show the same kind of loco as the first but in slow motion. but if you study the gait steps you will also see that park (first vid) using a Ripple gait, were as the second uses Wave.
the body
Yes, youāre right. So Ripple is move legs on one side and then the other, while Wave alternates the sides? Iāll probably need to watch these vids over and over to get the full flavor of the differences!
I can appreciate that StarLight does have a lot more body āswaggerā in his gait. But you say no translation?
Maybe we need to define or differentiate more on whether we are wanting to do sprawled (reptile/insect) or upright (mammalian) stances? The classic hexapod where weāre wanting to start from is of course sprawled. Dogs, Cats, Horses have an upright stance. and there appears to be considerable discussion on whether Big Dog and Little Dog have sprawled or upright stances. They do appear to have rotated-under-the-body legs.
TotalX var sword ;Total X distance between the center of the body and the feet
TotalZ var sword ;Total Z distance between the center of the body and the feet
TotalXBal var sword
TotalZBal var sword
BodyOffsetX var sbyte ;Input Offset betweeen the body and Coxa X
BodyOffsetZ var sbyte ;Input Offset betweeen the body and Coxa Z
PosX var sword ;Input position of the feet X
PosZ var sword ;Input position of the feet Z
TotalTransX var sword
TotalTransZ var sword
Hi Iām quoting myself again about the balance part:
I believe this method canāt be used to keep the COG inside one of the tripods.
Interesting topic though. I hope to put my mind into the quad challenge in the near future. But starting to study others work is a good thing. I hope you find a method for this. I remember I saw an excel sheet of a walking quad one time where the tripod and COG where calculated on the fly (on this forum).
Yes, I had been there briefly, but hadnāt made it back. These videos would be good to reference there as well.
Have you worked out any sort of āphase chartā for what you want to do with your body IK and leg IK? Might be interesting if something could be worked out in a spread sheet, that would generate a chart or graph.
EDIT:
Looks like KĆĘĆĀ„re has just posted on an XLS that does just that!
Have you got stalker walking already? Sorry, I canāt open the youtube link, some kind of error (or perhaps block by local server ) Are you still using the wave 18 steps? Anyway, I ran a sim on the code. The result doesnāt look good COG is out of the tripod some part of the cycle. Just a hunch, try this:
These are the settings for the gait engine. You can find some aditional information about this on my Project page. Let me know if there are any more questions about this part. (or any part of the code )
;Check IF the Gait is in motion
GaitInMotion = ((ABS(TravelLengthX)>ps2Tolerance) | (ABS(TravelLengthZ)>ps2Tolerance) | (ABS(TravelRotationY)>ps2Tolerance) )
;Leg middle up position
;Gait in motion Gait NOT in motion, return to home position
IF (GaitInMotion & (NrLiftedPos=1 | NrLiftedPos=3) & GaitStep=GaitLegNr) | (GaitInMotion=NEGITIVE & GaitStep=GaitLegNr & ((ABS(GaitPosX)>2) | (ABS(GaitPosZ)>2) | (ABS(GaitRotY)>2))) THEN ;Up
GaitPosX = 0
GaitPosY = -LegLiftHeight
GaitPosZ = 0
GaitRotY = 0
ELSE
;Optional Half heigth Rear
IF ((NrLiftedPos=2 & GaitStep=GaitLegNr) | (NrLiftedPos=3 & (GaitStep=GaitLegNr-1 | GaitStep=GaitLegNr+(StepsInGait-1)))) & GaitInMotion THEN
GaitPosX = -TravelLengthX/2
GaitPosY = -LegLiftHeight/(HalfLiftHeigth+1)
GaitPosZ = -TravelLengthZ/2
GaitRotY = -TravelRotationY/2
ELSE
;Optional half heigth front
IF (NrLiftedPos>=2) & (GaitStep=GaitLegNr+1 | GaitStep=GaitLegNr-(StepsInGait-1)) & GaitInMotion THEN
GaitPosX = TravelLengthX/2
GaitPosY = -LegLiftHeight/(HalfLiftHeigth+1)
GaitPosZ = TravelLengthZ/2
GaitRotY = TravelRotationY/2
ELSE
;Leg front down position
IF (GaitStep=GaitLegNr+NrLiftedPos | GaitStep=GaitLegNr-(StepsInGait-NrLiftedPos)) & GaitPosY<0 THEN
GaitPosX = TravelLengthX/2
GaitPosY = 0
GaitPosZ = TravelLengthZ/2
GaitRotY = TravelRotationY/2
;Move body forward
ELSE
GaitPosX = GaitPosX - (TravelLengthX/TLDivFactor)
GaitPosY = 0
GaitPosZ = GaitPosZ - (TravelLengthZ/TLDivFactor)
GaitRotY = GaitRotY - (TravelRotationY/TLDivFactor)
ENDIF
ENDIF
ENDIF
ENDIF
;Advance to the next step
IF LastLeg THEN ;The last leg in this step
GaitStep = GaitStep+1
IF GaitStep>StepsInGait THEN
GaitStep = 1
ENDIF
ENDIF
return[/code]
by adding another section to this where the body moves forward
i think i can work something out. the bit id like to add will allow the body to move 'not only forward but also to the oposite side of the fly leg using the X & Z axis, like a diagonal move rather than just forward.
eg. If the front left leg lifts then the body moves forward to the front right leg by say, +1 and also to the side say +1.5 moving the body away from the fly leg but still walking in a forward direction. get me? iv confused my self now.
I remember first saw it in your thread (Xanās Phoenix Code). Went back to that thread but couldnāt find the wave 18 steps, but the few examples are good to give me a head start.
I have not look into those codes, though itās thereā¦ heheā¦ Since innerbreed is using the same code as phoenix, except the middle leg, so I guess the code should work
The idea is good, like sine-walking robot? The GaitPosX,Y,Z and GaitRotY is picked up by another subroutine, need to look into that first before making any changes. Just a quick look, the Gait function does not include any variable that mention which leg is on the fly. You need to call another variable (or existing one) and put it into the equation so that it know which side (left or right) to move.