Go to Post Having someone with as much mainstream appeal as will.i.am is a great strategy to draw large amounts of attention to a program that has been relatively hidden to the masses. - Karthik [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 29-01-2015, 20:30
RushAHead RushAHead is offline
President and Pun-Master
FRC #3103 (Iron Plaid)
Team Role: Electrical
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Texas
Posts: 7
RushAHead is an unknown quantity at this point
C++ USB Camera Errors

Hello!
My team is attempting to use the Microsoft LifeCam HD-3000 USB camera on our robot; however, we are encountering error messages in the driver station. We have tried to use the Simple Vision example code (unaltered), but it isn't working.
We have verified that we can see the camera on the web based configuration page and that we are using the correct name in the code (we are). The code builds fine, but as soon as we upload to the robot, we are receiving the error message:

"Error on line 188 of CameraServer.cpp: Incompatible State: The operation cannot be completed: Choose "USB Camera HW" on the dashboard at CameraServer::Serve()"

We program in C++ and use the C++ SmartDashboard. We did add a USB Webcam Viewer object to SmartDashboard, but it only shows the standard gray background with an "ERROR" pink strip at the bottom in its area.

Any fixes/ ideas?
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2015, 11:09
codedr codedr is offline
Registered User
FRC #0537
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Wisconsin
Posts: 70
codedr will become famous soon enoughcodedr will become famous soon enough
Re: C++ USB Camera Errors

We got this to work by exiting the driver station and dashboard, reseting the roborio
and restarting the driver station. After selecting usb camera hw, it started working.

The exact line in the c++ code is complaining about the camera client making a request not in hardware compression mode (req.compression != kHardwareCompression).
Reply With Quote
  #3   Spotlight this post!  
Unread 07-03-2015, 13:42
MamaSpoldi's Avatar
MamaSpoldi MamaSpoldi is offline
Programming Mentor
AKA: Laura Spoldi
FRC #0230 (Gaelhawks)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Shelton, CT
Posts: 305
MamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant future
Re: C++ USB Camera Errors

We are having this same problem. We are coding in C++ and using the SmartDashboard.

We added the following to our code:

Code:
void TalonXVI::RobotInit()
{
    printf("CameraServer being started\n");
    CameraServer::GetInstance()->SetQuality(50);
    //the camera name (ex "cam0") was verified through the roborio web interface
    CameraServer::GetInstance()->StartAutomaticCapture("cam0");
}
We are getting the following error message (repeatedly):
Quote:
Error on line 188 of CameraServer.cpp: Incompatible State: The operation cannot be completed: Choose "USB Camera HW" on the dashboard
at CameraServer::Serve()
at /home/lvuser/FRCUserProgram() [0x29284]
at /home/lvuser/FRCUserProgram() [0x29110]
at /home/lvuser/FRCUserProgram() [0x28ea8]
at /home/lvuser/FRCUserProgram() [0x28d1c]
at /lib/libstdc++.so.6.0.20(+0xa2954) [0x411a3954]
And no image displayed. We tried restarting the driverstation, dashboard, and roboRIO but still get the error message. However the Error line on the dashboard USB WebCam control now says: "ERROR: roboRIO-230.local".

Any suggestions would be much appreciated. Thanks.
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 07-03-2015, 14:26
epylko epylko is offline
Mentor!
AKA: Eric Pylko
FRC #3181 (Pittsford Panthers)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 1970
Location: Pittsford, NY
Posts: 45
epylko is an unknown quantity at this point
Re: C++ USB Camera Errors

We are using C++ and the USB camera as well. There are a couple of things we have done to get video in the C++ dashboard.

1. Make sure you have the patched widget located here: http://www.chiefdelphi.com/forums/sh...d.php?t=134404

2. When you start the driver station, start the default dashboard and then make sure you have USB Camera HW selected. You should see video in that dashboard. After you have video working there, switch to the C++ dashboard and add the patched widget to the dashboard.

I believe that will work - that's from memory. Let us know if that works.
Reply With Quote
  #5   Spotlight this post!  
Unread 09-03-2015, 09:52
MamaSpoldi's Avatar
MamaSpoldi MamaSpoldi is offline
Programming Mentor
AKA: Laura Spoldi
FRC #0230 (Gaelhawks)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Shelton, CT
Posts: 305
MamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant future
Re: C++ USB Camera Errors

Quote:
Originally Posted by epylko View Post
We are using C++ and the USB camera as well. There are a couple of things we have done to get video in the C++ dashboard.

1. Make sure you have the patched widget located here: http://www.chiefdelphi.com/forums/sh...d.php?t=134404

2. When you start the driver station, start the default dashboard and then make sure you have USB Camera HW selected. You should see video in that dashboard. After you have video working there, switch to the C++ dashboard and add the patched widget to the dashboard.

I believe that will work - that's from memory. Let us know if that works.
Really appreciate that info. We followed your procedure and it WORKED! Thanks.
__________________
Reply With Quote
  #6   Spotlight this post!  
Unread 09-03-2015, 20:12
MamaSpoldi's Avatar
MamaSpoldi MamaSpoldi is offline
Programming Mentor
AKA: Laura Spoldi
FRC #0230 (Gaelhawks)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Shelton, CT
Posts: 305
MamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant future
Re: C++ USB Camera Errors

So we had it working and now it does not work again after running without it on the robot for other testing (it was not securely mounted so we didn't want to damage it). Any advice? Do we have to go through the whole process (with the Labview dashboard and then changing over to the C++ SmartDashboard) each new time we bring up the robot with the camera? Do we need to reboot the driverstation after the camera is added?

Thanks
__________________
Reply With Quote
  #7   Spotlight this post!  
Unread 10-03-2015, 00:16
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: C++ USB Camera Errors

Quote:
Originally Posted by MamaSpoldi View Post
So we had it working and now it does not work again after running without it on the robot for other testing...
Did you plug it back into the same port it was in before? Check the roboRIO web page to see whether its name is now cam1 instead of cam0.
Reply With Quote
  #8   Spotlight this post!  
Unread 13-03-2015, 18:30
cbf cbf is offline
Registered User
FRC #2877
 
Join Date: Feb 2012
Location: Newton, MA
Posts: 74
cbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nice
Re: C++ USB Camera Errors

Quote:
Originally Posted by MamaSpoldi View Post
So we had it working and now it does not work again after running without it on the robot for other testing (it was not securely mounted so we didn't want to damage it). Any advice? Do we have to go through the whole process (with the Labview dashboard and then changing over to the C++ SmartDashboard) each new time we bring up the robot with the camera? Do we need to reboot the driverstation after the camera is added?

Thanks
It's just flakey. Many of the underlying classes don't return errors (mostly declared void). If anything goes wrong, it just keeps spewing errors to the message window on the dashboard.

This is much harder than it should be.
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 01:03.

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