Log in

View Full Version : Programming The CMUcam for the Vex controller


987HighRoller
24-06-2006, 03:10
Hi,

I am trying to make the camera code on a vex controller. I've integrated Kevins code into the default Vex code from IFI and it doesn't seem to have any errors with it (just for the heck of it I tried to run Kevin's code for FRC, unfortunately it didn't work). I have connected the camera's serial port using a male to male serial connection to the programming cable for the Vex controller. One problem with this is that I can't debug the code using the output from the IFI Loader. I'm pretty sure that the camera's serial port is right in the code. The only problem is, IT DOESN'T WORK :ahh: The Vex controller doesn't seem to be getting any data from the camera, and I have no clue why. All I did to make the code work for the Vex was use the Vex default code and add the files from Kevin's 2006 CMUcam2 code one file at a time. I'm pretty sure I've included all the necessary functions as well throughout the code. Does anybody have any ideas as to why this isn't working? Is there a problem with the way I'm using the FRC code for the Vex. Also, I'm using the camera that came in the 2005 KOP, does this matter?

Thanks

bear24rw
24-06-2006, 10:47
If you are using the steamlined version make sure you including, camera.c, camera.h, serial_ports.h, serial_ports.c, tracking.h, tracking.c...

I have never used Vex with the camera but you might want to try changing the serial port that the camera is on... (camera.h)

// If your camera's serial port is attached to the the robot controller's
// programming serial port, uncomment the "#define CAMERA_SERIAL_PORT_1"
// line. Otherwise, if your camera is attached to the TTL serial port,
// uncomment the "#define CAMERA_SERIAL_PORT_2" line.
// #define CAMERA_SERIAL_PORT_1
#define CAMERA_SERIAL_PORT_2


Again, I have never used Vex with the camera before so there might be other problems that I dont know about...

Donut
24-06-2006, 13:20
I doubt this is the problem, but could the fact the Vex RC has a different timing for the main loop (18ms instead of 26ms) affect it at all?

Also, you may want to look into using the TX and RX ports for your camera instead of the programming port so you can still read outputs from the robot.

987HighRoller
24-06-2006, 15:27
I think I might have to change the baud rate and try and use the sample values that are in serial_ports.h. And yes, I've switched the camera's serial ports in the code several times, and I'm pretty sure that serial port one is the right one.