Go to Post These folks have bigger hearts than most. I think they grow them that way in Indiana. - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-02-2012, 20:47
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Broken cameras...Anyone?

Hey, we've been working on our code to track the targets for a while, and, when we are able to actually grab a picture off the camera and use it, our calculations work. Our problem is that the camera is continually rebooting in the middle of use.When that happens, the code stops talking to it and we can't get any more pictures until we restart the robot. We have been doing everything we can to make this stop happening, but we think the problem may be inside the camera. Earlier today our team had a driving practice, and I'm told that the camera rebooted in the middle and the entire robot froze up. It shut down to the point where we were unable to re-upload code , so now we think that we may have to reimage the cRio.

Is anyone else having trouble with the camera itself, not with the image processing? If so, please help!
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2012, 01:32
Patrick Chiang Patrick Chiang is offline
Programming
FRC #3070 (Team Pronto)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Seattle
Posts: 162
Patrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to all
Re: Broken cameras...Anyone?

Well, first thing you want to do is create "Plan Bs" (read: threads) in your code to make sure the cRio doesn't crash when the camera goes out on you during a competition. Or, just a try/catch block to contain that code in case it breaks.

Second, you should not need to re-image the cRio unless the camera code is ran continuously in the init section of the robot. It won't hurt, but I don't see how it might help.

Third, any ideas on why the camera is rebooting in the middle of a match? Never had that happen before.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2012, 02:10
Garrett.d.w's Avatar
Garrett.d.w Garrett.d.w is offline
Build Lead
FRC #2733 (The Pigmice)
Team Role: Alumni
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Portland
Posts: 318
Garrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to behold
Re: Broken cameras...Anyone?

Zip tie/ tape the black power cable to the camera to make sure that it is receiving a constant supply of power. I don't know if loss of power will cause the symptoms you are seeing, but it wouldn't hurt anything to try this.

Same goes for the CAT 5 cable that runs from the camera to the bridge.

Without more info, I (nor any more qualified people) can truly help. It would be nice if you posted some of the specifics of the system that you are using. Error codes (if any) and "external events", like the robot being bumped, are also nice to have.

Good luck, I hope you figure it out.
__________________
"A mind once stretched by a thought will never regain it's original dimensions."

Optimists think the glass is half full.
Pessimists think the glass is half empty.
Engineers realize it's twice as big as it needs to be.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2012, 02:19
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Broken cameras...Anyone?

Quote:
Originally Posted by Garrett.d.w View Post
Zip tie/ tape the black power cable to the camera to make sure that it is receiving a constant supply of power. I don't know if loss of power will cause the symptoms you are seeing, but it wouldn't hurt anything to try this.
I would suggest that this is the issue and that hot glue on the connector has worked for us before.
Reply With Quote
  #5   Spotlight this post!  
Unread 12-02-2012, 08:59
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Re: Broken cameras...Anyone?

Patrick, First, we already have all the camera code in a try-catch and an if statement checking if (null!=image) where image is the new image.
--Second, we may not have to reimage, I wasn't at the practice and that's what everyone who was there said.
--Third, I don't know, that's part of our problem.

Garrett, the code isn't outputting any error messages when this happens, we put in a check for camera.freshImage() which seems to return false once or twice, and then return true the rest of the time, bypassing the rest of the camera code. As for the zip-tie and tape, we have alreadey tried holding the power cord in with a rubberband around the entire camera, but that doesn't seem to be the problem because we are getting live feed the the SmartDashboard the whole time except for extreme cases. The camera is getting jostled around a bit, and is attached to the top of the shooter mechanism so the image goes blurry when we shoot, could that have loosend some of internal parts?

Ruffles, thanks for the idea, I'll suggest that to the team.
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #6   Spotlight this post!  
Unread 12-02-2012, 12:57
Garrett.d.w's Avatar
Garrett.d.w Garrett.d.w is offline
Build Lead
FRC #2733 (The Pigmice)
Team Role: Alumni
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Portland
Posts: 318
Garrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to behold
Re: Broken cameras...Anyone?

Quote:
Originally Posted by Ipiano View Post
The camera is getting jostled around a bit, and is attached to the top of the shooter mechanism so the image goes blurry when we shoot, could that have loosend some of internal parts?
I don't know what camera you are using, so this may or may not apply.
Some electronics are vibration sensitive. IE, out of the box, they will freak out if they are submitted to intense vibrations. The KOP camera is rugged and therefor resistant to vibrations, though most webcams that I have messed with can freak out if they are shaken up a little too much. If this is your problem, then all data from the camera would be useless while there is major vibration (aka, camera code doesn't work and the dashboard doesn't work).

From what you have said, this is not the case. Even when your code quits working, your live feed continues to function. Check to make sure that your camera is compatible with everything that you are using.

I don't know much about coding for cameras, so dismiss this if it is not possible. Would two different programs (dashboard and image processing) have a conflict if they both tried to read the same piece of data at the same time? Theoretically, the dashboard program is really robust and therefor isn't severely affected by this hiccup, but your code might just crash because of it.
A way to test for this is to figure out how to ensure that there are dedicated "image processing" frames, and dedicated "live feed" frames.

Disclaimer: I have never coded for a FIRST robot, what I wrote above is based on experience with Arduino and various other java base languages. It may or may not be applicable to this application. Check with someone who knows more about these things.
__________________
"A mind once stretched by a thought will never regain it's original dimensions."

Optimists think the glass is half full.
Pessimists think the glass is half empty.
Engineers realize it's twice as big as it needs to be.
Reply With Quote
  #7   Spotlight this post!  
Unread 12-02-2012, 18:03
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Re: Broken cameras...Anyone?

Thanks for the idea, we tried turning off the camera widget on the Dashboard, but it didn't help. We did another test and discovered that the problem is caused by the jostling of the robot. We managed to get 8 pictures in a row by driving no faster than 1/4 full speed, but the camera stopped working when we went faster.

Oh, and we are using the KOP camera
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #8   Spotlight this post!  
Unread 12-02-2012, 18:09
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Broken cameras...Anyone?

Quote:
Originally Posted by RufflesRidge View Post
I would suggest that this is the issue and that hot glue on the connector has worked for us before.
I second this.

I've had the camera reset on us from the plug vibrating, and losing contact. Hot glue is a must IMO.

Another suggest is to ensure your camera mount doesn't accidentally touch the reset button on the back of the camera. A lot of people just bolt the camera to a vertical 1" square tube, which would hover right over the camera's reset button.
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
Reply With Quote
  #9   Spotlight this post!  
Unread 13-02-2012, 07:23
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Broken cameras...Anyone?

I didn't see it mentioned, but you should also insure that the camera and cRIO are electrically isolated. Especially if one is taking down the other, this sounds like something may be shorting to the frame and affecting the other electronics.

Greg Mckaskle
Reply With Quote
Reply


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


All times are GMT -5. The time now is 22:21.

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