Well, Thanks to both of you! Sometimes my mind goes blank when I’m working in a language I don’t use as often. OK, so it goes blank other times as well…
Of course I’ll have to use GOTOs to get back, not like the more in-line case statement of ‘C’. but I can work with it.
If you’re curious Eddie, I’m trying to implement a state machine for a Quad Gait. And I found this video to be an excellent study:
just messing around anyway, but y’all probably knew that.
what I don’t get is why everybody goes for the komodo dragon approach to designing a quad but fails to include 4 things that factor significantly into its motion. first, no tail. second, no head. both of those have significant mass and 2 or mor axis of movement. third, feet are not a point contact on the ground but have at least 2 axis of ability to apply force. and fourth, there is a roll component along the long axis in the gait that allows a significant shift of cg from left to right with very small movement laterally.
most quadrapeds in nature are more like dogs and horses and less like man eating lizards… but everybody keeps trying to make half a lizard walk like something recognizable. I don’t get it.
Hard to say. Maybe just starting small? I’ve mentioned it before; I’d really like to do a cat or dog. KÃ¥re Halvorsen (Zenta) has a 'quad design that I’d like to try out. OK, no head or tail, but should be able to do a little body roll.
It’s much easier to mount servos vertically between two plates, which lends it’s self most readily to a lizzard. KÃ¥re has departed from this of course. Jim showed a leg with a horizontal coxa servo. I think the plate that enabled it bolted up to either a hex or octo chassis. but that’s still not a sagittal plane, as a dog/cat/horse would need.
I think the calcs get a little harry if greater then 3DOF. Matrix calculations might be more in order. I suppose they can be done in BASIC.
But I’d be happy just to get a state machine-driven gait generator running. I’m temped at this point to do it in C first.
I believe I’ve found an example of a “case/switch statement” from the Phoenix code (Atom Pro).
[code]SELECT gaitCode ’ depending on gaitCode
CASE $00 ’ Adjust Legs if 0 is selected
ptrEEPROM = Adjust
rightRamp = Fast
leftRamp = Fast
GOTO Walking_Engine
CASE $01
ptrEEPROM = LTurn ' Spin left
rightRamp = VeryFast ' Assign ramp to
leftRamp = VeryFast ' left and right sides
GOTO Walking_Engine
CASE $02
ptrEEPROM = RTurn ’ Spin right
rightRamp = VeryFast
leftRamp = VeryFast
GOTO Walking_Engine
ENDSELECT
[/code]
Much better way to code then if…then…else, although I’m still not finding it in the pro manual.
I hadn’t had a chance to test the instructions. Jonny had a collection of programs that he graciously shared with me. I don’t recall if he specified that it was a different BASIC. No doubt it is.
But it does point out the desirability of a CASE-type instruction in BASIC.
Sorry for mislead. Perhaps It’s something that could be added to Atom Pro?