Help with image processing

After I make a vi for image processing in the vision assistant software and upload it to my robot programming, how do I make the camera track what I specified? For example, I want the camera to track a square and I mount the camera on a servo. How do I program the servo to move for the camera to track?

The default code did this in 2009, and in LV the example still ships. It is called Two Servo Camera Control or something like that.

Think about the center of the camera image as the origin. If the target is not in the center, it is some distance away, and that error term can be scaled and added or subtracted to the servo value to “center” it. The servo already has mechanism to maintain its position, so you only need to give it a set point. Play around with a 1D version of this and I think you’ll find it easy to do. Then add the second dimension.

Greg McKaskle

Thanks, but lets say I didn’t want the servo to move and the robot had to turn to point at the target. How does the robot know whether to use a servo or the drive motors? Do I program the servo or motors in vision processing vi?

Well you asked about a servo, and if you have never done this before, that is a pretty easy way to experiment.

If you later want to rotate the robot, you now need to work on getting the robot to pivot and stop at a particular direction. This is quite a bit harder than a servo or lazy-susan turret, but using a PID or other control algorithm and a gyro will be a good place to start.

The default 2010 code contained simple code that used an image to locate the circular target, and a gyro and PID to turn the robot to point at the target.

Greg McKaskle