|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using kevin's code for driving and camera tracking
We am using Kevin's 2.1 Camera Code: Bells and Whistles version and could use some help with getting the driving and the camera tracking to work. We are using MPLab rather than easyC since most of us are used to MPLab.
So, looking around the forum, I found that I have to uncomment Default_Routine() to get the driving to work. I realize that this raises other problems like pwm outputs interfering. I have the all the configuration settings to fine-tune the camera tracking, and it works in the CMUCam2 GUI. I was also able to get the driving to work individually with the code provided by IFI. Now the problem is to get them to work together. I'd like to know what else I would have to modify to make the code work smoothly. I have read alot of threads by people who have problems getting the camera tracking to work, but I still couldn't find a clear answer. Btw, I am using the default pwm outputs (Camera: 01, 02) (Drive motors: 13, 15). From what I've read, pwm ports 01 and 02 interfere with default_routines() being uncommented so what exactly do I need to edit? This is our first year in the FRC competition so any help would be appreciated. Last edited by razzoc : 08-02-2007 at 16:32. |
|
#2
|
||||
|
||||
|
Re: Using kevin's code for driving and camera tracking
Here's what I have done so far. I have reassigned the
joystick #1 y-axis parameter (p1_y) to go directly to pwm03 and pwm04. You can see that I have commented out the calls to pwm01 and pwm02 since we are using them also for the camera. Since pwm03 and pwm04 are the same value, the drive motors must be set up so that they both drive in the same direction when connected. I hope this helps. I haven't tried it yet in our robot, but I think it should work. /*---------- Analog Inputs (Joysticks) to PWM Outputs----------------------- *-------------------------------------------------------------------------- * This maps the joystick axes to specific PWM outputs. */ //pwm01 = p1_y; /* Camera Pan Servo */ //pwm02 = p2_y; /* Camera Tilt Servo */ pwm03 = p1_y; /* was pwm03 = p3_y */ pwm04 = p1_y; /* was pmw04 = p4_y */ |
|
#3
|
||||
|
||||
|
Re: Using kevin's code for driving and camera tracking
mm, yeah. We were wondering the same thing.
|
|
#4
|
||||
|
||||
|
Re: Using kevin's code for driving and camera tracking
basically, comment out everything that changes pwm01 and pwm02 in process_data_from_uP (including defult routine) after your camera code
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problems Combining Camera Code and Driving Code | cmurdoch | Programming | 20 | 10-02-2007 16:34 |
| Enabling Multiple Light Tracking Using Kevin's Code | Mitch | Programming | 7 | 05-02-2007 06:17 |
| eclipse & Kevin's camera code | dasRatsel | Programming | 22 | 17-02-2006 12:43 |
| problems using gyro/adc code with camera default code | tanstaafl | Programming | 7 | 22-01-2006 23:09 |
| Team THRUST - Kevin's Code and Camera Code Combine | Chris_Elston | Programming | 3 | 31-01-2005 22:28 |