32#include <networktables/BooleanTopic.h>
33#include <networktables/DoubleArrayTopic.h>
34#include <networktables/DoubleTopic.h>
35#include <networktables/IntegerTopic.h>
36#include <networktables/MultiSubscriber.h>
37#include <networktables/NetworkTable.h>
38#include <networktables/NetworkTableInstance.h>
39#include <networktables/RawTopic.h>
40#include <networktables/StringTopic.h>
41#include <units/time.h>
226 units::second_t lastVersionCheckTime = 0_s;
227 static bool VERSION_CHECK_ENABLED;
228 inline static int InstanceCount = 0;
230 units::second_t prevTimeSyncWarnTime = 0_s;
232 int prevHeartbeatValue = -1;
233 units::second_t prevHeartbeatChangeTime = 0_s;
235 void VerifyVersion();
237 void UpdateDisconnectAlert();
240 std::vector<std::string> tablesThatLookLikePhotonCameras();
Represents a camera that is connected to PhotonVision.
Definition PhotonCamera.h:56
nt::IntegerSubscriber pipelineIndexSub
Definition PhotonCamera.h:203
frc::Alert disconnectAlert
Definition PhotonCamera.h:222
std::shared_ptr< nt::NetworkTable > rootTable
Definition PhotonCamera.h:196
std::optional< CameraMatrix > GetCameraMatrix()
Get the camera calibration matrix, in standard OpenCV form.
nt::IntegerPublisher outputSaveImgEntry
Definition PhotonCamera.h:200
PhotonPipelineResult GetLatestResult()
bool test
Definition PhotonCamera.h:191
const std::string_view GetCameraName() const
Returns the name of the camera.
static void SetVersionCheckEnabled(bool enabled)
Eigen::Matrix< double, 8, 1 > DistortionMatrix
Definition PhotonCamera.h:169
nt::BooleanPublisher driverModePublisher
Definition PhotonCamera.h:212
void SetDriverMode(bool driverMode)
Toggles driver mode.
PhotonCamera(nt::NetworkTableInstance instance, const std::string_view cameraName)
Constructs a PhotonCamera from a root table.
nt::IntegerSubscriber ledModeSubscriber
Definition PhotonCamera.h:213
nt::DoubleArraySubscriber cameraIntrinsicsSubscriber
Definition PhotonCamera.h:208
void TakeInputSnapshot(void)
Request the camera to save a new image file from the input camera stream with overlays.
nt::DoubleArraySubscriber cameraDistortionSubscriber
Definition PhotonCamera.h:209
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.
std::shared_ptr< nt::NetworkTable > mainTable
Definition PhotonCamera.h:195
bool GetDriverMode() const
Returns whether the camera is in driver mode.
void SetPipelineIndex(int index)
Allows the user to select the active pipeline index.
nt::IntegerPublisher ledModePub
Definition PhotonCamera.h:204
LEDMode GetLEDMode() const
Returns the current LED mode.
nt::StringSubscriber versionEntry
Definition PhotonCamera.h:206
nt::IntegerSubscriber ledModeSub
Definition PhotonCamera.h:205
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:220
std::vector< PhotonPipelineResult > testResult
Definition PhotonCamera.h:192
nt::IntegerSubscriber inputSaveImgSubscriber
Definition PhotonCamera.h:199
void TakeOutputSnapshot(void)
Request the camera to save a new image file from the output stream with overlays.
nt::IntegerPublisher inputSaveImgEntry
Definition PhotonCamera.h:198
std::shared_ptr< nt::NetworkTable > GetCameraTable() const
Definition PhotonCamera.h:188
nt::MultiSubscriber topicNameSubscriber
Definition PhotonCamera.h:217
nt::IntegerSubscriber heartbeatSubscriber
Definition PhotonCamera.h:215
nt::RawSubscriber rawBytesEntry
Definition PhotonCamera.h:197
std::string path
Definition PhotonCamera.h:219
nt::BooleanSubscriber driverModeSubscriber
Definition PhotonCamera.h:211
std::optional< DistortionMatrix > GetDistCoeffs()
Get the camera calibration distortion coefficients, in OPENCV8 form.
frc::Alert timesyncAlert
Definition PhotonCamera.h:223
PhotonCamera(PhotonCamera &&)=default
nt::IntegerSubscriber outputSaveImgSubscriber
Definition PhotonCamera.h:201
int GetPipelineIndex() const
Returns the active pipeline index.
nt::IntegerPublisher pipelineIndexPub
Definition PhotonCamera.h:202
Eigen::Matrix< double, 3, 3 > CameraMatrix
Definition PhotonCamera.h:168
Represents a pipeline result from a PhotonCamera.
Definition PhotonPipelineResult.h:37
Definition PhotonCamera.h:45
Definition VisionEstimation.h:32
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