Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Sending MjpegServer to Smart Dashboard (http://www.chiefdelphi.com/forums/showthread.php?t=154444)

Acheron-X 29-01-2017 20:07

Sending MjpegServer to Smart Dashboard
 
I have code (in Java) I'm planning to use in order to be able to switch between two (or more) UsbCameras.

As of now, the code I have is posted here. Besides the possible existing errors (should be error-free however), I don't know how to display the MJEG Server in SmartDashboard.

I have attempted to "Add MJPG Server" along with "Add CameraServer", and have also tried various ways to edit the properties, including changing it to the name of Mjpeg, changing to port number, etc.

Help would be appreciated. Thanks!

Peter Johnson 29-01-2017 22:51

Re: Sending MjpegServer to Smart Dashboard
 
As you've discovered, SmartDashboard has two methods for showing MJPG streams. "Add MJPG Server" requires you to enter the URL manually (e.g. http://roborio-XX-frc.local:1181/stream.mjpg, or :5800 based on your current code). "Add CameraServer" is smarter--it uses NetworkTables to enumerate the available cameras, as well as get the correct URL to get the selected camera's stream. The latter requires the use of the WPILib CameraServer class rather than using the cscore classes directly (as the CameraServer class is what publishes the camera information to NetworkTables).

I would recommend using the CameraServer approach unless you have a strong reason to do something different, because it is much more robust in our dynamic networking environment--it will round-robin between multiple IP address options as well as get the robot IP from the DS (only if running on the same computer).


All times are GMT -5. The time now is 22:47.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi