View Single Post
  #7   Spotlight this post!  
Unread 21-01-2006, 20:06
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 751
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: get distance from cmucam

I might be way off base here...

but what we did was make a global varible called cam_Size. Then in the "Capture Tracking Data", there is a pull down box called Region Size. We selected cam_Size in that box. cam_Size needs to be declared as an unsigned char in your globals.

Region size is the size of your "blob" from the CMU cam. The closer you are to your color tracking parmeters, the larger the "blob" will appear on the screen. The futher away you are, the smaller the region will be on the screen.

This relationship is almost linear.

Let's assume that you get a region size of 255. That would mean your camera lens is right ontop of your light or let's just say 1 foot away.

Then let's assume you get a region size of 1, and you note that your camera is 30 feet away.

Everything inbetween can be calculated on a linear scale with some kind of a conversion factor.

(note, I didn't crunch the numbers, I just assumed for this topic of discussion)

1 foot = 255
1.1 feet = 254 etc...

29.9 feet = 2
30 feet = 1
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369