Right now, when you square up the camera with our chassis, the actual field-of-view (which we found to be around 42* in the pan direction) is about 75% on the right side of our 'bot. We have adjusted the Pan Target pixel so that when tracking the camera unit points straight at the target, but now I am thinking that this isn't really desirable. Who cares where it points, you want the mx values on the center of the image sensor, right? Wouldn't that give you a better chance of not losing the light?
What about using pwm.h to adjust the PWM_CENTER value like so:
- Put the light directly in front of your camera/robot but far enough away from it, so that blob size is just a few pixels.
- The camera should aim to the left or right of it if the pan tracking pixel is at the center of the image sensor (default).
- When the terminal shows that pan error is close to zero pixels (try to get it within one) then record the pwm value being sent to the pan servo.
- Add (127 - pwmValueWithZeroPanError) * PWM_GAIN to PWM_CENTER for the pan PWM (or subtract--test which one helps).
Now a pan servo of 127 should mean the light is dead ahead (though the camera unit will be pointed away from it).
Is this better than changing the pan target pixel?
Thanks in advance,
Robinson Levin
[Note: I think that there is an underlying assumption in the adjust above that your previous PWM_CENTER value made a pwm output of 127 point the camera straight ahead, right?]