View Single Post
  #9   Spotlight this post!  
Unread 11-02-2013, 13:45
Doron_Sivan Doron_Sivan is offline
Registered User
FRC #4590 (GreenBlitz)
Team Role: Programmer
 
Join Date: Oct 2012
Rookie Year: 2013
Location: Israel
Posts: 11
Doron_Sivan is an unknown quantity at this point
Re: |Calculating Distance to targets

First to Ginto8,
I looked at Miss Daisy's code they calculated the vertical FOV angle by the formula (which seems to me right):
Quote:
VerticalFOVAngle = ImageHeightPixels / ImageWidthPixels * HorizontalFOVAngle;
If we are using the values of the current camera the vertical angle would be something around 33 degrees and not 36..


and to DELurker, (and also it connects to Ginto8)
we would check ourselves the FOV vertical and horizontal angle, and not rely on what the pdf says.

As for our code, it was just calculating the average height of the target by its 4 outer points, and the rest is the formula I showed in the beginning using some constants (we will correct them as you suggested).

It didn't work, so we thought about trying the code of Miss Daisy, we didn't try it yet, but we will right soon as we will.
We will also try the last code with the 2 meters errors again with fixed angle and also with 16 points average and not 8 like before.

Thank you very much, we will update you when we will check it.
If you have more suggestion, or you tried one of those codes and it wroked please tell us!