View Single Post
  #3   Spotlight this post!  
Unread 19-06-2012, 14:12
Tommy F.'s Avatar
Tommy F. Tommy F. is offline
Yeah! Collages!
AKA: 7h0m45
FRC #1985 (Robohawks)
Team Role: Alumni
 
Join Date: Mar 2011
Rookie Year: 2010
Location: St. Louis, MO
Posts: 188
Tommy F. is just really niceTommy F. is just really niceTommy F. is just really niceTommy F. is just really nice
Re: Vision Tracking Tutorial

The directory C:\Program Files\National Instruments\LabVIEW 2011\examples\FRC\Vision\Rectangular Target Processing should bring you to the Rectangular Target Processing vi's and project. During the season we took this and adjusted it so we could find targets.

The processing takes the image and converts it to an X/Y coordinate grid, where x=0 and y=0 are the center of the image. When the program reads targets, it shows the x and y coordinates of the center of that target.

To find the target (the highest one), we compared the target's y coordinates, and chose the target with the highest y value. Then for changing the orientation of the bot, we got the x coordinate from the target with the highest y coordinate and made that the process variable for our PID loop, and put 0 as the setpoint for our PID loop. We then used a gyro on our robot and compared it with the process variable, to see which direction the bot needed to go (a negative x value would mean turn right, a positive left) until the output of the PID was at 0.

Or at least I think that's how we did it. It's been a while. I'll be sure to look over this again in the near future so I might be able to help you out more.

Oh, and all of this didn't require the use of the NI Vision Assistant, since most of the code you need is already in the Rectangular Target Processing example.
__________________

FTC 289, 290 & 291 :: FRC 1985

2013 St. Louis Regional Semi-Finalist (with 3411 and 4330), Industrial Design Award
2013 Queen City Regional Winner (with 379 and 447)