View Single Post
  #3   Spotlight this post!  
Unread 02-04-2016, 20:19
simon-andrews's Avatar
simon-andrews simon-andrews is offline
Registered User
FRC #4761 (Robockets)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2015
Location: Reading, MA
Posts: 16
simon-andrews is an unknown quantity at this point
Re: How can angle offset of a shooter be calculated from pixel offset?

Quote:
Originally Posted by Arhowk View Post
You clearly calculate angle_offset right in that code...

Are you asking how to make a PID loop to turn the robot?
No. That function isn't what I need because it doesn't return an angle that can be plugged into the turntable. The program I'm supposed to write should be able to look at an image and figure out "Alright, turntable. You need to turn 45 degrees if you want to be on-target."

If we look at this drawing from an earlier post, both lines (which represent pixel offsets) are 100px long. With the function from before, both would return the same angle offset since the function doesn't account for distance away from the target.
__________________

GitHub | StackOverflow
Reply With Quote