CURRENT ISSUE
Contests
FEATURE ARTICLE
|
|
Issue #224 March 2009
Vision-Guided Robotics
A Next-Generation Balancing Robot
by Hanno Sander
Start | Parallax Propeller | ViewPort | The DanceBot | Frame Grabber | Real-Time Tracking | Line Following With A Camera | Track A Pattern | Find A Beer Bottle | Wrap Up | Sources & PDF
LINE FOLLOWING WITH A CAMERA
You can control the behavior of the robot by shining a bright light at the camera. This works in some environments where you can control the lighting and ensure that no other objects reflect or create light to the camera that’s brighter than your flashlight. It’s also an active method, where you have to power the flashlight. I’ll now describe a filter that is less restrictive and uses a passive method to steer the robot.
Most line-following robots use two phototransistors to stay on a line. They’re programmed to ensure that one detector is on the dark line while the other is on the lighter background. More sophisticated robots use additional detectors to detect the robot’s exact position on the line to look ahead or even to recognize junctions. In this section, you’ll build a filter that uses your existing frame grabber to perform line following with a camera.
Again, your frame grabber gives you too much information, so you need to design a filter that will steer a robot in the middle of a line. Tilt the robot’s camera so its field of view is from below the horizon to just in front of the robot. Now, you can stream the video to ViewPort and analyze what the video of a properly programmed robot would do. It will become apparent that a good algorithm involves averaging the location of the darkest pixel in each line. This is quite robust, easy to program, and gives a good control signal to the robot. Again, integrating this filter with the rest of the DanceBot is straightforward. Just use the average position of the line to control the direction of the robot while it’s moving along at a set speed (see Listing 4).
Previous | Next *| Subscription Deals |*
|