Go to Post I'll not deprive you of the practice in reading the manual; you'll need it if you want to be an effective part of an FRC team. - Alan Anderson [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 03-03-2015, 17:36
JacobD's Avatar
JacobD JacobD is offline
Registered User
AKA: Jacob
FRC #1672 (Mahwah Robo T-Birds)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2013
Location: New Jersey
Posts: 90
JacobD is an unknown quantity at this point
USB Camera not working

Hi, after updating all of the FRC java libraries, we're getting this error when we call the startAutomaticCapture() method on an instance of a CameraServer:

Code:
found mode 12: 320 x 240 JPEG 30.00 fps
Error when getting image from the camera: invalid image: could not find jpeg end 199999 at edu.wpi.first.wpilibj.CameraServer.capture(CameraServer.java:212)
edu.wpi.first.wpilibj.CameraServer$2.run(CameraServer.java:182)
Apparently it can't find the end of the jpeg images the camera is sending? The camera worked perfectly before we updated the libraries. We're using a logitech USB camera.

The error isn't fatal but it prevents us from opening up the java smart dashboard. Any ideas?

Code:
		usbCam = CameraServer.getInstance();
		usbCam.setQuality(100); //full-quality JPEG images. 100 is full quality
		usbCam.startAutomaticCapture("cam1");
Reply With Quote
  #2   Spotlight this post!  
Unread 03-02-2016, 19:53
smarthimandrew's Avatar
smarthimandrew smarthimandrew is offline
Programmer, and (sigh) Electrical
AKA: Andrew Dickinson
FRC #3546 (Buc 'n' Gears)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2013
Location: Grand Haven, Western Michigan, US
Posts: 22
smarthimandrew is an unknown quantity at this point
Re: USB Camera not working

We just encountered this identical error with a new COTS USB camera we would like to use for this season.

The roboRIO sends a single image to the smart dashboard when the code starts. Then the above error is spammed on the driver's station until the robot is shut off. The error is in the capture() method of the CameraServer class in the wpi library.

This is the camera we're attempting to use.

Is there a way to contact the wpilib team to report this bug?

We really want to use this camera in particular because of its fisheye lens. Is there an alternate way to display a USB camera on the driver's computer?
Reply With Quote
  #3   Spotlight this post!  
Unread 03-02-2016, 21:01
JacobD's Avatar
JacobD JacobD is offline
Registered User
AKA: Jacob
FRC #1672 (Mahwah Robo T-Birds)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2013
Location: New Jersey
Posts: 90
JacobD is an unknown quantity at this point
Re: USB Camera not working

Quote:
Originally Posted by smarthimandrew View Post
We just encountered this identical error with a new COTS USB camera we would like to use for this season.

The roboRIO sends a single image to the smart dashboard when the code starts. Then the above error is spammed on the driver's station until the robot is shut off. The error is in the capture() method of the CameraServer class in the wpi library.

This is the camera we're attempting to use.

Is there a way to contact the wpilib team to report this bug?

We really want to use this camera in particular because of its fisheye lens. Is there an alternate way to display a USB camera on the driver's computer?
This is kind of an old thread but from what I remember from last year, we found the old CameraServer.java and put it into our java project. This seemed to fix that issue. As far as the 2016 library, who knows.

Hopefully I will find time to test it in the near future. We just bought that camera today so hopefully I can find a fix.
__________________
2013-2014: Electrical, Mechanical
2014-2017: Team Captain
Reply With Quote
  #4   Spotlight this post!  
Unread 05-02-2016, 16:03
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,559
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: USB Camera not working

Quote:
Originally Posted by smarthimandrew View Post
Is there a way to contact the wpilib team to report this bug?
http://wpilib.screenstepslive.com/s/...port-resources
Reply With Quote
  #5   Spotlight this post!  
Unread 09-02-2016, 06:27
smarthimandrew's Avatar
smarthimandrew smarthimandrew is offline
Programmer, and (sigh) Electrical
AKA: Andrew Dickinson
FRC #3546 (Buc 'n' Gears)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2013
Location: Grand Haven, Western Michigan, US
Posts: 22
smarthimandrew is an unknown quantity at this point
Re: USB Camera not working

Quote:
Originally Posted by JacobD View Post
Hopefully I will find time to test it in the near future. We just bought that camera today so hopefully I can find a fix.
Any progress?
Reply With Quote
  #6   Spotlight this post!  
Unread 09-02-2016, 10:59
JacobD's Avatar
JacobD JacobD is offline
Registered User
AKA: Jacob
FRC #1672 (Mahwah Robo T-Birds)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2013
Location: New Jersey
Posts: 90
JacobD is an unknown quantity at this point
Re: USB Camera not working

The code that I wrote for it but I still haven't tested it because we are getting ready to reassemble the electronics on our robot. Otherwise try this:

Make sure you name the usb cam in the roboRio web panel to the appropriate name ("cam1")
Code:
public void robotInit()
{
        usbCam = CameraServer.getInstance();
	usbCam.setQuality(50); 
	usbCam.startAutomaticCapture("cam1");
 }
It seems like they added the camera server class back into the library so hopefully it is functional. I'll try to let you know before the end of this week.
__________________
2013-2014: Electrical, Mechanical
2014-2017: Team Captain

Last edited by JacobD : 09-02-2016 at 11:03.
Reply With Quote
  #7   Spotlight this post!  
Unread 10-02-2016, 13:21
smarthimandrew's Avatar
smarthimandrew smarthimandrew is offline
Programmer, and (sigh) Electrical
AKA: Andrew Dickinson
FRC #3546 (Buc 'n' Gears)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2013
Location: Grand Haven, Western Michigan, US
Posts: 22
smarthimandrew is an unknown quantity at this point
Re: USB Camera not working

Quote:
Originally Posted by JacobD View Post
The code that I wrote for it but I still haven't tested it because we are getting ready to reassemble the electronics on our robot. Otherwise try this:

Make sure you name the usb cam in the roboRio web panel to the appropriate name ("cam1")
Code:
public void robotInit()
{
        usbCam = CameraServer.getInstance();
	usbCam.setQuality(50); 
	usbCam.startAutomaticCapture("cam1");
 }
It seems like they added the camera server class back into the library so hopefully it is functional. I'll try to let you know before the end of this week.
This won't work. The bug is in the CameraServer class itself. This is exactly what I've tried. My original post describes the bug...
Reply With Quote
  #8   Spotlight this post!  
Unread 10-02-2016, 14:51
smarthimandrew's Avatar
smarthimandrew smarthimandrew is offline
Programmer, and (sigh) Electrical
AKA: Andrew Dickinson
FRC #3546 (Buc 'n' Gears)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2013
Location: Grand Haven, Western Michigan, US
Posts: 22
smarthimandrew is an unknown quantity at this point
Re: USB Camera not working

Quote:
Originally Posted by Joe Ross View Post
Thanks. I filed a bug report here:

https://usfirst.collab.net/sf/go/art...=1455129586145
Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2016, 22:21
JacobD's Avatar
JacobD JacobD is offline
Registered User
AKA: Jacob
FRC #1672 (Mahwah Robo T-Birds)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2013
Location: New Jersey
Posts: 90
JacobD is an unknown quantity at this point
Re: USB Camera not working

I don't know if you heard back from the WPI developers but I got my camera to work again. It was throwing that error temporarily but by putting the quality down a bit and restarting the dashboard, it works perfectly again. I might suggest putting the FPS to 20 or 25 instead.
__________________
2013-2014: Electrical, Mechanical
2014-2017: Team Captain
Reply With Quote
  #10   Spotlight this post!  
Unread 18-02-2016, 11:45
smarthimandrew's Avatar
smarthimandrew smarthimandrew is offline
Programmer, and (sigh) Electrical
AKA: Andrew Dickinson
FRC #3546 (Buc 'n' Gears)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2013
Location: Grand Haven, Western Michigan, US
Posts: 22
smarthimandrew is an unknown quantity at this point
Re: USB Camera not working

Interesting... We decided to stream the camera through a Raspberry Pi instead. I'll try reducing the quality and framerate to see if we can replicate your results though.
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 08:36.

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