|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
CMUCam and autonomous code
How do you interface the streamlined version of Kevin's CMUCam code with the default code? I understand that you change the position o fthe robot as a whole based upon the pulses you send to the camera's servos, but how or where do you put the camera code into the default code?
|
|
#2
|
|||||
|
|||||
|
Re: CMUCam and autonomous code
The default code, from what I understood, focuses on giving you the simplest code to control your robot. It doesn't include other components except those related to the "cart".
Kevin's CMU code takes the default code and adds the camera functions and varibles so you can use them to work on targeting the lights on the rack and using the functions and varibles to do things around the arena(such as going to the spiders). I'm affraid that using the default code with the camera won't be possible(you'll be controling the tilt of the camera with the Y axis of your joysticks ).You shouldn't have any problem at all using codes you've written in the default code(and those that actuall worked) and transfer them to the CMU code. The CMU code is there to give your more options. Hope I helped and good luck! ![]() |
|
#3
|
|||||
|
|||||
|
Re: CMUCam and autonomous code
Quote:
Then, when you have the robot running manually and the camera still tracking the light at the same time, you can start getting fancy with software to run the robot automatically based on what the camera is telling you. |
|
#4
|
|||
|
|||
|
Re: CMUCam and autonomous code
I have a question. Do I need to measure the degree angle of the camera (pan/tilt) and do I need to use it in order to allow the robot to move itself during manual routines?
if (get_tracking_state() == CAMERA_ON_TARGET) { set pwm values; } Would that work? Might I put this in Process_Data_From_Master_uP? |
|
#5
|
|||
|
|||
|
Re: CMUCam and autonomous code
Also, I'd need to calculate the distance to the light in order to stop the pwm's? (if so...I know the formula, but how the heck to I get it to work? I don't even know where to begin for that)
![]() |
|
#6
|
|||||
|
|||||
|
Re: CMUCam and autonomous code
Well, you asked me to answer like this, so my answer is yes.
![]() |
|
#7
|
||||
|
||||
|
Re: CMUCam and autonomous code
Cool.
Now I see that the camera code is just kind of inserted into the default code. How convenient, no?![]() |
|
#8
|
|||||
|
|||||
|
Re: CMUCam and autonomous code
Yep, just one thing, you'll need to commnet/uncomment some code lines in the camera code in order to use some of the default code stuff, such as the engines. It's more of where exactly you call the functions. Don't worry, if something doesn't work in your code(and it was compiled succesfuly) it probablly means that you need to change the place where you call the code lines or functions.
Really, it's no big deal. ![]() |
|
#9
|
||||
|
||||
|
Re: CMUCam and autonomous code
yeah, i heard about uncommenting some functin like "default_routine()" or something like that and change something with PWM01 and PWM02. What exactly is that that because it confused me, and it didn't work.
![]() |
|
#10
|
|||||
|
|||||
|
Re: CMUCam and autonomous code
Uncomment Default_Routine() and comment pwm01 = p1_y and pwm02 = p2_y.
|
|
#11
|
|||||
|
|||||
|
Re: CMUCam and autonomous code
If you have two different sets of code trying to control one pwm output, the processor is well going to be confused just like you. When you write your code, you need to make sure only one set of values is output to a pwm at any given time. Therefore, when using Kevin Watson's code, you need to comment out pwm01 and pwm02(or whichever you choose to use really). Look at the above post also.
|
|
#12
|
||||
|
||||
|
Re: CMUCam and autonomous code
I kind of figured that, but it didn't work. the good thing is, it doesn't matter anyway. I need to know how to work the camera from autonomous code.
Demothesis |
|
#13
|
|||||
|
|||||
|
Re: CMUCam and autonomous code
You call the same processes used in user_routines.c. Off the top of my head, I think they are Camera_Hander(); and Servo_Track();.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problems integrating CMUCAM code and IFI Default Code | Windward | Programming | 2 | 06-02-2007 16:48 |
| CMUcam default code not responding | Kyveck | Programming | 29 | 26-01-2006 16:25 |
| Autonomous: CMUCam or dead reckoning? | Andrew Blair | Rules/Strategy | 18 | 26-02-2005 19:36 |
| CMUcam autonomous programming | kshot | Programming | 1 | 17-01-2005 19:18 |
| Anybody have a code for an autonomous mode to go to the 50 point bar???? and... | chaoticprout | Programming | 9 | 06-11-2004 12:22 |