View Single Post
  #10   Spotlight this post!  
Unread 15-02-2012, 10:16
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 Greg McKaskle View Post
I think that if you look at the Rectangle processing, it has already defined the X and Y position to be in the range of -1 to 1 to be more like a joystick. Unless that code has been removed, subtracting 320/2 doesn't make sense.

Greg McKaskle
Then what about comensating for the pixel offset as mentioned?

Quote:
Originally Posted by plnyyanks
In LV, there's a PID palate, and you place PID.vi onto your block diagram. You will want to wire the offset between the center (x) of the target and the center of the image (
Code:

Code:
offset = xCenter - (xResolution/2)
) as the process variable to the PID controller, and put the setpoint at 0 (you want the center of target to be exactly in the center of your image).
This post clearly states there must be an offset created and it makes sence. If there is no offset then how would the PID controller know the error and hence how to correct for it?
Reply With Quote