Home / Experiments / Pan and Tilt Rig for NXTCamV3 and Firmware Tests

Pan and Tilt Rig for NXTCamV3 and Firmware Tests

Look over here!  No, not over there, here!I’ve been meaning to build something cool with the NXTCamV3 for a while now but never got around to it. I tried making the Omniwheel suitable for the NXTCam but unfortunately the wheels cause way too much vibration when the robot moves.  Oh well, in the not so distant future I hope to pick up a few of these babies: [LINK].

On Friday night I quickly put together this pan and tilt rig you see in the rather crappy picture to your left.  That’s me holding the can, coaxing the camera to track it.  I took this picture by accident, in fact, I meant to hit the record video button instead.  Still, it turned out OK-ish.

The rig’s motors are controlled by two simple PID controllers that look at the X and Y values of the first (and largest) object returned by the camera.  They work independently together to keep the camera centered on the can.  There is no rotation limit imposed which can be a real pain in the butt when the camera loses track of the can and goes nuts looking for it.

I made another video related to the NXTCamV3 today.  This one is a performance test of my firmware (BlobMerge V0.2) versus the standard NXTCam firmware.

For these tests I used the NXTCamV3 with the BlobMerge firmware and an NXTCamV2 with the standard firmware.  The data is read via USB by the NXTCamView program and captured by CamStudio.  In good indirect natural light both firmwares perform similarly.  It’s when you start using incandescent light that you can really tell the difference.  The standard firmware returns lots of small objects due to the shadows and bad lighting conditions.  The BlobMerge firmware remedies this situation by:

  • Merging all objects that are touching or separated by no more than 30 pixels;
  • Tracking 12 objects (merging reduces the total number of objects) internally instead of 8 and returning the 8 largest ones;
  • Removing all objects smaller than 250 square pixels, these are most likely artefacts;
  • Sorting all the objects according to size, largest one first.

This allows you to track just a single object in your program, the first one as this is most likely the object you are after.

So there you have it, a weekend well spent, I’d say.  You can download the sources for test rig program here: [LINK].  You can download and compile the firmware by checking it out via SVN from this location: [LINK].

About Xander

Xander Soldaat is a Software Engineer and former Infrastructure Architect. He loves building and programming robots. He recently had the opportunity to turn his robotics hobby into his profession and has started working for Robomatter, the makers of ROBOTC and Robot Virtual Words.