|
Re: Moving robot while tracking with camera questions...
You might want to use trig fuctions to calculate the horizontal distance of target.
first include <math.h> where ever you want to do the trig calculations.
then look in terminal.c for the pan angle and tilt angle ratios
65/124 degrees for every pan pwm increment and 25/50 degrees for every tilt pwm increment
going to have to make it output 0 degrees when looking completely horizontal
adjust the -124 value
then just set up the equation
target_distance = height/tan(tilt_angle)
height = the vertical distance between the camera on the robot and the green light.
you can just make pwm03 = p1_y for example
you need to uncomment the default() function and remember to comment out the pwm's being used by the camera
Last edited by 6600gt : 30-01-2006 at 22:58.
|