Go to Post Our wheels just keep falling off. - SenorZ [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 2 votes, 3.00 average. Display Modes
  #1   Spotlight this post!  
Unread 01-02-2012, 21:33
Neko81795 Neko81795 is offline
Registered User
FRC #1318
 
Join Date: Feb 2012
Location: Issaquah
Posts: 2
Neko81795 is an unknown quantity at this point
Math for Finding the distance to the hoop

This is a XML slideshow showing how to find the distance from the turret to the hoop using the distance and angles from the camera to the backboard. if there are errors in my math, please correct me.





file is up to date as of 2/2/12 3:23 PM
Attached Files
File Type: pdf finding the distance to the hoop.pdf (228.9 KB, 101 views)

Last edited by Neko81795 : 02-02-2012 at 18:23.
  #2   Spotlight this post!  
Unread 02-02-2012, 10:07
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,624
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Math for Finding the distance to the hoop

I have a question...I can see how you could get the Kinect camera to find the distance to the backboard. However, how did you get theta (the angle of the camera to the backboard)?
  #3   Spotlight this post!  
Unread 02-02-2012, 10:24
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,725
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Math for Finding the distance to the hoop

I would also think about fixing the camera at a set angle, you get a good range of visibility. Then you can find distance based on where on the screen the target is.
  #4   Spotlight this post!  
Unread 02-02-2012, 10:28
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Math for Finding the distance to the hoop

Quote:
Originally Posted by Neko81795 View Post
if there are errors in my math, please correct me.
Mostly typos:

Page 10 first equation has the denominators swapped

Page 16 what's the area calculation for? you can get H directly from sin(90-(theta+s))=H/Q

Page 19 should be sin(90-(theta+s))


Here's another way to do it:

Code:
I = 180-o

T = sqrt[R^2 + C^2 - 2*R*C*cos(I)]     (Law of Cosines)

s = asin((R/T)*sin(I))     (Law of Sines)

w = 90-(theta+s)   <-angle between T and Q

H = Q*sin(w)

B = Q*cos(w)

F = sqrt[H^2 + (T-B)^2]


Last edited by Ether : 02-02-2012 at 11:16.
  #5   Spotlight this post!  
Unread 02-02-2012, 18:18
Neko81795 Neko81795 is offline
Registered User
FRC #1318
 
Join Date: Feb 2012
Location: Issaquah
Posts: 2
Neko81795 is an unknown quantity at this point
Re: Math for Finding the distance to the hoop

Sorry about those typo's. Here are the changes. also, my calculations were in deg. i changed them to rad which is what the coding usualy uses. Ether is right about using the law of cosines, I just went over it today and couldn't remember it before. that was my fault.

we are not using the kinect. we are using the axis camera and ratios to find the distance and angles. however, I wasn't working on getting the images, i just did the math so I can't help you there.

Last edited by Neko81795 : 02-02-2012 at 18:22.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 19:02.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi