View Single Post
  #8   Spotlight this post!  
Unread 11-04-2016, 21:37
Hitchhiker 42's Avatar
Hitchhiker 42 Hitchhiker 42 is offline
Roboter
AKA: Mark Lavrentyev
FRC #4557 (FullMetal Falcons)
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: Cromwell, CT
Posts: 458
Hitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to behold
Re: Angle Calculation from image of goal

Here is some LabVIEW code that tackles this problem...

The way the VI works is it takes your current gyro heading, and does some trigonometry to find the needed gyro heading and the current distance from the goal (might be helpful if you have a certain distance range you can shoot from).

Make sure to set the constants in the code (I've commented it mostly, but the important ones are the goal target width (in feet), the camera's horizontal angle of view (in degrees), and the image width (in pixels)...
Disregard the Disabled code at the bottom.

Hope this is helpful, feel free to PM me with any questions.
Attached Files
File Type: vi vision angle analysis.vi (24.5 KB, 19 views)
__________________



2016 - NE District Championship Entrepreneurship Award
2016 - Hartford District Industrial Design Award
2016 - Waterbury District Engineering Inspiration Award
Reply With Quote