Go to Post It is not necessary to draw 200 amps to move a robot through a two minute match. Rule of thumb is you robot should be able to compete for three matches without a battery change. - Al Skierkiewicz [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 12-03-2012, 17:20
abrightwell abrightwell is offline
Lead Software Engineer
FRC #0342 (Burning Magnetos)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Charleston, SC
Posts: 20
abrightwell is an unknown quantity at this point
Smartdashboard Dual Camera Issue

During our first regional competition for this year (Orlando Regional) we found the frequent "ball under the bridge" scenario to be quite annoying. Therefore, we decided to mount another camera on our robot that was low enough to give us visibility under the bridge and to assist us when needing to clear out a ball or two prior to the end game period.

We found, however, that doing so caused quite a performance issue with our drive station as the CPU would spike sometimes causing the robot to stop responding. We are using the WPI distributed Smartdashboard for our image processing and display. We are using a Lenovo laptop, not the classmate netbook. This was more annoying than the balls under the bridge and quickly had us digging into the source code for the smartdashboard as well as running the code with a Java Profiler attached. What we determined was that the "background image processing" thread was being way too greedy. Therefore, I decided to take it upon myself to determine a quick fix for this issue so that we could make use our two camera strategy. The code that I changed simply causes this background thread to sleep a few times a second so that resources aren't as scarce. This was a simple "hack" but it worked great for us, so I thought I would share. I'm going to be reviewing the rest of the camera and smartdashboard source to determine a better/more elegant solution, but for now it worked well enough for us to get the job done.

Here is a link to the source that we used to replace the WPICameraExtension class. It is essentially a complete copy paste with some minor cleanup and an added call to sleep the thread. Feedback and comments are welcome and if anyone is interested in collaborating with us in getting to the root of the issue, then I'm all for it.
Reply With Quote
 


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 11:23.

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