Go to Post remember FIRST is just an extracuricular activity in which most of the work is technichan's work...what gets you into college are good grades and a good course load...as my mom always said, "getting good grades gives you the freedom to chose to be whatever you want and go wherever you want" - abeD [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2007, 01:43
PuffGoLe PuffGoLe is offline
Registered User
no team
 
Join Date: Jan 2007
Location: San Jose
Posts: 1
PuffGoLe is an unknown quantity at this point
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.
  #2   Spotlight this post!  
Unread 31-01-2007, 18:26
kitscuzz's Avatar
kitscuzz kitscuzz is offline
Not alotta posts
AKA: Kit
FRC #1389 (Worst Case Scenario)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Home
Posts: 47
kitscuzz will become famous soon enough
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.
  #3   Spotlight this post!  
Unread 01-02-2007, 15:56
Metalgod4eva Metalgod4eva is offline
Registered User
None #0870
 
Join Date: Jan 2007
Location: Southold
Posts: 7
Metalgod4eva is an unknown quantity at this point
Re: Programming with Two CMU Cams

Quote:
Originally Posted by Kickmyassman View Post
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.
Its never a great idea to name some slightly different for better read ability use _. Like if I had a function that writes I should name it write_function. Same with headers and source files. Unless its local variables dont just add a 1 or a random X. It will save you the headache in the long run.
  #4   Spotlight this post!  
Unread 01-02-2007, 19:02
iwdu15 iwdu15 is offline
Registered User
FRC #0811
 
Join Date: Feb 2006
Location: NH
Posts: 10
iwdu15 is an unknown quantity at this point
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
  #5   Spotlight this post!  
Unread 01-02-2007, 21:45
kitscuzz's Avatar
kitscuzz kitscuzz is offline
Not alotta posts
AKA: Kit
FRC #1389 (Worst Case Scenario)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Home
Posts: 47
kitscuzz will become famous soon enough
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.

Last edited by kitscuzz : 01-02-2007 at 21:56.
  #6   Spotlight this post!  
Unread 01-02-2007, 21:47
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Programming with Two CMU Cams

Quote:
Originally Posted by Kickmyassman View Post
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 male-to-male connector for your serial cable and simply plug the camera serial directly into the programming port.
You would need a null modem cable, not just any male-to-male cable.

Here is some more info about null modem cables, including wiring diagrams in case you wanted to make one yourself by splicing two cables.
__________________
  #7   Spotlight this post!  
Unread 01-02-2007, 21:57
kitscuzz's Avatar
kitscuzz kitscuzz is offline
Not alotta posts
AKA: Kit
FRC #1389 (Worst Case Scenario)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Home
Posts: 47
kitscuzz will become famous soon enough
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.

Last edited by kitscuzz : 01-02-2007 at 22:16.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CMU 2 cam with Vex Nathan Technical Discussion 13 11-11-2006 20:55
cmu cam programming ideas mwtidd Programming 1 09-01-2006 12:41
programming motors with programming kit BorisTheBlade FIRST Tech Challenge 4 01-11-2005 19:03
CMU / RC / programming error N7UJJ Programming 3 18-02-2005 17:05


All times are GMT -5. The time now is 10:43.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi