View Full Version : What Java code is required to run a USB camera?
Cobra Commander
10-01-2015, 21:50
We have a Logitech c270 web cam, the WebViewer does detect the camera but I can not find sample code of what needs to accompany our new camera. (Java by the way)
Joey1939
10-01-2015, 21:52
http://www.chiefdelphi.com/forums/showpost.php?p=1425235&postcount=6
Cobra Commander
10-01-2015, 21:56
http://www.chiefdelphi.com/forums/showpost.php?p=1425235&postcount=6
I already I saw this post I put it in our code but it still didn't work.
This is the initialization code copied exactly from our robot. I did verify that it is called "cam0".
public void robotInit() {
CameraServer server = CameraServer.getInstance();
server.setQuality(50);
server.startAutomaticCapture("cam0");
}
Joey1939
10-01-2015, 22:12
What do you mean by "the WebViewer does detect the camera"? Do you mean SmartDashboard? Is there a specific error? Pictures are always helpful.
Cobra Commander
10-01-2015, 22:16
What do you mean by "the WebViewer does detect the camera"? Do you mean SmartDashboard? Is there a specific error? Pictures are always helpful.
No I don't mean SmartDashboard.
http://imgur.com/jzLsbAJ
I have no errors because it does not appear.
The roboRIO is detecting it I know this by looking at the 172.22.11.2 page.
Joey1939
10-01-2015, 22:27
No I don't mean SmartDashboard.
http://imgur.com/jzLsbAJ
I have no errors because it does not appear.
The roboRIO is detecting it I know this by looking at the 172.22.11.2 page.
I am assuming your question is how to view the camera feed. The Webdashboard only shows connected devices. How we saw the actual feed was by opening SmartDashboard and clicking View->Add->USB Camera (Something like that).
Cobra Commander
10-01-2015, 22:31
I am assuming your question is how to view the camera feed. The Webdashboard only shows connected devices. How we saw the actual feed was by opening SmartDashboard and clicking View->Add->USB Camera (Something like that).
The WebDashboard was just proof that it was being detected we are trying to view it from the Driver Station. What "View" tab are you talking about?
Joey1939
10-01-2015, 22:39
This is the SmartDashboard. (http://wpilib.screenstepslive.com/s/4485/m/26401/l/255407-getting-started-with-the-smartdashboard) I have attached a photo of how to add the USB Webcam Viewer.
rpatel3001
10-01-2015, 22:41
How are you trying to access the camera feed? You will need to open the smart dashboard and add a USB camera viewer widget, or open the LabVIEW dashboard and switch the camera type to USB.
Cobra Commander
10-01-2015, 22:46
This is the SmartDashboard. (http://wpilib.screenstepslive.com/s/4485/m/26401/l/255407-getting-started-with-the-smartdashboard) I have attached a photo of how to add the USB Webcam Viewer.
We didn't do what you said, but it's working now. Not sure what happened. Thanks for your help though!
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.