![]() |
Programming with Two CMU Cams
With one camera connected to the serial port, and one to the programming port, how should our team go about programming so each can track a light? Thanks in advance.
|
Re: Programming with Two CMU Cams
You'll probably want to just take the camera.c and tracking.c (and their related .h files) and make a copy. Then change all of the static and extern variables to slightly different names. Then just call the camera handler and the servo track in User routines. http://kit.kitkorp.com/frc_camera_doublecamera.zip Shows the laziest of the lazy version of this code. There are some changes marked with "Brian" in the tracking2.h, tracking2.c, and tracking.h to limit the scope of each camera to half on either side, and reverses so they each start in the middle and spread out.
|
Re: Programming with Two CMU Cams
Quote:
|
Re: Programming with Two CMU Cams
question for you....you said youv connected 2 cameras to your RC, both to the 232 ports.....how did you go about connecting the cameras that way and how did you transmit info during runtime? thanks
--iwdu15 --team811 |
Re: Programming with Two CMU Cams
You set up one camera normally through the TTL port with the TTL to 232 adapter. The second goes through a modified serial cable that connects the programming port to your camera.
The easiest way to simply test everything is to buy a ***null modem cable*** connector for your serial cable and simply plug the camera serial directly into the programming port. To test whether or not it's working all you need to do is download the default camera code and change the line in camera.h from // #define CAMERA_SERIAL_PORT_1 #define CAMERA_SERIAL_PORT_2 to #define CAMERA_SERIAL_PORT_1 // #define CAMERA_SERIAL_PORT_2 IMPORTANT NOTES: You won't have any terminal with two cameras. You must make sure that if you use both that you set stdout_serial_port = NUL; in user_routines User_Initialization. Some extra notes: If you decide to modify the cable to go to a PWM output (which is what you'll do if you decide to go into competition with it) You'll need to ruin a serial (or make your own) and make the following connections: 1 0 2 3 0 << This is the serial port on your Robot controller 0 0 0 0 connect pin one to the black on a PWM, pin 2 to the red, and 3 to the white/yellow. |
Re: Programming with Two CMU Cams
Quote:
Here is some more info about null modem cables, including wiring diagrams in case you wanted to make one yourself by splicing two cables. |
Re: Programming with Two CMU Cams
Sorry, fixed.
Oh, and for those of you who are using, the code http://kit.kitkorp.com/frc_camera_doublecamera.zip I've now made it so that it works like originally planned. The Cameras both pan from left to right in a full arc. All of the edited code was removed save for the dual camera functionality. |
| All times are GMT -5. The time now is 04:00. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi