![]() |
CMUCam2 Camera Code - Are important parts commented out?
Here's were Team188 is at in terms of the camera:
1) Enclosure is built 2) Mounted on Servo 3) Assembly mounted on last year's robot (Blizzard 5) - 36" off the ground 4) Calibrated for Yellow, Green and Red successfully 5) Successful "Colour Tracking" for the three calibrated colours through the CMUCam2 Java GUI using DB-9 serial cable (i.e. the camera discriminates the coloured target from the background with a nice tight bounding box, and can successfully return its midpoint coordinates) 6) Loaded the supplied CMUCam2 rev 3 FRC code onto last year's robot 7) Connected the FRC controller to the camera via TTL port and supplied TTL to RS232 adapter 8) Successful camera initialization 9) Successful camera tracking and servoing (camera pans to point directly at the coloured target and will follow it if either target or robot is moved - BTW green seems to work better than yellow or red by A LOT) NOW here's the problem: The supplied CMUCam2 code is SUPPOSED to also get the robot to navigate towards the coloured target out of the box. It doesn't seem to want to for us. Open user_routines_DDT.c -> Default_Routine() Code:
if (p1_sw_trig > 0 && tracking > 0) { //If vision active and tracking use camera dataFirst problem: I don't think speed_control is ever assigned a value. It's declared in user_routines_DDT.c at the top. Code:
unsigned int speed_control;Code:
p1_y = speed_control; //set forward speedSecond problem: tracking and pan_position are presumably defined by our camera handling routines. They technically ARE, but the entire code portion that does this is COMMENTED OUT? Open user_routines_fast_DDT.c -> process_vision() Code:
pan_position = 0;Code:
transit_char = char_buffer[1]; // get trracking flag from cameraIn fact, even the call to process_vision() is commented out in Process_Data_From_Local_IO() Code:
*/It could be that I'm simply missing all the REAL camera handlers in another file somewhere, and that all these commented out ones are superfluous. But needless to say, right now I'm CONFUSED, and could use a bit of guidance! Help! -SlimBoJones... |
Re: CMUCam2 Camera Code - Are important parts commented out?
I am not exactly sure, but do not forget this:
You CAN NOT use the camera servo outputs to power the angling servos for the camera. If you wish to have the camera move on its own, those outputs must go through the FRC Controller, and the FRC Controller must control the servos. See Section 5: The Robot (http://www2.usfirst.org/2005comp/Sec...-The_Robot.pdf) Quote:
|
Re: CMUCam2 Camera Code - Are important parts commented out?
RIgnazio!
Thanks for the rules info. Is there already a thread discussion on this? Any idea if a Q&A has been asked/answered for this? AURGH!!! If not, can you start a new thread on this particular rule in the Rules section? Still need help with my original post though! -SlimBoJones... |
Re: CMUCam2 Camera Code - Are important parts commented out?
Steve,
Your reading of the rules is impeccable. However, I believe that this is an oversight in the rules. Good catch! I am sure that FIRST intends for the camera PCB to control the servo. I suggest that you ask Engineer Dave (or whoever has posting authority on the FIRST Q&A) to post your observation for clarification. Mike Roger, It makes sense that FIRST/IFI would comment out code so that it is safe for people to simply "run" on a robot without fully understanding function. I would suggest that you implement a piece at a time with appropriate debug printf statements to understand what each part does. Note that some code may require modification by you to be compatible with your system. As an example, I would insure that the camera is giving good information to your controller before I attempted to let it guide the drive system of your robot. Mike |
Re: CMUCam2 Camera Code - Are important parts commented out?
Quote:
Quote:
Code:
// Put vision processing here, because we have a good frame!Thanks Mike! Your post led me to find the real non-commented out camera handler!!! It appears the answer is NO, important parts of the camera code ARE NOT commented out. This SHOULD still work out of the box with little to no code modification -SlimBoJones... P.S. My question has been answered! Moderators may close this thread if they wish. |
| All times are GMT -5. The time now is 00:35. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi