Thread: [FTC]: Infared
View Single Post
  #1   Spotlight this post!  
Unread 21-03-2010, 12:44
buddyb's Avatar
buddyb buddyb is offline
Registered User
FRC #1885 (ILITE)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2008
Location: Haymarket, VA
Posts: 65
buddyb has a spectacular aura aboutbuddyb has a spectacular aura aboutbuddyb has a spectacular aura about
Re: [FTC]: Infared

My knowledge is limited, as I use RobotC, but I believe that the calibration routine must be made manually. I suggest that you just use a file to put the intensity from two different (predetermined) distances from the beacon. You can then use those readings in teleop (assuming the calibration was done in autonomous).

The best way to get the readings, in my opinion, would be to just slam in to the lower goal, get a reading, then go backward in to the wall, and get a reading. If you don't want to do this, you could even just get a reading while the robot is waiting to start autonomous. It would be a bit less accurate (read: one datapoint instead of two), but would still work.

For calculating distances, assuming that intensity/distance graph is linear, your equation is:
intensity[calibration]/dist[calibration]=intensity[current]/dist[current].

From this, you can do:
dist[current] = dist[calibration] * (intensity[current] / intensity[calibration])

If you did more than one calibration measurement, get an average of all of the readings and store that in the [calibration] variables.

Best of luck.
__________________
FRC - Team 1885 - Programmer.
Reply With Quote