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.

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 */

mm, yeah. We were wondering the same thing.

basically, comment out everything that changes pwm01 and pwm02 in process_data_from_uP (including defult routine) after your camera code