Go to Post Perhaps we should just have signs put up that say "Please remove your head and tail before entering". - Molten [more]
Home
Go Back   Chief Delphi > Technical > Programming
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-2017, 20:07
Acheron-X Acheron-X is offline
Registered User
AKA: Bryan Li
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2016
Location: Maryland
Posts: 3
Acheron-X is an unknown quantity at this point
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!
Reply With Quote
  #2   Spotlight this post!  
Unread 29-01-2017, 22:51
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 268
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
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).
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
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 14:52.

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