31#include <wpi/driverstation/Alert.hpp>
32#include <wpi/nt/BooleanTopic.hpp>
33#include <wpi/nt/DoubleArrayTopic.hpp>
34#include <wpi/nt/DoubleTopic.hpp>
35#include <wpi/nt/IntegerTopic.hpp>
36#include <wpi/nt/MultiSubscriber.hpp>
37#include <wpi/nt/NetworkTable.hpp>
38#include <wpi/nt/NetworkTableInstance.hpp>
39#include <wpi/nt/RawTopic.hpp>
40#include <wpi/nt/StringTopic.hpp>
41#include <wpi/units/time.hpp>
273 wpi::units::second_t lastVersionCheckTime = 0_s;
274 static bool VERSION_CHECK_ENABLED;
275 inline static int InstanceCount = 1;
277 wpi::units::second_t prevTimeSyncWarnTime = 0_s;
279 int prevHeartbeatValue = -1;
280 wpi::units::second_t prevHeartbeatChangeTime = 0_s;
282 void VerifyVersion();
284 void UpdateDisconnectAlert();
287 std::vector<std::string> tablesThatLookLikePhotonCameras();
Represents a camera that is connected to PhotonVision.
Definition PhotonCamera.h:56
void SetEnabled(bool enabled)
Sets whether the camera is enabled, default is true.
wpi::nt::IntegerPublisher fpsLimitPublisher
Definition PhotonCamera.h:256
wpi::Alert disconnectAlert
Definition PhotonCamera.h:269
PhotonCamera(wpi::nt::NetworkTableInstance instance, const std::string_view cameraName)
Constructs a PhotonCamera from a root table.
wpi::nt::IntegerSubscriber inputSaveImgSubscriber
Definition PhotonCamera.h:241
wpi::nt::BooleanSubscriber enabledSubscriber
Definition PhotonCamera.h:257
std::optional< CameraMatrix > GetCameraMatrix()
Get the camera calibration matrix, in standard OpenCV form.
std::shared_ptr< wpi::nt::NetworkTable > mainTable
Definition PhotonCamera.h:237
std::shared_ptr< wpi::nt::NetworkTable > rootTable
Definition PhotonCamera.h:238
wpi::nt::StringSubscriber versionEntry
Definition PhotonCamera.h:248
wpi::nt::RawSubscriber rawBytesEntry
Definition PhotonCamera.h:239
wpi::nt::IntegerSubscriber heartbeatSubscriber
Definition PhotonCamera.h:262
void SetFPSLimit(int fpsLimit)
Sets the FPS limit on the camera.
wpi::nt::IntegerSubscriber outputSaveImgSubscriber
Definition PhotonCamera.h:243
PhotonPipelineResult GetLatestResult()
wpi::nt::IntegerSubscriber ledModeSub
Definition PhotonCamera.h:247
wpi::nt::BooleanSubscriber driverModeSubscriber
Definition PhotonCamera.h:253
bool test
Definition PhotonCamera.h:233
const std::string_view GetCameraName() const
Returns the name of the camera.
static void SetVersionCheckEnabled(bool enabled)
Sets whether or not coprocessor version checks will occur.
Eigen::Matrix< double, 8, 1 > DistortionMatrix
Definition PhotonCamera.h:200
wpi::nt::IntegerPublisher pipelineIndexPub
Definition PhotonCamera.h:244
wpi::nt::IntegerSubscriber pipelineIndexSub
Definition PhotonCamera.h:245
void SetDriverMode(bool driverMode)
Toggles driver mode.
wpi::nt::IntegerSubscriber ledModeSubscriber
Definition PhotonCamera.h:260
wpi::nt::BooleanPublisher enabledPublisher
Definition PhotonCamera.h:258
void TakeInputSnapshot(void)
Request the camera to save a new image file from the input camera stream with overlays.
bool IsConnected()
Returns whether the camera is connected and actively returning new data.
PhotonCamera(const std::string_view cameraName)
Constructs a PhotonCamera from the name of the camera.
bool GetDriverMode() const
Returns whether the camera is in driver mode.
std::shared_ptr< wpi::nt::NetworkTable > GetCameraTable() const
Definition PhotonCamera.h:228
wpi::nt::IntegerSubscriber fpsLimitSubscriber
Definition PhotonCamera.h:255
void SetPipelineIndex(int index)
Allows the user to select the active pipeline index.
LEDMode GetLEDMode() const
Returns the current LED mode.
wpi::nt::IntegerPublisher ledModePub
Definition PhotonCamera.h:246
void SetLEDMode(LEDMode led)
Sets the LED mode.
std::vector< PhotonPipelineResult > GetAllUnreadResults()
The list of pipeline results sent by PhotonVision since the last call to GetAllUnreadResults().
std::string cameraName
Definition PhotonCamera.h:267
wpi::Alert timesyncAlert
Definition PhotonCamera.h:270
std::vector< PhotonPipelineResult > testResult
Definition PhotonCamera.h:234
void TakeOutputSnapshot(void)
Request the camera to save a new image file from the output stream with overlays.
wpi::nt::DoubleArraySubscriber cameraDistortionSubscriber
Definition PhotonCamera.h:251
wpi::nt::DoubleArraySubscriber cameraIntrinsicsSubscriber
Definition PhotonCamera.h:250
wpi::nt::BooleanPublisher driverModePublisher
Definition PhotonCamera.h:254
wpi::nt::IntegerPublisher outputSaveImgEntry
Definition PhotonCamera.h:242
std::string path
Definition PhotonCamera.h:266
wpi::nt::IntegerPublisher inputSaveImgEntry
Definition PhotonCamera.h:240
std::optional< DistortionMatrix > GetDistCoeffs()
Returns the camera calibration's distortion coefficients, in OPENCV8 form.
PhotonCamera(PhotonCamera &&)=default
wpi::nt::MultiSubscriber topicNameSubscriber
Definition PhotonCamera.h:264
int GetPipelineIndex() const
Returns the active pipeline index.
Eigen::Matrix< double, 3, 3 > CameraMatrix
Definition PhotonCamera.h:199
Represents a pipeline result from a PhotonCamera.
Definition PhotonPipelineResult.h:34
Definition PhotonCamera.h:45
Definition VisionEstimation.h:30
LEDMode
Definition PhotonCamera.h:51
@ kOff
Definition PhotonCamera.h:51
@ kBlink
Definition PhotonCamera.h:51
@ kOn
Definition PhotonCamera.h:51
@ kDefault
Definition PhotonCamera.h:51