|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Camera stops working when we use camera_set_servos()...
Ok so we're trying to make our camera pan back and forth until it sees the vision tetra, then lock and track. However it appears that whenever we call camera_set_servos() it stops searching for a color, and when we tell it to look for a color ( camera_find_color() ) it then appears to recenter the servos; we're stuck. Is there any solution to our problem?
This code block is inside Camera_Processing(), before it's own tracking routine. Code:
if(!tracking)
{
camera_set_servos(cnt,128);
cnt += dir;
if(cnt == 210)
dir = -5;
else if(cnt == 40)
dir = 5;
printf("Didn't find it: %d\r",cnt);
}
|
|
#2
|
|||
|
|||
|
Re: Camera stops working when we use camera_set_servos()...
After you set the servos, you have to tell the camera to track again.
|
|
#3
|
||||
|
||||
|
Re: Camera stops working when we use camera_set_servos()...
Quote:
|
|
#4
|
|||||
|
|||||
|
Re: Camera stops working when we use camera_set_servos()...
Has anyone tried using camera_set_servos() without stopping the camera or auto servos or any of that? I know it says you can't do anything other than camera_track_update() after camera_find_color(), but has anyone tried it anyway?
|
|
#5
|
||||
|
||||
|
Re: Camera stops working when we use camera_set_servos()...
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.
|
|
#6
|
|||||
|
|||||
|
Re: Camera stops working when we use camera_set_servos()...
Quote:
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;
}
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.....
}
just my 0.02 NIS (New Israeli Shekel) ![]() -Leav |
|
#7
|
||||
|
||||
|
Re: Camera stops working when we use camera_set_servos()...
Well as far as I am informed, the cameras servos must remain connected to the camera and the camera only, so that's out...Any other ideas?
|
|
#8
|
|||||
|
|||||
|
Re: Camera stops working when we use camera_set_servos()...
says who?
![]() is this in the rules or something? if it is, sounds like a rule meant to make it harder on us.... i'll go look this up now.... |
|
#9
|
|||
|
|||
|
Re: Camera stops working when we use camera_set_servos()...
ID: 1183 Section: 5.3 Status: Answered Date Answered: 1/17/2005
Q: May we connect servos to the PWM outputs on the CMUcam to take advantage of the automatic pan and tilt control that it provides A: Yes. Servos connected to the camera module are considered part of the camera module and can only be connected to it. That "only," makes it sound like no. ![]() |
|
#10
|
||||
|
||||
|
Re: Camera stops working when we use camera_set_servos()...
So... no one has figured out how to make the camera pan back and forth to look for a color?
I'm working on the problem myself, without much success. >.< If I figure anything out, I'll let ya know, but... right now it looks like we'll just be turning the whole robot back and forth if the tetra isn't in the camera's field of vision. : ![]() |
|
#11
|
|||
|
|||
|
Re: Camera stops working when we use camera_set_servos()...
Quote:
NOPE! check out question 1480: Q: Is it illegal to use the RC to control servos that control the camera? A: No. |
|
#12
|
|||||
|
|||||
|
Re: Camera stops working when we use camera_set_servos()...
What I have been trying to do just now is something that was proposed elsewhere... foget who suggested it, but the point is this is not my own idea. But basically you plug the camera servos into the RC then set auto servos on the camera, then on the RC you check the supposed servo postions and then set the servos to those positions using the pwm outputs. It should work, but there is something wrong with my compiler. Or maybe my program. Something is wrong.
|
|
#13
|
|||||
|
|||||
|
Re: Camera stops working when we use camera_set_servos()...
Quote:
ha! i knew it! i'm gonna test my code today!! thanks logical hippo! |
|
#14
|
|||
|
|||
|
Re: Camera stops working when we use camera_set_servos()...
Quote:
![]() |
|
#15
|
|||||
|
|||||
|
Re: Camera stops working when we use camera_set_servos()...
I have the same problem. Today I am going to try an idea proposed somewhere around here to use a left, right, and center position and spend a few seconds at each. I dont know if it will work, and assuming that the conclusion you came to (that resetting the camera centers the servos) it wont work, but its worth a try.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Scripting Setup and the Camera + Serial Port Drivers | CJO | Programming | 22 | 11-01-2006 17:42 |
| Unresponsive camera | neilsonster | Programming | 9 | 17-02-2005 08:51 |
| Camera not working when connected to robot | MarkVH | Programming | 5 | 14-02-2005 15:40 |
| Kevin Watson's Kick-off Demo Code! | Mr. Lim | Programming | 27 | 22-01-2005 03:38 |
| CMUCam2 Camera Code - Are important parts commented out? | Mr. Lim | Programming | 4 | 14-01-2005 12:11 |