|
Re: Question from a Coach
My approach to the triangulation is like you said. I declare the camera to be at (0,0), and I input the object's width, and the angles that the camera is viewing the right and left edges of the object at.
I can then calculate the coordinates of the object, and from that find the distance and angle required to hit it.
However, I don't know how to find the angle that the camera is viewing the object at.
I would imagine that the simplest way would be to take the position the object is on the screen (in relation to the center), multiplying it by some constant, and then putting that number through an ArcSin function.
I think this would get the angle that the object's angle in relation to the center of the field of view.
Basically:
ArcSin((Position on Screen - Center of Screen) / Screen Width) = Angle Object is viewed at.
If the camera was a typical FRC Camera found in the kit of parts, would this be correct?
__________________
"We're all nerds here, no need to be socially awkward"
"Oh, you want to know what I would do? I'd make a helicopter."
Once a FIRST Student, ALWAYS a FIRST Student
|