|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Angle Calculation from image of goal
Quote:
![]() |
|
#2
|
|||||
|
|||||
|
Re: Angle Calculation from image of goal
Quote:
What's your setup for both the camera and processor? |
|
#3
|
||||
|
||||
|
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. |
|
#4
|
||||
|
||||
|
Re: Angle Calculation from image of goal
I believe they are using a Nexus 5 with on-board vision processing
![]() |
|
#5
|
|||||
|
|||||
|
Re: Angle Calculation from image of goal
If you've found the answer above, please disregard, but this is how we've done well:
Position the robot roughly aligned with the goal (that is, eyeball it). Do a test launch. Note where the ball ends up, in terms of inches/feet to he left or right of the goal. Rotate the robot a known amount (probably measured in terms of encoder counts on the left and right drive systems). Do another test launch. Note where the ball ends up (same criteria). Based on the two measurements above, calculate a "target point" that will result in a goal, and a "proportionality constant" to get there wif the robot is pointed somewhere else. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|