![]() |
*** CMUcam2 Frequently-Asked-Questions ***
I've started a CMUcam2 frequently-asked-questions document here: http://kevin.org/frc/camera. If you have questions that you think should be added to the document, please post them here.
-Kevin |
Re: CMUcam2 Frequently-Asked-Questions
Q3: Where do we plug in the pan and tilt servos?
A3: By default the pan servo is attached to the robot controller's PWM 1 output and the tilt servo is plugged into the the robot controller's PWM 2 output. These assignments can be changed in camera.h. Don't you mean "tracking.h" ? |
Re: CMUcam2 Frequently-Asked-Questions
Quote:
-Kevin |
Re: CMUcam2 Frequently-Asked-Questions
what is the difference in using the PWM outputs and the Servo0, 1 on the camera?
|
Re: CMUcam2 Frequently-Asked-Questions
Quote:
-Kevin |
Re: CMUcam2 Frequently-Asked-Questions
The CMUcam2 Frequently-Asked-Questions document has been substantially updated in the last day or so. Included is a troubleshooting checklist. It can be found here: http://kevin.org/frc/camera.
-Kevin |
Re: CMUcam2 Frequently-Asked-Questions
In the thread titled "Code Errors with Bells and Whistles" I detailed a problem I encountered when I rewrote part of your code so the camera scans in both directions. Since you wrote the origanal, i was wondering if I possibly just left out a neccassary intailization line or something. Can you give any suggestions?
|
Re: CMUcam2 Frequently-Asked-Questions
Quote:
-Kevin |
Re: CMUcam2 Frequently-Asked-Questions
Quote:
Ok, I e-mail it to you if it doesn't work. I made a couple changes. One things was to move the intailization to the very top of the code. Before, I was calling Tracking_Config_Data info before intailization, so that might have been the problem. If it was I'll post here to let you know that it was fixed. Otherwise I should have it sent by five tonight. Thanks for the help. |
Re: CMUcam2 Frequently-Asked-Questions
Can you use a different motor to control pan function? if so what would the code have to look like?
|
Re: CMUcam2 Frequently-Asked-Questions
Quote:
how do you re-upload the tracking.h file to the camera again after modifying it? thankss -bunch of freshman noobs from clovis, CA team 1671 |
Re: CMUcam2 Frequently-Asked-Questions
Quote:
|
Re: CMUcam2 Frequently-Asked-Questions
1) I was trying to drive the robot and operate the camera at the same time so I enabled "Default_Routine" in the Process_Data_From_Master_uP function but I think it conflicted with the camera code (i'm not sure if that's right) because the camera wouldn't work at all. So I just put whatever I needed before "putdata" [the pwms, relays, etc.]
i don't know if my assumptions were right or if i messed up but i think you should address this in some form of a question (that I obviously can't come up with right now). 2) This is a stupid mistake, but someone else might have done it before. If you "accidentally" switch the servos hooked up to the RC, you get that "searching searching searching" thing also and it took me an hour to figure that one out (it's always gotta be the simple things that take forever to figure out). 3) I think you should put something at the top or inside the code about being careful when you load the code for the first time. I had the pwms hooked up to the camera and my motors hooked up to pwm01 and pwm02. So, as the camera tracked the green light, the robot went crazy and i nearly killed myself. After reading the FAQs, I figured out why but maybe if there's a warning somewhere inside the code, it won't happen to another team. 4) When i started using the camera for the first few times, i had the serial cable hooked up to the camera along with the pwm to the ttl port. It's obvious to me now that I can't have both hooked up to the camera at the same time but it wasn't then. You could put that in your FAQs ....those are all the mistakes i can remember but i'm sure i have plenty more to come. =) btw, after my series of errors, my camera worked wonderfully. you're the man kevin. my whole team's amazed how "i got" the camera to dance around but really, it was all your hard work and i got the credit for it. great job. oh, and the FAQs helped a lot! |
Re: CMUcam2 Frequently-Asked-Questions
Quote:
Kevin We Need Your Help Re-Uploading the tracking.h file Anyone!?!?!? |
Re: CMUcam2 Frequently-Asked-Questions
I should have explained my self a little more. We're planning on taking the pan servo off and using the code to control a turret, is there a way to develope a potentiometer structure in replacement of the servo function?
![]() |
Re: CMUcam2 Frequently-Asked-Questions
Quote:
Briefly, you control the motor speed based on the difference between the desired and measured position (in order to move it into place), modified by the rate at which the difference is changing (in order to keep it from overshooting), with a term that pushes harder as it's out of place longer (in order to nudge it if it settles a little short of the target). |
Re: CMUcam2 Frequently-Asked-Questions
Quote:
|
Re: CMUcam2 Frequently-Asked-Questions
We ended up using the pan servo to pan the camera, then use the data to the pan servo to run a motor that steers our turret. In effect, the turret motor keeps the camera steered to the target. When the pan servo is looking straight ahead, the turret motor stops. When the pan servo is off-center, the turret motor turns the whole business in the required direction to get pan servo looking straight ahead. If the tracker is searching rather than tracking, we disable the turret motor until the tracker acquires the target. You can test if the tracker has acquired the target by examining T_Packet_Data.my. Zero signifies searching; nonzero signifies tracking.
Quote:
|
Re: CMUcam2 Frequently-Asked-Questions
Quote:
okay thanks but i need to know how to re-upload those config files to the camera... thanks |
Re: CMUcam2 Frequently-Asked-Questions
Quote:
Quote:
|
Re: CMUcam2 Frequently-Asked-Questions
Quote:
THANKS SO MUCH we'll check it out we got the pan to work but just not the tilt, and were not using pan i do not think..so yeah..big help thanks! |
Re: CMUcam2 Frequently-Asked-Questions
Quote:
|
Re: CMUcam2 Frequently-Asked-Questions
Quote:
Code:
* FUNCTION: Get_Tracking_Configuration() |
Re: CMUcam2 Frequently-Asked-Questions
Quote:
ok so my programmer guy know about these files, and knows how to change the data and what to change it too, we just need to know how to re-upload these config files i guess you could call them (i.e. tracking.h traching.c) to the camera's programming, and what program you use to do this --thanks for all your help guys |
Re: CMUcam2 Frequently-Asked-Questions
Quote:
-Kevin |
Re: CMUcam2 Frequently-Asked-Questions
Quote:
|
Re: CMUcam2 Frequently-Asked-Questions
bhsrobotics1671: We are using MPLAB IDE v7.20; it came in a cd in the kit of parts. If you go to kevin watson's website, http://kevin.org/frc, you can dl the code and everything you could possibly need is in there. then go read the FAQs and you'll avoid many mistakes you might end up making
|
Re: *** CMUcam2 Frequently-Asked-Questions ***
When we tested the camera code it works perfectly. The camera will track the green light. We have our programming cable hooked up so that we get our Pan and Tilt angles displayed on the computer screen. Our question is what variable can we use from the code to take the Pan angle displayed on the computer and use it to change the position of the robot. We want to use a comparison statement like:
Psuedo Code if(Pan_Angle > 10) { Turn robot left } if(Pan_Angle < -10) { Turn Robot right } if(Pan_Angle > -10 && Pan_Angle < 10) { Robot does not turn } We also want to do a similar thing with the tilt to calculate the distance. This is my first year with FRC but I am very familar with C programming and MPLab. I have looked through Kevin's code but I can't figure out what variable will acvhive our desired output. If anyone knows what i'm talking about please help me out. |
Re: *** CMUcam2 Frequently-Asked-Questions ***
We have our camera working fine in teleoperated mode, but for some reason, we can't get it to work in autonomous mode. The red light comes on when the target is in front of the camera lens, but the camera will not actively search for a target, and it won't follow the target once we set it in position.
Is there something that needs to be added to user_routines_fast that activates the camera in autonomous? |
Re: *** CMUcam2 Frequently-Asked-Questions ***
Quote:
|
Re: *** CMUcam2 Frequently-Asked-Questions ***
Quote:
Where and how specifically do these function calls go in the code? Also how do we disable the camera from searching in the teleoperated period? Thanks |
Re: *** CMUcam2 Frequently-Asked-Questions ***
Quote:
Quote:
|
Re: *** CMUcam2 Frequently-Asked-Questions ***
Quote:
while (autonomous_mode) /* DO NOT CHANGE! */ { if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */ { Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */ Camera_Handler(); //You must call BOTH of these Servo_Track(); //functions to use the camera |
Re: *** CMUcam2 Frequently-Asked-Questions ***
Quote:
Thank you very much for that!!! :D Although it isn't printing any of the info about the camera on the terminal window. I don't know if it isn't getting the info in the first place, or is it just not printing it out. Please help |
Re: *** CMUcam2 Frequently-Asked-Questions ***
Quote:
I moved them to the correct places, and then amazingly it worked. It printed out all the things that I wanted it to printing out and all was good. So once again thank you for all that you did to help us. |
Re: *** CMUcam2 Frequently-Asked-Questions ***
Ok this is really a newbie question, but we are trying to get the robot into autonomous mode, we dont have a dongle and not sure if we have what we need to make one. In the documentation from innovation first I saw you can force autonomous mode by setting the team to 0000. will this work? we got kevins code working, but when we tried the 2007 easy c demo it doesnt work. I realized it needed autonomous mode, tried resetting team to 0000 and still the camera doesnt work. The program runs because we get prints from the intialize code, but nothing from the autonomus module. My students are more comfortable with easy c , if possible I would like to get this the easy c 2007 demo code up and running, I think it would be easier for them to deal with.
Has any one had success with this, and am I right that the 2007 demo code for easy c only works in autonomous mode. |
Re: *** CMUcam2 Frequently-Asked-Questions ***
Yes, you would need to kick the robot into autonomous mode for the 2007 demo code to work. If you want, you can buy an autonomous dongle from andymark.biz here: http://andymark.biz/am-0016.html . Hope this helps, /dan
|
Re: *** CMUcam2 Frequently-Asked-Questions ***
Helps a lot! we are now able to get autonomous mode, the 0000 team number into the controller does not work this year
|
Re: *** CMUcam2 Frequently-Asked-Questions ***
This is probably a really stupid question but I see you guys talking about this tracking.h and tracking.c files etc. and I have no clue where to get them. The only one I could find was the CameraDemo folder off of the team resources section of the FIRST website. Where can I get these so I can get cracking on this camera?
|
Re: *** CMUcam2 Frequently-Asked-Questions ***
Quote:
|
| All times are GMT -5. The time now is 23:09. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi