View Single Post
  #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: 269
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