|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||||
|
|||||
|
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. |
|
#3
|
||||
|
||||
|
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 .Last edited by Denz : 28-02-2006 at 23:12. |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
||||
|
||||
|
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.
|
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||||
|
|||||
|
Re: Camera not working in autonomous
Quote:
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.) |
|
#8
|
|||
|
|||
|
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.
|
|
#9
|
||||
|
||||
|
Re: Camera not working in autonomous
Quote:
-Kevin |
|
#10
|
|||
|
|||
|
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.) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Out of the Box Camera Code | russell | Programming | 9 | 21-10-2009 05:28 |
| our own allternative code for the cmu camera | Gili | Programming | 16 | 17-02-2006 00:16 |
| Camera in Autonomous | tamirms | Programming | 2 | 19-02-2005 23:47 |
| Autonomous With Camera | schenkin | Programming | 20 | 16-02-2005 23:52 |
| Autonomous Camera Integration | GregC | Programming | 2 | 06-02-2005 14:34 |