Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   CAMERA (http://www.chiefdelphi.com/forums/showthread.php?t=51907)

Slick 15-01-2007 08:04

CAMERA
 
Need help… We are having a serious problem it seems in calibrating our camera. We are using LABview and putting the target(green light) about 12 feet away. The camera seems to only see a bright white light. We run the program (Bells and Whistles version) and the camera pans and tilts correctly (it seems), but never acquires the target. Can anyone tell me how to calibrate the camera…. And what code needs to change to acquire the target. Shouldn’t the camera stop when the target is found? What are we missing?

Kevin Watson 15-01-2007 13:01

Re: CAMERA
 
Quote:

Originally Posted by Slick (Post 557104)
Need help… We are having a serious problem it seems in calibrating our camera. We are using LABview and putting the target(green light) about 12 feet away. The camera seems to only see a bright white light. We run the program (Bells and Whistles version) and the camera pans and tilts correctly (it seems), but never acquires the target. Can anyone tell me how to calibrate the camera…. And what code needs to change to acquire the target. Shouldn’t the camera stop when the target is found? What are we missing?

You shouldn't need to calibrate the camera. Just use the calibration parameters that are included and it should just start tracking.

-Kevin

Slick 15-01-2007 14:05

Re: CAMERA
 
Thanks Kevin... I will try that tonight. If this is the case, why do we need LABview. Also, why are there documents from innovation first to calibrate the camera (in detail).... Not questioning you, I just wonder WHY? Maybe I was trying to make this much harder than it really is... Your help is much appreciated.... Thanks again.....

Greg Marra 15-01-2007 14:09

Re: CAMERA
 
Quote:

Originally Posted by Slick (Post 557268)
Thanks Kevin... I will try that tonight. If this is the case, why do we need LABview. Also, why are there documents from innovation first to calibrate the camera (in detail).... Not questioning you, I just wonder WHY? Maybe I was trying to make this much harder than it really is... Your help is much appreciated.... Thanks again.....

Theoretically, if you were to track the light under vastly different lighting conditions, or you wanted to track a different colored object, the Labview software would be great for finding new camera calibration values.

However, Kevin has already figured out an awesome set of values for tracking the green light FIRST uses in competitions. If you just use his, it will work wonderfully. Compared to how hard it was to use the camera in 2005, what Kevin has done is pretty much magic.

Slick 15-01-2007 14:13

Re: CAMERA
 
Thanks.... What file are the parameters in... Are they in user_routines.c or user_routines_fast.c.... -or- are they in a ".h" file? Thanks for the help....

Kevin Watson 15-01-2007 15:04

Re: CAMERA
 
Quote:

Originally Posted by Slick (Post 557279)
Thanks.... What file are the parameters in... Are they in user_routines.c or user_routines_fast.c.... -or- are they in a ".h" file? Thanks for the help....

They're located in camera.h. If you use the "Bells and Whistles" version of the code you can change these values on-the-fly using the camera menu.

-Kevin

Slick 15-01-2007 15:08

Re: CAMERA
 
Thanks again.... Kevin is the MAN.... I'll try it tonight....

Kevin Watson 15-01-2007 15:22

Re: CAMERA
 
Quote:

Originally Posted by Slick (Post 557268)
Thanks Kevin... I will try that tonight. If this is the case, why do we need LABview. Also, why are there documents from innovation first to calibrate the camera (in detail).... Not questioning you, I just wonder WHY? Maybe I was trying to make this much harder than it really is... Your help is much appreciated.... Thanks again.....

LabVIEW is a very cool tool, and I would encourage everyone to crack the manuals and discover all the wonderful things you can do with it. I suspect that they include a demo LabVIEW application so that you can get calibration data for targets other than the green light. The hope is that students will want to explore and use LabVIEW and the CMUcam2 in the off-season.

Anyway, I suspect you'll find that the default calibration parameters will work quite well. Just FYI, to help teams get the camera running, I started a FAQ last year: http://kevin.org/frc/camera.

-Kevin

Kevin Watson 15-01-2007 15:37

Re: CAMERA
 
Quote:

Originally Posted by Greg Marra (Post 557275)
However, Kevin has already figured out an awesome set of values for tracking the green light FIRST uses in competitions. If you just use his, it will work wonderfully.

Actually, I just wrote the code. A member of the FRC engineering staff spent many hours tweaking those calibration values to get them right.

-Kevin

Slick 17-01-2007 07:38

Re: CAMERA
 
Kevin, I'm sorry I did not respond yesterday, but the camera did respond to the light. It works perfectly. Thanks for the help. I don't think we would have solved this without you. We were making this much harder than it really was. Now comes what I hope is the fun part in coding the drive chain to respond and move the robot the way we want it to move. I guess we want the robot to go into the light...(HA) Old horror movie humor. Thanks again.

sniggel 18-01-2007 16:52

Re: CAMERA
 
we are getting the camera to see the green light, but it keeps searching and moves off of it, then rotates back to the light and off again,like it cant get a solid fix on it. any suggestions?

royalfire 19-01-2007 14:34

Re: CAMERA
 
you have probably put the camera exactly as the manual said. Unfortunately, Kevin's code is upside-down. Switch the macros (Kevin's FAQ says which) which control pan and tilt direction.

Kevin Watson 19-01-2007 15:02

Re: CAMERA
 
Quote:

Originally Posted by royalfire (Post 560473)
you have probably put the camera exactly as the manual said. Unfortunately, Kevin's code is upside-down. Switch the macros (Kevin's FAQ says which) which control pan and tilt direction.

Actually, the manual is incorrect. The optimum orientation for the camera is with the tilt axis extending through the camera module.

-Kevin

sniggel 19-01-2007 15:49

Re: CAMERA
 
we finally got the camera working yesterday where it would give us values and the red light would light, today it just keeps searching with no data coming back using the same code(kevin's) that we used yesterday. The red light lights up, but no data comes back, any suggestions what might be causing this. Also we tried kevins new code posted 1/16 and same thing happened.

Kevin Watson 19-01-2007 16:30

Re: CAMERA
 
Quote:

Originally Posted by sniggel (Post 560540)
we finally got the camera working yesterday where it would give us values and the red light would light, today it just keeps searching with no data coming back using the same code(kevin's) that we used yesterday. The red light lights up, but no data comes back, any suggestions what might be causing this. Also we tried kevins new code posted 1/16 and same thing happened.

Look for this code in tracking.h:

// This value defines how many "slow loops" to wait before
// sending the tracking servo(s) to their next destination
// while in search mode. This provides a small delay for the
// camera to lock onto the target between position changes.
#define SEARCH_DELAY_DEFAULT 6

and increase this value to 10 and see it it starts working.

-Kevin

Jade 19-01-2007 21:10

Re: CAMERA
 
We are having trouble getting our camera to follow the target. It gets the target but doesn't follow it, can you help? Also can we have your code for easy c

synth3tk 19-01-2007 22:46

Re: CAMERA
 
I know it's repetitive, but we got the same thing. Using LabView, it picks up the color, but doesn't track it. Also, we've tried to get our light to show up green, but it just comes up as white. We used different lighting conditions, but because it's always white it usually tries to track the ceiling lights.

sniggel 20-01-2007 00:41

Re: CAMERA
 
kevin, thankyou i will try this monday morning unfortnately I dont have access to the school over the weekend.

kevin.fort 20-01-2007 10:06

Re: CAMERA
 
We have the same problem as mentioned twice in this thread that with labview the camera thinks that the green light is white. Also when we use the default code provided by kevin.org the camera will not lock onto the light. It continues scanning and when the defualt values are changed to what labview says they should be closer to the camera will recognize the light(the red light comes on) but it wont stay on it because it keeps going back and forth between the lights on the ceiling.
any ideas or suggestions would be greatly appreciated
Thanks

Mike Betts 20-01-2007 11:42

Re: CAMERA
 
All,

Kevin's code works fine "right out of the box" with no modifications.

Please read this FAQ (particularly Q9).

Mike

sniggel 22-01-2007 09:03

Re: CAMERA
 
Quote:

Originally Posted by Kevin Watson (Post 560569)
Look for this code in tracking.h:

// This value defines how many "slow loops" to wait before
// sending the tracking servo(s) to their next destination
// while in search mode. This provides a small delay for the
// camera to lock onto the target between position changes.
#define SEARCH_DELAY_DEFAULT 6

and increase this value to 10 and see it it starts working.

-Kevin


Kevin,
We recompiled with the increase to 10 of the SEARCH_DELAY_DEFAULT. The camera panned slower, but still didn't respond with anything other than "searching..." We had some students play with the configuration (I know, they shouldn't have...). Now we want to revert to the default calibration, how do we go about doing that?
Thanks!
Team 2051

sniggel 22-01-2007 09:51

Re: CAMERA
 
Quote:

Originally Posted by sniggel (Post 562400)
Kevin,
We recompiled with the increase to 10 of the SEARCH_DELAY_DEFAULT. The camera panned slower, but still didn't respond with anything other than "searching..." We had some students play with the configuration (I know, they shouldn't have...). Now we want to revert to the default calibration, how do we go about doing that?
Thanks!
Team 2051

OK. We got it to work and follow the green light. But it only works when we have the light bars facing the camera (not through the white HDPE panel).

Alan Anderson 22-01-2007 10:27

Re: CAMERA
 
Quote:

Originally Posted by sniggel (Post 562424)
OK. We got it to work and follow the green light. But it only works when we have the light bars facing the camera (not through the white HDPE panel).

That sounds like you might not be supplying enough power to the target lights. Are you using a good supply capable of several amps? If you are using a robot battery, is it fully charged?

sniggel 22-01-2007 11:10

Re: CAMERA
 
thanks. this helped. we are now tracking the light with one minor problem. if we use the diffuser(the white board in front of the lights) the camera keeps searching, if we turn the light tubes directly to the camera the camera tracks the lights. has anybody else had this problem? and any suggestions on what might need modified?

Kevin Watson 22-01-2007 11:46

Re: CAMERA
 
Quote:

Originally Posted by sniggel (Post 562477)
thanks. this helped. we are now tracking the light with one minor problem. if we use the diffuser(the white board in front of the lights) the camera keeps searching, if we turn the light tubes directly to the camera the camera tracks the lights. has anybody else had this problem? and any suggestions on what might need modified?

I think Alan's suggestion makes a lot of sense. The light is pulling somewhere around an amp of current, which the robot battery can easilly deliver. How far away is the light from the camera? Also, make sure you move the search delay back to six.

-Kevin

Kevin Watson 22-01-2007 11:56

Re: CAMERA
 
Quote:

Originally Posted by sniggel (Post 562400)
Kevin,
We recompiled with the increase to 10 of the SEARCH_DELAY_DEFAULT. The camera panned slower, but still didn't respond with anything other than "searching..." We had some students play with the configuration (I know, they shouldn't have...). Now we want to revert to the default calibration, how do we go about doing that?
Thanks!
Team 2051

If using the "streamlined" version of the code, extract camera.h and tracking.h from the zip archive and drop 'em into your build directory.

If using the "bells and whistles" version, go into the camera menu by typing the letter c into the little "to port" box and hit return. From there you can restore the default settings. Do the same for the tracking menu but use the letter t.

Make sure you save the changes once you've recalled the default values.

-Kevin

petek 22-01-2007 13:25

Re: CAMERA
 
Quote:

Originally Posted by Kevin Watson (Post 562496)
I think Alan's suggestion makes a lot of sense. The light is pulling somewhere around an amp of current, which the robot battery can easilly deliver. How far away is the light from the camera? Also, make sure you move the search delay back to six.

-Kevin

We saw this problem (low light intensity) this past weekend. A couple of observations I made:

When powering the light from a battery, you should disconnect when not actually trying to acquire the light. The debugging dimension has a different temporal scale than the physical world, and the battery is living in the latter. It appears that one charge is good for testing one - or at maximum, two - ideas or one configuration error.

When packing 10 lbs in a 5 lb box, like we've done with all the wire, ballasts, and bulbs in the light enclosure, you might expect that the light performance may not be optimal. Especially when the light gets put together in a big rush because you have something more important to do - like debugging camera code. Shadows of a wiring rats nest projected onto the diffuser are probably not the best thing to calibrate to.

When all else fails, plug the camera into the LabView CMUcam GUI and take a peek at what it is seeing, rather than tweaking settings blindly while the battery discharges.

Nicole_Ypes 01-02-2007 20:17

Re: CAMERA
 
Quote:

Originally Posted by Slick (Post 557104)
Need help… We are having a serious problem it seems in calibrating our camera. We are using LABview and putting the target(green light) about 12 feet away. The camera seems to only see a bright white light. We run the program (Bells and Whistles version) and the camera pans and tilts correctly (it seems), but never acquires the target. Can anyone tell me how to calibrate the camera…. And what code needs to change to acquire the target. Shouldn’t the camera stop when the target is found? What are we missing?

Try using a bright light. And also set the white balancing on the camera. May I sugest the briliant program by Kevin for focusing and tweaking you camera. It uses java and I believe the second tab from the left will answer alot of your questions!

Bomberofdoom 03-02-2007 10:50

Re: CAMERA
 
Hey, Kevin, just a personal question, but do you think that finding the RBG or YcrBrcg(sorry, I forogt how it's called)parameters(color level, max-min etc.) on LABView and then entering them to the color parameters in your code will work even better than setting them on LABView?

Kevin Watson 03-02-2007 12:15

Re: CAMERA
 
Quote:

Originally Posted by Bomberofdoom (Post 570817)
Hey, Kevin, just a personal question, but do you think that finding the RBG or YcrBrcg(sorry, I forogt how it's called)parameters(color level, max-min etc.) on LABView and then entering them to the color parameters in your code will work even better than setting them on LABView?

FIRST's James Rahaim spent quite a bit of time tweaking those values to work under many different lighting conditions. In general, you don't need to change the calibration values, but if you do decide to change them, don't use the RGB color space because it won't work nearly as well. I haven't used the LabVIEW tool, so I can't really say if it's better than the Java-based tool.

-Kevin

Ianuser 10-02-2007 13:30

Re: CAMERA
 
Hi, I'm the sole programmer on my team of 6 people. I could really use some help on getting the camera to work. I'm using Kevin's Streamlined camera code and am working off of that. I've changed the pan/tilt servos to pwm06 and pwm07, consequently I've taken out the joystick controls for those pwm's in the Default Routine() function. I think I've built the camera correctly, I followed the instructions. However, I'm reading on these forums that I should mount the board upside down? So the power button is on the bottom? Also, in Kevin's Default code I chaned sommething in the user_routines.c in the Process_Data_From_Master_uP() function. Instead of
if(Get_Tracking_State == CAMERA_ON_TARGET)
{
Switch03_LED = 1;
}
else
{
Switch03_LED = 0;
}

I made it:
if(Get_Tracking_State == CAMERA_ON_TARGET)
{
pwm01 = 150; //Drive Motor Left
pwm02 = 150; //Drive Motor Right
Switch03_LED = 1;
}
else
{
Switch03_LED = 0;
}
I just want to see if the camera worked. However, the camera didn't even move once! It only moved the first time I plugged it in. After that, ever time I turn the bot on, the camera never moves! I kept all of the same code that Kevin had in Process_Data_From_Master_uP (the tracking stuff, servo_track stuff) and the camera never moved. Do I have to put the drive code (if the camera see's it, then move forward and look for it again) in the user_routines_fast.c? Any help would be greatly appreciated!


All times are GMT -5. The time now is 03:38.

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