View Full Version : Calculating Camera Distance
Inoperational
02-03-2007, 05:16 PM
We have the camera set up on our robot, but we are having some very annoying problems. When we hook up our laptop to the rc, it shows the distance being anywhere between -30 to 67000. If anyone has any idea on the equation for calculating distance from the camera to the green cathodes, please post here. Thanks
Branden Ghena
02-03-2007, 05:36 PM
Kevin Watson has an idea, why not try here
http://kevin.org/frc/2007_frc_range_calc.pdf
Inoperational
02-03-2007, 06:04 PM
we have that already and it is still not working
Skysong
02-03-2007, 06:39 PM
Are you able to get different tilt angles when you move the robot manually towards the light? We did that as an initial test and had the robot stop when it was ten feet away from the light.
Are you using Kevin's default camera code? That seemed to work fine for us.
Make sure when you are printf'ing you cast the data as an unsigned int.
The yellowdart
02-03-2007, 06:57 PM
Where in the code is the angle defined?
JohnC
02-04-2007, 11:48 PM
Where in the code is the angle defined?
Look in terminal.c at the printf()s that print information when the camera has found a target. If you #include the camera header files, you can use the same information that is printed regarding the tilt angle. Just copy all of the math and assign it to a variable in your code.
vBulletin® v3.6.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.