Log in

View Full Version : CMU 2 cam with Vex


Nathan
05-11-2006, 17:17
Hi, one of my mentors wants me to hook up a CMU cam to a vex robot. But I'm not sure how to hook up power to it? Has anyone ever done this? Should I just hook a PWM cable from the camera to the vex controller?

Thanks for the help,
Nathan

intellec7
05-11-2006, 18:27
Hi, one of my mentors wants me to hook up a CMU cam to a vex robot. But I'm not sure how to hook up power to it? Has anyone ever done this? Should I just hook a PWM cable from the camera to the vex controller?

Thanks for the help,
Nathan

Try this (http://www.chiefdelphi.com/forums/showthread.php?t=47797) thread :)

Nathan
05-11-2006, 20:36
Wow, thanks. Exactly what I needed!

EHaskins
05-11-2006, 21:36
Try this (http://www.chiefdelphi.com/forums/showthread.php?t=47797) thread :)
I made that work a couple months ago. I used Kevin's camera code moved to a vex MPLab project.

Nathan
05-11-2006, 21:55
Where could I find Kevin's code? That would really help alot!

Thanks,
Nathan

EHaskins
05-11-2006, 21:57
www.kevin.org/frc

If you want any other help PM or e-mail me Haskinseric@hotmail.com.

EDIT: I tested my vex with the code in frc_camera_s.zip. It may work with version 2 and/or the full version of the code, but I know the first simple version works.

You will need to follow the instructions in the readme to move the code to an EDU/Vex robot. I know it says its for the EDU only, but the process to move it to a VEX is the same.

Also I was using the Radio Shack programming kit, but using MPLab IDE and IFI Loader. This will work with MPLab, but I don't think its possible with EasyC, because you wont have access to the serial ports.

Sorry for the long edit, but I thought of alot after I typed the my response.

Again, if you want any other help PM or e-mail me :D Haskinseric@hotmail.com.

EDIT Again: If you need a copy of the MPLab default code for a vex you can download it from http://www.vexlabs.com/vex-robotics-downloads.shtml. Here is a direct link to the file http://www.vexlabs.com/docs/vex-startup-code.zip. You can also get IFI loader from that page.

Hope this helps,

Nathan
05-11-2006, 22:14
Thanks! And I already use MPlab so that shouldn't be a problem. By "the first simple version" do you mean frc_camera.zip?

Thanks again,
Nathan

EHaskins
05-11-2006, 22:16
I used frc_camera_s.zip.

frc_camera_s.zip (http://www.kevin.org/frc/frc_camera_s.zip)

EDIT: You do need a different version of the default code for a vex. The code from an FRC controller will NOT work. You can download it from the link in my post above.

Nathan
11-11-2006, 13:18
Eric's been helping me via e-mail (Thanks Eric!), and now I've gotten the cables all hooked up. But when I try to integrate Kevin's camera code, by adding "camera.c" and "camera.h" to my MPlab project, I get the following error:

Error - could not find definition of symbol 'Serial_Port_Two_Byte_Count' in file 'C:\VexCode\camera.o'.
Errors : 1

BUILD FAILED: Sat Nov 11 12:53:45 2006

And unfortunately I can't get it to go away... Any idea's why I'm getting this?

Thanks,
Nathan

Mark McLeod
11-11-2006, 14:13
That's defined in Kevin's serial_ports.c/h files.

Did you include those in your project?

Nathan
11-11-2006, 14:22
No, I didn't. I guess that was the problem, thanks :) Now, do I need to include the rest of the Kevin's .c/.h files to my project, or will just having the camera.c/h and serial_ports.c/h files be ok?

EHaskins
11-11-2006, 15:42
If you follow the instrustions in the Camera Readme, tracking readme, and the serial port readme. Your robot should be working in no time. :D

If you are planning to write your own tracking code you don't need to follow the tracking readme to integrate tracking.c/.h/

Nathan
11-11-2006, 16:24
Thanks. And I've been trying to read all the readme's/.c/.h files, and is this how you track an object:

Initialize_Camera();
Camera_Idle();
Track_Color();

Is that how you do it?

Thanks,
Nathan

EHaskins
11-11-2006, 20:55
If you have integrated the serial and camera code properly you can put this code in porcess_data_from_master_up


Camera_Handler();// this updates the camera data.
Servo_Track();// this is in tracking.c, so you must include tracking.h.


You can look at the code in kevin's frc code, or the code I e-mailed you for a better explaination.

Feel free to e-mail me. :D