Quote:
|
Originally Posted by Matt Krass
It works, but it calls camera_stop() in camera_set_servos(), which interestingly enough makes it stop..everything, color tracking included. Without camera_stop() it jsut seizes up the camera.
|
just an idea, but.....
what if:
1)you took the pwm out on the camera, and connected that to the pwn in on the robot controller.
2)connected a pwm out from the robot controller to the servos on thecamera mount.
now all you need to do is decide on the software level when you want to track and when you want to keep panning.
Code:
if (!tracking) //if the caera isn't trying to track - pan
{
pwm_15=cnt;
cnt += dir;
if(cnt >= 210)
dir = -5;
else if(cnt <= 40)
dir = 5;
printf("Didn't find it: %d\r",cnt);
}
else if (tracking) //if the camera is trying to track, give the servos it's values.
{
pwm_15=pwm_in15;
}
one problem might be that the camera wouldnt know where it started, and if it needs its current location to move the servos correctly, you would need to compensate somehow:
Code:
else if (tracking) //if the camera is trying to track, give the servos it's values.
{
pwm_15=(cnt-127)+pwm_in15; //if the camera expects to start from 127, then you need to compenstae, because it thinks it's starting at a different place.....
}
(cnt-127) gives you the offset....
just my 0.02 NIS (New Israeli Shekel)

-Leav