Go to Post FRC is about giving students the best experience possible. - MikeE [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 15-01-2005, 14:16
781Co-Cap 781Co-Cap is offline
Registered User
#0781
 
Join Date: Feb 2004
Location: Kincardine
Posts: 4
781Co-Cap is an unknown quantity at this point
Re: Camera Problems

try using a red background as well then you will know if it goes towards it...just an idea
  #2   Spotlight this post!  
Unread 15-01-2005, 18:55
Phil Roth Phil Roth is offline
Registered User
#0011 (BASF)
 
Join Date: Jan 2003
Location: Mt. Olive New Jersey
Posts: 31
Phil Roth is an unknown quantity at this point
Send a message via AIM to Phil Roth Send a message via Yahoo to Phil Roth
Re: Camera Problems

Quote:
Originally Posted by 781Co-Cap
try using a red background as well then you will know if it goes towards it...just an idea
Has anyone noticed strange things in the default code that runs the camera??

In camera.c the function:
int camera_const_cmd(rom const char *cmd_str)

terminates on \r or NULL and will send the \r or NULL out the serial port. I guess the camera won't choke on the NULL but the camera has to see the \r to process the command and sometimes this function is called using a constant that has the \r terminator like:
rom const char *Str_cr = "CR 19 32\r"; // terminate string with \r

and other times it calls it with:
rom const char *raw_mode = "rm 1"; // no \r here

I know the code works because we are running it fine. ??????


Another weird thing in camera.c is the call
camera_const_cmd(manual_agc);
which sets BIT 5 of the Common control B reg in the camera.
This bit sets 8 bit format for the UV bus rather than 16 bit and has nothing to do with AGC.

ALSO.... camera_auto_servo( ) sets the SP parameters but rom const SP parameters also exist in user_routines_DDT.c.

Last edited by Phil Roth : 15-01-2005 at 18:58.
  #3   Spotlight this post!  
Unread 15-01-2005, 18:08
JMac JMac is offline
Registered User
AKA: Jen
#0042
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2004
Location: New Hamshire
Posts: 7
JMac is on a distinguished road
Re: Camera Problems

Quote:
Originally Posted by russell
I am thinking that at the competition couldnt they just post the numbers for all the teams? Or does the effect of the numbers vary between cameras?
I'm hoping they send out the numbers, because otherwise, calibrating at each competition will be a nightmare! I mean, numbers would have to be unique for each competition, but still, there should be a way to do it... I can't imagine all teams will choose to use a vision system, but I feel that even if a majority of teams do, there will need to be either a whole "calibration field" with the same lighting as the real one, or a huge chunk of time for calibrating cameras. I think that would be insane... Has anyone come across any info on this?
  #4   Spotlight this post!  
Unread 15-01-2005, 18:44
dlavery's Avatar
dlavery dlavery is offline
Curmudgeon
FRC #0116 (Epsilon Delta)
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Herndon, VA
Posts: 3,176
dlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond reputedlavery has a reputation beyond repute
Re: Camera Problems

Quote:
Originally Posted by JMac
I'm hoping they send out the numbers, because otherwise, calibrating at each competition will be a nightmare! I mean, numbers would have to be unique for each competition, but still, there should be a way to do it... I can't imagine all teams will choose to use a vision system, but I feel that even if a majority of teams do, there will need to be either a whole "calibration field" with the same lighting as the real one, or a huge chunk of time for calibrating cameras. I think that would be insane... Has anyone come across any info on this?
Due to variences in the lighting environments and ambient light levels at each venue, the calibration values will be unique to each site. FIRST field staff will be providing calibration numbers at each event. This is documented in one of the manuals. I forget which one right now, but will look it up and give you the reference when I find it.

-dave
__________________
"I know what you're thinking, punk," hissed Wordy Harry to his new editor, "you're thinking, 'Did he use six superfluous adjectives or only five?' - and to tell the truth, I forgot myself in all this excitement; but being as this is English, the most powerful language in the world, whose subtle nuances will blow your head clean off, you've got to ask yourself one question: 'Do I feel loquacious?' - well do you, punk?"
- Stuart Vasepuru, 2006 Bulwer-Lytton Fiction Contest



My OTHER CAR is still on Mars!!!
  #5   Spotlight this post!  
Unread 20-01-2005, 20:06
probizzle's Avatar
probizzle probizzle is offline
Registered User
AKA: Prabhas Pokharel
#0639 (Code Red)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2003
Location: Ithaca
Posts: 78
probizzle will become famous soon enoughprobizzle will become famous soon enough
Send a message via AIM to probizzle
Re: Camera Problems

This camera is making me pull my hair out. We still haven't been able to get it to calibrate to anything but red.

But my concern is that it gave me 29 as the value for red, and I'm a bit worried seeing your 90. Should I be worried?
  #6   Spotlight this post!  
Unread 20-01-2005, 20:43
JMac JMac is offline
Registered User
AKA: Jen
#0042
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2004
Location: New Hamshire
Posts: 7
JMac is on a distinguished road
Re: Camera Problems

I believe color numbers should be lighting dependent, which is different for everyone. I was working in a classroom for awhile that had white walls and bright, glossy floors lit by natural light mixed with fluorescent lighting, and successfully calibrated. We had trouble tracking color, however. I moved to a hall with less fluorescent light, added halogen lighting, and used a darker grey color for my backgrounds. Again, I successfully calibrated, and this time I could track all the colors. However, the numbers were all significantly different than before. Maybe this was just my setup being quirky, but as I understand it, lighting determines both the ability to calibrate, and the numbers that calibration gives you.

Last edited by JMac : 20-01-2005 at 20:47. Reason: Silly english errors....
  #7   Spotlight this post!  
Unread 15-01-2005, 08:16
Phil Roth Phil Roth is offline
Registered User
#0011 (BASF)
 
Join Date: Jan 2003
Location: Mt. Olive New Jersey
Posts: 31
Phil Roth is an unknown quantity at this point
Send a message via AIM to Phil Roth Send a message via Yahoo to Phil Roth
Re: Camera Problems

Quote:
Originally Posted by pickle
Well, we covered the white with some black sheets, and then we did some other stuff to add more dark, and we got 3 values, but it seems that that made things worse, it couldn't track any colors with them.... Before calibration, we used hyper terminal to get the servo to follow green, and after, it wouldn't follow anything. I'm really not liking this camera. I'm just going to assume that treacking green will be the most useful thing, since the vision tetras are green. Otherwise, I'll set up something to get it all working using the manual method suggested earlier. Consider that image obsolete, there is no more glare, and no more black in the image. When we select the red triangle, its the only thing within the threshhold of 25 that gets selected in the image. *shrugs* Same story with green and yellow, however, I know green works, because I got it to track it. So ya

I think FIRST chose a special green so make sure you are using it if you are trying to calibrate with the GUI and default RGB values in config.txt. The .txt file also specifies the size of the targets and the green is smaller so you may have better luck if you duplicate the exact size of the smaller green target. I found that you can send commands down "manually" with the GUI and can prove things out by doing the following:

1. Launch GUI. Enter Config menu. Set White balance ON, Auto gain ON, and then hit Update All down on the bottom. Then run the Calibration to make sure you get good numbers. Either adjust lighting and/or alter config.txt to match your colors. You can use white balance on Auto Gain ON for testing but not in competition because they are too slow. These settings let the camera automatically adjust exposure settings for light.

2. Go to the Color menu and hit Track Yellow with the yellow target which is the easiest. You should see it highlighted with a red pixel in the centroid. If so, then try this because it's a good demo:

A. Press STOP and then wait 10 seconds because the GUI hangs. I think there is trouble with the GUIs serial driver if you send commands while the camera is still streaming data. Then go to the Console entry box of the GUI on the top of the screen and type SM 15 to set the servos to autotrack the target. Press SEND to send the command to the camera. My GUI's AutoTrack ain't working and only sends SM 1.

B. Then type TC 100 255 75 255 0 20 <ret> in the console . The Camera should find the Yellow target and servos should track it as you move the target around.

That's how I got it to work in my basement last night with a 3" Yellow triangle on a black sheet mounted about 6 feet away. Now it's off to the school to try things out for real. Keep plugging away at it, you'll get it. There is nothing else to do in autonomous mode.
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
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
Kevin Watson's Kick-off Demo Code! Mr. Lim Programming 27 22-01-2005 03:38
Only 1 camera allowed? Joe Ross Control System 4 17-01-2005 23:29
Live video with Kit Camera BobcatProgramer Electrical 10 11-01-2005 10:43
Joystick problems archiver 2001 3 24-06-2002 02:40


All times are GMT -5. The time now is 20:49.

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