Do you think that he does some trig to angle the guns to hit the target?It seems like he uses a camera to detect the object, uses sonar to get distance to object, and then angles the two guns to hit the target at that distance.

I just read all the xrover thread at Lynxmotion and I have to say I'm impressed. This is what I want my robot to be able to do. So, I'll go through your code and translate it to Arduino and AVRcam that I have. Hopefully it'll work out, although, if I remember correctly, the AVRcam returns bounding box of the color blob, so I need to calculate the center of mass (not a problem, I have a library written by one of our members that does all the calculations, thanks Frank!). A problem may be that a bounding box gets 2 sets of coordinates for the opposite corners, that's taking more time on the serial link. Perhaps the fact that I can use 115200 baud will even out the speed loss. The good part is, knowing the size of the tracked object, I can get distance info by the size of the bounding box (I'll play with this latter).

This will take some time until I'll have it ready, because I am also working on other stuff. Hopefully during the weekend I'll be able to do some preliminary testing.

Oh, and the targeting is also impressive, perhaps I should mount a gun to my robot's right arm to shoot the bad guys while the left arm puts out the fire started by all that firing...

The good part is, knowing the size of the tracked object, I can get distance info by the size of the bounding box (I'll play with this latter).

I've been playing around with that concept for years, but it has a few problems:

-lighting conditions can alter the 'size' of the object-orientation of the object, if not a perfect sphere, will change the 'size'-sometimes one big object might appear as two smaller objects next to each other -bad if you only look at the largest object and ignore the rest

Another way to determine distance, assuming level terrain, is to just locate the y center of mass coordinate and assume a constant target height from the ground. It involves a little math, but isn't affected by the above problems.

That turret is one of the coolest things i have ever seen. I have ben wanting to something like that on a tank base forever I havent had the "funding" to do so until now. Can i ask what it would cost just to make a standalone turret like that?