View Single Post
  #6   Spotlight this post!  
Unread 09-02-2012, 21:19
VelocityofGear's Avatar
VelocityofGear VelocityofGear is offline
Registered User
FRC #4347 (Mechanical End)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Paterson
Posts: 5
VelocityofGear is an unknown quantity at this point
Re: Extrapolating Direction From Images

Quote:
Originally Posted by plnyyanks View Post
It really depends on how exactly you code the auto-aiming. If you use PID to get the target in the center of the camera's field of view, then it's really just a matter of tuning the PID parameters to get the best results from your system. There are many ways to tune a PID controller, but one of the most common (and easiest to implement in our timeframes) is a guess/check and Ziegler–Nichols combination. I'm not sure there's really much information to post.

But if you have specific questions about the logic/methodology behind auto-aiming, ask away, I'd be happy to answer.
Hello.

Attached is the portion of the code I am using to control a motor to align to a target. I am encountering problems in determining the logic to have the motor focus on the target chosen.

From the picture, I have taken the position of the x-value and specified when the value is less than 0.09 and greater than -0.09 to assign an output of 0, allowing the motor to stay fixed on the target. Yet when the values are out of this range, I'm looking for the motor to move clockwise or counter-clockwise to set its value within that range. I am having trouble using the x-position to center itself on the target.

We have read through the Vision Target processing and checked FRCMastery's section on vision processing; however, we are still having trouble.

Any pointers would be greatly appreciated. Thank you in advance for your responses and time.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	74
Size:	20.9 KB
ID:	11826  
Reply With Quote