The Spykee was kinda lousy as a robot, limited, never updated and i was starting to think i wasted my money on it years ago. . . so. . . since I liked the spykee tracks. . ., it already had motors. . . and i had one laying around, my son and I Cracked it open, stripped out all the electronics, hooked up 2 tazer 10T ESC's to the motors and stacked an erector platform to the top, mounted the ezb, some batteries and off i go. . .
I'm a programmer by trade, so writing a VB script was second nature. My son (14 yo) and I talked about what we wanted it to do and I scripted it out (he's learning).
Our avoidance script works pretty well . . but I'm wodering if the sharp IR sensor would be more accurate/reliable. . . it seems the ping sensor sometimes returns values it shouldn't (0 or 255, then the next one is correct, etc). . . perhaps it's due to a ping-lag, not sure.
I tried using the ping radar control, it worked but wan't smart enough for me.
So my script does this:
Min servo, max servo, granularity, min distance, granularity, safe distance
first i calculate the servo positions up front and store them in an array ((max servo - minservo) / granularity) rather than "plussing" the servo position, i just tell it to "go to position 1" etc.
1) move forward while scanning back and forth looking for min distance or less.
on min distance (or less):
3) randomly pick a new direction to turn (left or right)
4) turn (200ms)
6) scan once to get distance,
7) if distance > safe distance go to 1)
8) if distance <= safe distance go to 4)
Note. . . when turning right, start scanning left to right, as soon as you find min, return (may not do a full scan, but it's more efficient that way). Obviously opposite when turning left!
So i'm wondering if the sharp distance sensor would be quicker and more reliable? Any Thoughts? i would LOVE a LASER distance sensor to exist!