Project Home

Trackers

Source Code

File Releases

Documents

Wiki

Discussions

Reports

Project Info
Artifact artf4842 : CameraServer.capture() spins CPU, slows down everything Print Preview
Tracker:Bugs
Title:CameraServer.capture() spins CPU, slows down everything
Description:
The delay on line 227 in CameraServer is only called if a buffer is present.
My team fixed it by making a local copy of the class and moving the delay out of the catch block to line 231.

In other words, we changed:
catch (VisionException ex) {
    DriverStation.reportError("Error when getting image from the camera: " + ex.getMessage(), true);
    if (dataBuffer != null) {
      synchronized (this) {
          m_imageDataPool.addLast(dataBuffer);
          Timer.delay(.1);
      }
    }
}

to:
catch (VisionException ex) {
    DriverStation.reportError("Error when getting image from the camera: " + ex.getMessage(), true);
    if (dataBuffer != null) {
      synchronized (this) {
          m_imageDataPool.addLast(dataBuffer);
      }
    }
}
Timer.delay(.1);
Submitted By:Nathan Petrangelo
Submitted On:03/26/2016 7:34 PM GMT
Last Modified:03/26/2016 7:34 PM GMT

Active Tab Status / Comments Inactive Tab - left sideChange Log Inactive Tab - left sideAssociations Inactive Tab - left sideDependencies Inactive Tab - left sideAttachmentsInactive Tab - right side  
Java WPILib
Status
Planning Folder:*None
3
Open
None
Comments
#1Nathan Petrangelo: 03/26/2016 7:34 PM GMT
 Action:Create

Button Divider
< Previous
Next >