View Single Post
  #10   Spotlight this post!  
Unread 01-02-2006, 19:16
maniac_2040's Avatar
maniac_2040 maniac_2040 is offline
Registered User
AKA: Matt
FRC #3302 (Turbo Trojans)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Clawson, Michigan
Posts: 34
maniac_2040 is infamous around these partsmaniac_2040 is infamous around these partsmaniac_2040 is infamous around these partsmaniac_2040 is infamous around these parts
Send a message via MSN to maniac_2040
Re: Camera Is Spazzing Out!

One way to combat the camera locking onto fluorescent lighting or really bright lights is to make the camera code check the confidence level of the tracked blob. For us, when the camera "locked" onto any light other than the actual vision target it would have a very low confidence level and sort of "spaz out" (i.e. jerky). I made the code check the confidence level for a higher value and it seemed to fix the problem.

The code you need to change is in tracking.c, in the function Servo_Track() near the beginning. There's a line that looks like this:

if(T_Packet_Data.my != 0)

Which checks if the camera found a target, you simply change it to make sure the camera found a 'good' target like so:

if(T_Packet_Data.my != 0 && T_Packet_Data.confidence > some_value)

I just sort of tweaked around 'some_value' till I got good results. A confidence of 80-90 seems pretty good.