mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-24 01:31:44 +00:00
Add disabled param for PhotonCamera (#2484)
This commit is contained in:
@@ -80,6 +80,12 @@ class PhotonCamera:
|
||||
self._fpsLimitSubscriber = self._cameraTable.getIntegerTopic(
|
||||
"fpsLimit"
|
||||
).subscribe(-1)
|
||||
self._enabledPublisher = self._cameraTable.getBooleanTopic(
|
||||
"enabledRequest"
|
||||
).publish()
|
||||
self._enabledSubscriber = self._cameraTable.getBooleanTopic(
|
||||
"enabled"
|
||||
).subscribe(True)
|
||||
self._inputSaveImgEntry = self._cameraTable.getIntegerTopic(
|
||||
"inputSaveImgCmd"
|
||||
).getEntry(0)
|
||||
@@ -204,11 +210,28 @@ class PhotonCamera:
|
||||
def setFPSLimit(self, fpsLimit: int) -> None:
|
||||
"""Sets the FPS limit on the camera.
|
||||
|
||||
:param fpsLimit: The FPS limit to set. Set to -1 for unlimited FPS.
|
||||
<p>A negative FPS limit is treated as no FPS limit, and will run as fast as possible.
|
||||
|
||||
<p>Otherwise, will limit processing to at most the provided FPS limit
|
||||
|
||||
:param fpsLimit: The FPS limit to set.
|
||||
"""
|
||||
|
||||
self._fpsLimitPublisher.set(fpsLimit)
|
||||
|
||||
def getEnabled(self) -> bool:
|
||||
""":returns: Whether the camera is enabled."""
|
||||
|
||||
return self._enabledSubscriber.get()
|
||||
|
||||
def setEnabled(self, enabled: bool) -> None:
|
||||
"""Sets whether the camera is enabled, default is true.
|
||||
|
||||
:param enabled: Whether to enable the camera.
|
||||
"""
|
||||
|
||||
self._enabledPublisher.set(enabled)
|
||||
|
||||
def takeInputSnapshot(self) -> None:
|
||||
"""Request the camera to save a new image file from the input camera stream with overlays. Images
|
||||
take up space in the filesystem of the PhotonCamera. Calling it frequently will fill up disk
|
||||
|
||||
Reference in New Issue
Block a user