View Single Post
  #2   Spotlight this post!  
Unread 24-09-2013, 09:42
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,738
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: RobotBuilder/Java help

With a servo, you can tell it a precise angle to turn to - you don't need the potentiometer.

So, lets say you have the horizontal servo set to 0.50. You look at the camera feed, and notice that the center of the target is a few pixels to the right of center. So, change the servo value to 0.51 and look at the new image. Now how many pixels off are you? Gather some data on this so you can make an equation or a small look-up table that tells you how far to turn based on how far off you are. The picture dimensions define a fixed area to work in, which makes this sort of thing a little easier. Once you have that, go to your ideal shooting location, get lined up, and look at what values you're setting your servo's to - that's what you want to try to hit for a good shot.

Personally, however, my team has found a simpler solution to be a bit easier to work with in the past. We mount the camera at a fixed angle, and then overlay a target on the image (this can be done as easily as taping some clear overhead paper to the computer monitor and drawing on it with sharpie). This way the drivers can look at the image and judge how well lined up they are!
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA
Reply With Quote