Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Camera not working in autonomous (http://www.chiefdelphi.com/forums/showthread.php?t=44865)

Roger 28-02-2006 22:40

Camera not working in autonomous
 
Why oh why does my camera not work in autonomous mode? It tracks fine in manual mode, but when we switch over it drops dead in its tracks. We just uploaded Kevin's frc_camera_2.zip and shifted everything over, and added Kevin's changes (which wasn't that much) in our user_routines.c and user_routines_fast.c (the only two files we played with.) Any places we should be looking?

Thanks!

Roger.

Alan Anderson 28-02-2006 23:09

Re: Camera not working in autonomous
 
Make sure you're calling Camera_Handler() and Servo_Track() from within the autonomous loop. Put the function calls after the GetData() call.

Disclaimer: I don't have the code handy to check spelling. If you know what you're doing, you know what I mean.

Denz 28-02-2006 23:10

Re: Camera not working in autonomous
 
Try calling
Camera_Handler();
Servo_Track();
in your autonomous mode where u want it to track. I think that's all you need.

EDIT: Ah, looks like Alan beat me to it. Oh well :).

Roger 01-03-2006 07:43

Re: Camera not working in autonomous
 
Ah! Could it be that simple? I guess I trusted Kevin's code too much; after all, the zip package was written with the camera in mind. I did see this answer in another post for a different problem after I posted the question, but it didn't work (for that post) and it was too late to test it here (insert sleepyhead smilie here).

Oh, and Denz, the early bird gets the worm, but the second mouse gets the cheese!

Thanks guys!

Roger.

lkdjm 06-03-2006 17:05

Re: Camera not working in autonomous
 
If this solved your problem, then great. The way Mark McLeod showed me how to do it was by copying everything that had to do with the camera initialization into a new file, make it its own function like camera_init(), and then calling it as the first thing in autonomous.

Roger 08-03-2006 08:53

Re: Camera not working in autonomous
 
It did work, at least when we tested it on our old robot from last year. We had little chance to really test it until we got to Manchester. It's neat watching that little camera track the light and the "turret" following the camera. It even caught one across the room in the pits and another that was halfway up in the seats. Now _that's_ tracking!

The issue now is the two of them don't agree which way "forward" is supposed to be. The camera is facing the light and the turret is about 30~40 degrees clockwise from that. (The camera mounting is squared off with the turret.) I'm wondering if it's a software calibration or (easier for me!) hardware adjustment. Any suggestions?

lkdjm (aka David Mazza), I notice you're from the same island I'm originally from; long ago I graduated from Herricks HS in New Hyde Park, a school that surprisingly doesn't have robotics. Small world. Good luck at Hofstra!

Roger.

Mark McLeod 08-03-2006 10:22

Re: Camera not working in autonomous
 
Quote:

Originally Posted by Roger
The issue now is the two of them don't agree which way "forward" is supposed to be. The camera is facing the light and the turret is about 30~40 degrees clockwise from that. (The camera mounting is squared off with the turret.) I'm wondering if it's a software calibration or (easier for me!) hardware adjustment. Any suggestions?

It could be your servos are not be centered (127) in the camera gimbal. Did you center them before attaching the gimbal arms?
e.g., detach the servo horn, plug the servo into an unused PWM - normally kept at 127, then reattach the horn.

(I went to High School in Virginia myself, but my kids are all Yankees.)

Keith Watson 08-03-2006 11:42

Re: Camera not working in autonomous
 
Mark's suggestion is a good one. There is an extra step for fine tuning. Use LabView to manually drive the servo positions until the camera is centered. Save those values in the camera EEPROM and in tracking.h as PAN_CENTER_PWM_DEFAULT and TILT_CENTER_PWM_DEFAULT. Then use the offset between PAN_CENTER_PWM_DEFAULT and 127 for the turret pan motor.

Kevin Watson 08-03-2006 19:21

Re: Camera not working in autonomous
 
Quote:

Originally Posted by Keith Watson
Mark's suggestion is a good one. There is an extra step for fine tuning. Use LabView to manually drive the servo positions until the camera is centered. Save those values in the camera EEPROM and in tracking.h as PAN_CENTER_PWM_DEFAULT and TILT_CENTER_PWM_DEFAULT.

Though LabVIEW is a very cool tool, if you're using the "Bells and Whistles" camera code, you don't actually need to use it for this as this functionality is already built into the interactive PWM sub-menu that can be found within the main tracking menu.

-Kevin

Roger 09-03-2006 07:38

Re: Camera not working in autonomous
 
I'm going to pass these suggestions on to the electronics and sensors division of our group, as these are more their line than programming. It felt like a calibration type solution. And we are using "Bells and Whistles", so it should be easy. (Even if I still can't find that command to ring the bell....) Thanks again!

Roger.

(Mark, My father worked at SMC in Hauppauge until he retired a while ago. Nice name, but I still can't spell it.)


All times are GMT -5. The time now is 09:59.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi