hexcrawler - fine tune walking with code?
My hexcrawler is pulling to the left when I have it's gait set to forward ($20).
I was wondering if there is a way to tweak the code to make it go to the right?
If I set it to a forwardRight position for selectedMode ($22) it is almost straight, but
pulls slightly to the right.
( I am referring to the hexcrawler sample code btw)
There is this line -
where I am going to try something like this:
but I know this is my 'C / actionscript - programming - brain' talking - this stuff in pbasic, using bits, bytes and
hex's doesn't work this way.
if someone could tell me where to change the sample hexcrawler code to tweak the gaits, i would be very appreciative.
-Doug Easterly
I was wondering if there is a way to tweak the code to make it go to the right?
If I set it to a forwardRight position for selectedMode ($22) it is almost straight, but
pulls slightly to the right.
( I am referring to the hexcrawler sample code btw)
There is this line -
LeftRamp = (Ramp+$2)
where I am going to try something like this:
LeftRamp = (Ramp+$2) * .8
but I know this is my 'C / actionscript - programming - brain' talking - this stuff in pbasic, using bits, bytes and
hex's doesn't work this way.
if someone could tell me where to change the sample hexcrawler code to tweak the gaits, i would be very appreciative.
-Doug Easterly
Comments
But! Since I posted a stupid question, I will at least answer it to help anyone else having the same problem in the future.
All of the hexcrawler sample code works with the interplay of Ramp values between $1 and $3F. If you are like me, and aren't familiar with hex numbers, see appendix A in the Basic Stamp Manual (I have 2, but I assume 2.5 would have a similar appendix). There you can see that $1 (or $01) is like a regular number 1. This is the case through number 9 ( or $09 in hex). But then at number 10, hex writes as ($0A). And so on until $3F, which is 63.
In my hexcrawler walking application, there is this variable declaration:
which I changed to
which is used later when determining the walk gait (selectedMode) after the Ramp variable is passed along to Fast,
since my robot was pulling to the left, when I had 'straight' selected ($20) - I simply slowed the left side down a bit to accomodate.
Post Edited (playfight) : 11/12/2005 6:08:25 PM GMT
Of course you could adjust it programatically by adjusting the legs using the "tune legs" program from the crustcrawler web site, and use the adjusted values in your program. Any one of these adjustements works well.
Alex