Introducing the STALKER! (project ended)

Thanks for pointing out, actually suppose to be Z in stalker. :blush: :blush: Heheā€¦

Innerbreed, I sent you the final transformation code. Lets work it out behind the scene. I have posted too much in this thread which none has workā€¦ :blush: :blush: :laughing: :laughing:

great work. its really nice that so many of you are willing to help.

I have added the code and unfortunatly it knocks all the ZXY axis out.
I cannot get any control using both J-Sticks.

:cry: it may just need tweaking.

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. :blush:

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.

it could just be having uinsufficient power.

would we need to change any of this?

[code];IKCoxaAngle
GOSUB GetBoogTan [IKFeetPosZ, IKFeetPosX]
IKCoxaAngle = TOINT((BoogTan*180.0) / 3.141592)

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		

return[/code]

euclideanspace.com/maths/geo ā€¦ /index.htm

and

uwgb.edu/dutchs/structge/SL1 ā€¦ liqAxH.HTM

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.

it may help.

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; }

Would this be a step in the right direction?

Mind to share what was the problem before?

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 :wink:

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 :wink:

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. :blush: I have shared the new IK model, in excel format.

You are scratching to some of itā€¦ :wink:

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 :laughing: I hope you donā€™t get confused :unamused:

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.

Here you can see the idea i wish to impliment into my code.
youtube.com/watch?v=Q2YAZHRZ ā€¦ re=related

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. :wink:

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.

any ideas?

Thatā€™s certainly a nice walking quadruped!

Are you saying that the body shifts around to move the COG as it walks? the gait looks the same as this one:

youtube.com/watch?v=lxIy3jYuQCo&feature=related

But I guess it does move itā€™s body around more. I like this video for explaining a quad gait; although Iā€™m told itā€™s not very good?

youtube.com/watch?v=wt_k2aoF6l0

I can get a feel of moving the body 1/4 the travel as each leg moves in succession.

And now the notion of ā€œBody IKā€ has been introduced. I guess Iā€™m way behind!

Alan KM6VV

hi alan.

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

J

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.

Alan KM6VV

ok i think i have a bisic idea.

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

have you been here yet?
you may remember some of this stuff from the group.
lynxmotion.net/phpbb/viewtop ā€¦ c&start=15 :wink:

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).

Wait, that was tnay, again :exclamation: :

Pretty awesome, especially sheet #3.

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!

Alan KM6VV

:wink:

Have you got stalker walking already? Sorry, I canā€™t open the youtube link, some kind of error (or perhaps block by local server :confused: ) Are you still using the wave 18 steps? Anyway, I ran a sim on the code. The result doesnā€™t look good :wink: COG is out of the tripod some part of the cycle. Just a hunch, try this:

[code] IF (GaitType = 0) THEN ;Wave 18 steps
LRGaitLegNr = 10
RFGaitLegNr = 14
RRGaitLegNr = 1
LFGaitLegNr = 5

NrLiftedPos = 2
HalfLiftHeigth = NEGITIVE
TLDivFactor = 16
StepsInGait = 18
TitularGSpeed = 100
ENDIF
return[/code]

I donā€™t know how xan/zenta wrote this, but assuming this part of code is independent of the rest; it should at least work for forward gait.

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 :wink: )

Xan

i havent tried the gait you supplied yet but i soon will.

Been looking at the GAIT section of the code:

[code];-----------------------------[GAIT]
Gait [GaitLegNr, GaitPosX, GaitPosY, GaitPosZ, GaitRotY]

;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. :confused:

would this work? can it be done?

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 :slight_smile:

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.