View Single Post
  #4   Spotlight this post!  
Unread 05-02-2007, 16:41
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Desperate for help in camera tracking

Quote:
Originally Posted by itsme View Post
:::EDIT:::
I thought about it, and isn't it easier to calculate the exact tilt location according to the centroid_y (after the conversion to rotation, 239 centroid_y pixels are 255 rotation ticks--> 255/239=1.066... rotation ticks for each pixel. So if the centroid_y is let's say at 150, then the rotation has to be:
Code:
rotation=(int)centroid_y*(255/239); // or rotation=(int)255-centroid_y*(255/239);  Depends on the centroid_y direction.
SetPWM(Port_2,rotation)
Same thing about the pan servo (but not necessarily with centroid_x).
Correct me if I'm wrong please.
I'm glad you got it. I'm a horrible teacher; I was just about out of ways to help you.

Yes, it seems that you've got the solution. Just make sure it indeed does work--test it thoroughly.

Good luck and feel free to keep asking questions. That's how you learn.

JBot
__________________
Aren't signatures a bit outdated?