View Single Post
  #1   Spotlight this post!  
Unread 11-02-2007, 14:34
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: Value of degree to calculate range?

i dunno where you learned that you need radians... i use degrees. if you look in tracking.H, you'll see the upper and lower servo limits are (i think) 160 and 94. It also says that that's approximately +25 deg and -25 deg. so degrees per servo step is 25/33. then, you need to find the number of servo steps either up or down. i did something like:
Code:
unsigned float Find_Distance(void)
{
     double angle;
     double range;
     angle = (TILT_SERVO-127)*.757575;
     range = HEIGHT_DIFF /*that's 116- camera height*/ /atan(angle);
     return(range)
}
make sure to double check, but this should do it...
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."