View Single Post
  #4   Spotlight this post!  
Unread 09-02-2013, 19:57
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: how to move motors using axis 206 camera

So I assume, or suggest that the camera point to the left also, similar alignment to the shooter. Determine where the shots hit the wall and align the camera so that its image contains the shot, ideally centered horizontally and perhaps with the shot to the upper third of the screen.

When the code detects a target, it returns the position in a -1 to 1 coordinate space which you can use as an error term to drive the robot forward or backward until centered. You may need to reverse the error term before feeding it to robotDrive.

Once the error is low enough, go through your shooting sequence. Especially if you are processing on the cRIO, keep in mind that the camera is a pretty slow sensor and the robot may move too far between frames if it moves quickly. Also, once target is close enough, you can disable the vision.

Greg McKakskle
Reply With Quote