Go to Post If you're a spectator that's going to complain about a "bad" call, you darn well better know for a FACT that the call was "bad". - AmyPrib [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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.
Chief Delphi Alumni
ADVERTISEMENT

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-08-2012, 02:12 PM
Teamcodeorange's Avatar
Teamcodeorange Teamcodeorange is offline
Registered User
FRC #3476
 
Join Date: Jan 2011
Location: US
Posts: 184
Teamcodeorange is a name known to allTeamcodeorange is a name known to allTeamcodeorange is a name known to allTeamcodeorange is a name known to allTeamcodeorange is a name known to allTeamcodeorange is a name known to all
Exclamation Vision Tracking, now what :)

Ok, so, Code Orange won the San Diego regional with the Super Nurds and team 4161. We did well but I want to optimize the robot as much as possible before championship. At San Diego I had to manually line up with the hoop using the camera feed. It took a while longer than I would have liked.

So... I would like to use some simple vision tracking turning the robot side to side (x axis of the joystick) to align with the hoop. Code Orange bought a second cRio this year so that isn't a problem. I have already calibrated the camera to be able to consistently find the x and y values from the vision tracking example. I need help telling the drivetrain to line up with the top vision target. I understand how I would need to sort through the 4 hoop's coordinates and choose the x value of the target with the highest y value. I made a proof of concept that tracks the target with a servo, but it always overshoots so I know I need a PID loop to make the drive train act how I want it to. The thing is I don't know how to do any of that.

tl;dr I need help figuring out how to make the -1 to 1 "x" values of the vision tracking .vi into something that tells the drivetrain to line up with the target. (preferably with a PID loop)

If you need my code please ask.

Thanks for your time

Last edited by Teamcodeorange : 03-08-2012 at 03:08 PM.
Reply With Quote
  #2   Spotlight this post!  
Unread 03-09-2012, 12:04 PM
Teamcodeorange's Avatar
Teamcodeorange Teamcodeorange is offline
Registered User
FRC #3476
 
Join Date: Jan 2011
Location: US
Posts: 184
Teamcodeorange is a name known to allTeamcodeorange is a name known to allTeamcodeorange is a name known to allTeamcodeorange is a name known to allTeamcodeorange is a name known to allTeamcodeorange is a name known to all
Re: Vision Tracking, now what :)

Well, looks like I need this to be in the new posts page to get any help.
Reply With Quote
  #3   Spotlight this post!  
Unread 03-09-2012, 01:54 PM
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,300
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Vision Tracking, now what :)

I don't think anyone is answering since there have been numerous threads on this topic already. Search the forums a bit and if you have any specific questions, post them.
__________________
-
An ounce of perception is worth a pound of obscure.
Reply With Quote
  #4   Spotlight this post!  
Unread 03-09-2012, 02:03 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is online now
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 7,061
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Send a message via AIM to Alan Anderson
Re: Vision Tracking, now what :)

Quote:
Originally Posted by Teamcodeorange View Post
tl;dr I need help figuring out how to make the -1 to 1 "x" values of the vision tracking .vi into something that tells the drivetrain to line up with the target. (preferably with a PID loop)
How would you do it as a driver controlling the robot by hand? Come up with a good answer to that, and you might be able to implement it in code so the robot can control itself.
Reply With Quote
  #5   Spotlight this post!  
Unread 03-18-2012, 09:48 PM
Brandon_L's Avatar
Brandon_L Brandon_L is offline
Sometimes I give myself the crepes
AKA: Brandon Liatys
FRC #2495 (Hamilton West Robotics)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Hamilton, NJ
Posts: 861
Brandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond repute
Re: Vision Tracking, now what :)

We are having the same problem. Ill get you up to speed with where we are right now -

It seems like you filtered out all the target info to get what you want. Now from there, look up camera specs for field of vision. We are using the axis 206, which has 48 degrees of vision. So from -1 to 1 is 48 degrees. 48/2=24, so its 24 degrees each way from the center. So what you want to do is take the X value from the camera for your target, and multiply it by 24. This will give you how many degrees you want to turn. (example - X value of 0.5 * 24 = 12 degrees).

From here, it depends if your using a gyro to sense robot turning, or encoders on your drivetrain. We tried both and got farther with the gyro but its still not great.
__________________
Attending: Hatboro-Horsham, TCNJ, Lenape, Bridgewater-Raritan, MAR Champs, IRI, Monty, MidKnight Mayhem, Duel, Ramp Riot, BE

2007-2013: FRC#2495 - Hamilton West Robotics - Lenape-Seneca DISTRICT WINNER
2012-2013: FRC#3929 - Atomic Dragons
2013-????: FRC#???? - Looking for a team in the Newark, NJ area!
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 08:52 PM.

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