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 Summary
Modifier and Type Method Description void
close()
void
initSendable(SendableBuilder builder)
Initializes thisSendable
object.static void
setNetworkTableInstance(NetworkTableInstance inst)
Sets NetworkTable instance used for camera publisher entries.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.static SendableCameraWrapper
wrap(String cameraName, String... cameraUrls)
Creates a wrapper for an arbitrary camera stream.
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
-
setNetworkTableInstance
Sets NetworkTable instance used for camera publisher entries.- Parameters:
inst
- NetworkTable instance
-
wrap
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)
andShuffleboardLayout.add(Sendable)
-
wrap
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 emptycameraUrls
- 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)
andShuffleboardLayout.add(Sendable)
-
initSendable
Description copied from interface:Sendable
Initializes thisSendable
object.- Specified by:
initSendable
in interfaceSendable
- Parameters:
builder
- sendable builder
-