Go to Post To quote Dylan, "When you aint got nothing, you got nothing to lose". - KenWittlief [more]
Home
Go Back   Chief Delphi > Technical > Programming
Team 51   CD-Events   CD-Media   CD-Swap   CD-Spy   FRC-Spy   Unsung FIRST Heroes   WFA
portal register members calendar search Today's Posts Mark Forums Read FAQ rules
VEXpro
The Chief Delphi Forums are sponsored by Innovation First International, Inc.
The Chrysler Foundation
ADVERTISEMENT

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-19-2012, 11:26 AM
4085's Avatar
4085 4085 is offline
Technical Difficulties
AKA: Sebastian Brosious
FRC #4085 (Technical Difficulties)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Reynoldsburg, Ohio
Posts: 14
4085 is an unknown quantity at this point
Vision Tracking Tutorial

Hello fellow programmers! Once again the Rookie team 4085 is pleading for help, for vision tracking explanations are either vague and or too confusing so i beg of help to program in to autonoumus a vision tracking camera that will move the tank drive wheels on our robot and shoot once aimed. We use labveiw and sorry for asking so much questions gotta start somewhere >.<
__________________
_______________________________________________

WE ARE...

Raiders!
Reply With Quote
  #2   Spotlight this post!  
Unread 06-19-2012, 11:35 AM
daniel_dsouza daniel_dsouza is offline
does what needs to be done.
FRC #2134 (AZtec)
 
Join Date: May 2011
Rookie Year: 2011
Location: Chandler, AZ
Posts: 207
daniel_dsouza has a spectacular aura aboutdaniel_dsouza has a spectacular aura about
Re: Vision Tracking Tutorial

Have you read this: https://decibel.ni.com/content/docs/DOC-20173

It goes through the logical steps of finding and tracking the targets using NI's Vision assistant software (that writes Labview code).

I don't often use Labview, but I am pretty sure there is a sample program that tracks targets.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-19-2012, 01:12 PM
7h0m54's Avatar
7h0m54 7h0m54 is offline
Not just the programmer anymore...
AKA: Tommy F.
FRC #1985 (Robohawks)
Team Role: Programmer
 
Join Date: Mar 2011
Rookie Year: 2010
Location: St. Louis, MO
Posts: 162
7h0m54 is just really nice7h0m54 is just really nice7h0m54 is just really nice7h0m54 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.
__________________

FRC 1985 :: FTC 289, 290 & 291 :: Team 1985's Wiki Page :: Team 1985's Website

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

Reply With Quote
  #4   Spotlight this post!  
Unread 06-22-2012, 03:00 PM
4085's Avatar
4085 4085 is offline
Technical Difficulties
AKA: Sebastian Brosious
FRC #4085 (Technical Difficulties)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Reynoldsburg, Ohio
Posts: 14
4085 is an unknown quantity at this point
Re: Vision Tracking Tutorial

Thanks , im having a question relating to the vision tracking, how do I get the information coming from the processed images into a tank drive value in autonomous. please and thank you we have an off season competition tommorow
__________________
_______________________________________________

WE ARE...

Raiders!
Reply With Quote
  #5   Spotlight this post!  
Unread 06-22-2012, 03:09 PM
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #0364 (Team Fusion)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Gulfport, MS
Posts: 992
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Send a message via Skype™ to RyanN
Re: Vision Tracking Tutorial

Quote:
Originally Posted by 4085 View Post
Thanks , im having a question relating to the vision tracking, how do I get the information coming from the processed images into a tank drive value in autonomous. please and thank you we have an off season competition tommorow
Ahah! So that's what they want you to figure out. Look at what data is available to you. Isn't there a nice array of targets found? How about simpiy index the first array element. Now what does each element of the array hold? Well there is an X and Y coordinate. When you're centered on the target, x should read 0.

Maybe that's enough to get you going.
__________________
Controls Mentor
firstfusion364.com
Reply With Quote
  #6   Spotlight this post!  
Unread 06-22-2012, 03:22 PM
JamesD's Avatar
JamesD JamesD is offline
Registered User
AKA: James David
FRC #0330 (BeachBots)
Team Role: Parent
 
Join Date: Jun 2012
Rookie Year: 2008
Location: Torrance, CA
Posts: 4
JamesD is an unknown quantity at this point
Re: Vision Tracking Tutorial

Here's some links that should help:

Labview - incorporating rectangular target processing.vi
http://www.chiefdelphi.com/forums/sh...d.php?t=104516

Vision Tracking Help:
http://www.chiefdelphi.com/forums/sh...d.php?t=104330
Reply With Quote
  #7   Spotlight this post!  
Unread 06-22-2012, 06:56 PM
daniel_dsouza daniel_dsouza is offline
does what needs to be done.
FRC #2134 (AZtec)
 
Join Date: May 2011
Rookie Year: 2011
Location: Chandler, AZ
Posts: 207
daniel_dsouza has a spectacular aura aboutdaniel_dsouza has a spectacular aura about
Re: Vision Tracking Tutorial

Quote:
Originally Posted by RyanN View Post
Ahah! So that's what they want you to figure out. Look at what data is available to you. Isn't there a nice array of targets found? How about simpiy index the first array element. Now what does each element of the array hold? Well there is an X and Y coordinate. When you're centered on the target, x should read 0.
Depending on how you processed your image, you might just get the x,y of the pixel coordinates. So if this is the case, and you want a number -1<=x<=1, use this formula:

drivingValue = (pixelValue - (maxImageDimension / 2)) / (maxImageDimension/2)
where maxImageDimension is the size of that image axis.

That way, you can get an value between that could easily be plugged into an algorithm or speed controller. (ex. 640,480 turns to 1,-1)

Hopes this helps. Good luck tomorrow! (I Wish my team was doing something offseason)
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:50 AM.

The Chief Delphi Forums are sponsored by Innovation First, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © Delphi and Pontiac Central High School