Friday, April 15, 2011

New drive values - implemented!

So my theory worked, and now I have new CONTINOUS drive values based on my previous post.  I have put together a little demo video showing the output values as I move the drive stick around.  Each tick, two sets of numbers are printed.  The first row is the data being sent from the controller... the only two of importance for this video are the first two values, they are the Y and X values (respectively).  I put Y first because that determines forward/backward, while the X determines left/right.  The second row consists of the sine/cosine values based on the stick angle.  The first one is the left wheel, the second is the right.  As these stick values change, the droid calculates the angle they create and assigns sine and cosine values to them, which I'll work out to be percentages of speed.  When both values are equal, they are only at 0.71, so I have one last thing to do to scale these values so that there is always a 1.00 (basically I'll take the largest magnitude of the two and divide them both by that).  Again, these are only percentages, the final speed will be determined by how far the stick is from center multiplied by these percentage values.

In my video, I start out pushing the stick to the right, then slowly circle counterclockwise slowly about 1.25 times around.  If you follow my rotated unit circle from my previous post (and you have a good idea of the decimal values of fractions shown) you can see that this will work just fine.

(Currently my video is not uploading right... I'll take a look tonight and fix it then.)

UPDATE:  So the Jing video I recorded is a .swf file, and for some reason it isn't letting me upload it.  Suffice to say, I won't be worrying about the video... but believe me, it was good.  :-)  No it wasn't, it was a bunch of numbers flying up a screen.  I'm really tired... only thing left to do is paint him and he's done done.

No comments:

Post a Comment