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>
248 units::second_t lastVersionCheckTime = 0_s;
249 static bool VERSION_CHECK_ENABLED;
250 inline static int InstanceCount = 1;
252 units::second_t prevTimeSyncWarnTime = 0_s;
254 int prevHeartbeatValue = -1;
255 units::second_t prevHeartbeatChangeTime = 0_s;
257 void VerifyVersion();
259 void UpdateDisconnectAlert();
262 std::vector<std::string> tablesThatLookLikePhotonCameras();
Represents a camera that is connected to PhotonVision.
Definition PhotonCamera.h:56
nt::IntegerSubscriber pipelineIndexSub
Definition PhotonCamera.h:222
frc::Alert disconnectAlert
Definition PhotonCamera.h:244
std::shared_ptr< nt::NetworkTable > rootTable
Definition PhotonCamera.h:215
std::optional< CameraMatrix > GetCameraMatrix()
Get the camera calibration matrix, in standard OpenCV form.
void SetFPSLimit(int fpsLimit)
nt::IntegerPublisher outputSaveImgEntry
Definition PhotonCamera.h:219
PhotonPipelineResult GetLatestResult()
bool test
Definition PhotonCamera.h:210
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:179
nt::BooleanPublisher driverModePublisher
Definition PhotonCamera.h:231
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:235
nt::DoubleArraySubscriber cameraIntrinsicsSubscriber
Definition PhotonCamera.h:227
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:228
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:214
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:223
LEDMode GetLEDMode() const
Returns the current LED mode.
nt::StringSubscriber versionEntry
Definition PhotonCamera.h:225
nt::IntegerSubscriber ledModeSub
Definition PhotonCamera.h:224
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:242
std::vector< PhotonPipelineResult > testResult
Definition PhotonCamera.h:211
nt::IntegerSubscriber inputSaveImgSubscriber
Definition PhotonCamera.h:218
void TakeOutputSnapshot(void)
Request the camera to save a new image file from the output stream with overlays.
nt::IntegerPublisher inputSaveImgEntry
Definition PhotonCamera.h:217
nt::IntegerSubscriber fpsLimitSubscriber
Definition PhotonCamera.h:232
std::shared_ptr< nt::NetworkTable > GetCameraTable() const
Definition PhotonCamera.h:207
nt::MultiSubscriber topicNameSubscriber
Definition PhotonCamera.h:239
nt::IntegerSubscriber heartbeatSubscriber
Definition PhotonCamera.h:237
nt::RawSubscriber rawBytesEntry
Definition PhotonCamera.h:216
std::string path
Definition PhotonCamera.h:241
nt::BooleanSubscriber driverModeSubscriber
Definition PhotonCamera.h:230
std::optional< DistortionMatrix > GetDistCoeffs()
Returns the camera calibration's distortion coefficients, in OPENCV8 form.
frc::Alert timesyncAlert
Definition PhotonCamera.h:245
PhotonCamera(PhotonCamera &&)=default
nt::IntegerSubscriber outputSaveImgSubscriber
Definition PhotonCamera.h:220
nt::IntegerPublisher fpsLimitPublisher
Definition PhotonCamera.h:233
int GetPipelineIndex() const
Returns the active pipeline index.
nt::IntegerPublisher pipelineIndexPub
Definition PhotonCamera.h:221
Eigen::Matrix< double, 3, 3 > CameraMatrix
Definition PhotonCamera.h:178
Represents a pipeline result from a PhotonCamera.
Definition PhotonPipelineResult.h:37
Definition PhotonCamera.h:45
Definition TargetModel.h:27
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