View Full Version : Kevin's Code?
I really wish to know what does Kevin's code (bells and whistles version) exactly do?
does it Track the green light or that it just returns/sends out some information for the CMUCam?
and if it tracks the green light, i wish to know were should I plug the servo PWM's to?
Thanks in advance.
JamesBrown
24-01-2006, 17:26
KEvins code searches for light that falls within given parameters (the green light by default) and returns servo posistions to the robot controller. By default you should plug the Tilt servo int PWM 02 and the pan servo into PWM 01, You can read the Camera and tracking read me files included in his code for more information.
Thanks very much for the help. but 1 more question, I loaded that code on the RC, so does it only return the servo values, or that it also tracks that color (keeps it in the middle of the frame captured by the cmucam)?
Thanks again.
Andrew Blair
24-01-2006, 18:55
If you do not have a window open, it will attempt to track the light, by default.
what do you mean by a "window open"?
billbo911
27-01-2006, 16:32
Thanks very much for the help. but 1 more question, I loaded that code on the RC, so does it only return the servo values, or that it also tracks that color (keeps it in the middle of the frame captured by the cmucam)?
Thanks again.
Kevin's code reads the T-packet information coming from the camera and uses it to command the tilt and pan servos where to move the camera to position the "centroid" of the green light on the "center" pixels of the cameras detector. The center values are available/configurable in the tracking.h file along with many others. It is well worth your time to read through every comment and line of code he has written. All of this and much more are explained in the code.
I believe what Andrew meant by an open window is a terminal window. Kevin's code feeds back, using printf commands, information to a terminal window that can be opened in the IFI loader. It will allow you to see the positioning data. By looking through the terminal.c and .h files, you will be able to find what values are being sent to the servos to tell them how to position the camera. Extrapolating this information, you should be able to use it to position your robot and ball launcher to hit the target you desire. :)
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.