It's late. My eyes are tired. By brain is tired.
But it's working again.
The first step to a "dead reckoning" method of tracking was to get readings on the tachometers in the NXT's motors. Ie "number of degrees turned".
Then I had to do something useful. So I decided to use the laser as a guide to defining a "box" for targeting. Target the upper right & lower left, use those "coordinates" as scales for translating screen coordinates to rotation coordinates. (so to speak)
And to make sure I was getting things working properly, I decided to implement some boundary stuff. Ie, if we moved beyond the bounds, stop the movement (say, out of the top of the frame) and nudge things back in.
I did this also (partially) because I've had the robot chase butterflies and grind gears. Totally. Reading the tachs in the motors I decided would help keep things from moving too wildly.
Now I'm finding (of course) new issues. Like I'm getting what seems to be coordinate drift. I'm guessing it has to do with gear lash in the targeting. No biggie.
An even larger issue (though) is this...I thought I'd try targeting the corners of the "video window". And..hoooooboy.
The video motion detection needs some serious optimization. When it's off, my pentium M 1.6ghz chugs along at around 12%cpu. Connect to the camera and things go wonky.
(wonky. That's a technical term)
Anyway. UI becomes unresponsive. Click on a button and...wait...for...a...reaction...oops! There goes therobotandit'sturningALLTHEWAYAROUNDOHCRAP!!!
(because even though I release the button the "button is up you can stop now" message is still waiting behind the video processing queue and...)
Nevermind. I'm tired. I shouldn't be writing.
However, here's the new build. With dropped "low slung" stance and nifty grafted on laser.
Closeup of the laser:
(Yes, that's hot glue. Shhhh....)