Class SendableCameraWrapper

java.lang.Object
edu.wpi.first.wpilibj.shuffleboard.SendableCameraWrapper
All Implemented Interfaces:
Sendable, AutoCloseable

public final class SendableCameraWrapper extends Object implements Sendable, AutoCloseable
A wrapper to make video sources sendable and usable from Shuffleboard.
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • setNetworkTableInstance

      public static void setNetworkTableInstance(NetworkTableInstance inst)
      Sets NetworkTable instance used for camera publisher entries.
      Parameters:
      inst - NetworkTable instance
    • wrap

      public static SendableCameraWrapper wrap(VideoSource source)
      Gets a sendable wrapper object for the given video source, creating the wrapper if one does not already exist for the source.
      Parameters:
      source - the video source to wrap
      Returns:
      a sendable wrapper object for the video source, usable in Shuffleboard via ShuffleboardTab.add(Sendable) and ShuffleboardLayout.add(Sendable)
    • wrap

      public static SendableCameraWrapper wrap(String cameraName, String... cameraUrls)
      Creates a wrapper for an arbitrary camera stream. The stream URLs must be specified using a host resolvable by a program running on a different host (such as a dashboard); prefer using static IP addresses (if known) or DHCP identifiers such as "raspberrypi.local".

      If a wrapper already exists for the given camera, that wrapper is returned and the specified URLs are ignored.

      Parameters:
      cameraName - the name of the camera. Cannot be null or empty
      cameraUrls - the URLs with which the camera stream may be accessed. At least one URL must be specified
      Returns:
      a sendable wrapper object for the video source, usable in Shuffleboard via ShuffleboardTab.add(Sendable) and ShuffleboardLayout.add(Sendable)
    • initSendable

      public void initSendable(SendableBuilder builder)
      Description copied from interface: Sendable
      Initializes this Sendable object.
      Specified by:
      initSendable in interface Sendable
      Parameters:
      builder - sendable builder