Represents a camera that is connected to PhotonVision.
More...
#include <photon/PhotonCamera.h>
Represents a camera that is connected to PhotonVision.
ß
◆ CameraMatrix
◆ DistortionMatrix
◆ PhotonCamera() [1/3]
photon::PhotonCamera::PhotonCamera |
( |
nt::NetworkTableInstance | instance, |
|
|
const std::string_view | cameraName ) |
|
explicit |
Constructs a PhotonCamera from a root table.
- Parameters
-
instance | The NetworkTableInstance to pull data from. This can be a custom instance in simulation, but should usually be the default NTInstance from NetworkTableInstance::getDefault |
cameraName | The name of the camera, as seen in the UI. over. |
◆ PhotonCamera() [2/3]
photon::PhotonCamera::PhotonCamera |
( |
const std::string_view | cameraName | ) |
|
|
explicit |
Constructs a PhotonCamera from the name of the camera.
- Parameters
-
cameraName | The nickname of the camera (found in the PhotonVision UI). |
◆ PhotonCamera() [3/3]
◆ ~PhotonCamera()
photon::PhotonCamera::~PhotonCamera |
( |
| ) |
|
|
default |
◆ GetAllUnreadResults()
The list of pipeline results sent by PhotonVision since the last call to GetAllUnreadResults().
Calling this function clears the internal FIFO queue, and multiple calls to GetAllUnreadResults() will return different (potentially empty) result arrays. Be careful to call this exactly ONCE per loop of your robot code! FIFO depth is limited to 20 changes, so make sure to call this frequently enough to avoid old results being discarded, too!
◆ GetCameraMatrix()
std::optional< CameraMatrix > photon::PhotonCamera::GetCameraMatrix |
( |
| ) |
|
Get the camera calibration matrix, in standard OpenCV form.
- Returns
- std::optional<cv::Mat>
◆ GetCameraName()
const std::string_view photon::PhotonCamera::GetCameraName |
( |
| ) |
const |
Returns the name of the camera.
This will return the same value that was given to the constructor as cameraName.
- Returns
- The name of the camera.
◆ GetCameraTable()
std::shared_ptr< nt::NetworkTable > photon::PhotonCamera::GetCameraTable |
( |
| ) |
const |
|
inline |
◆ GetDistCoeffs()
Get the camera calibration distortion coefficients, in OPENCV8 form.
Higher order terms are set to zero.
- Returns
- std::optional<cv::Mat>
◆ GetDriverMode()
bool photon::PhotonCamera::GetDriverMode |
( |
| ) |
const |
Returns whether the camera is in driver mode.
- Returns
- Whether the camera is in driver mode.
◆ GetLatestResult()
◆ GetLEDMode()
LEDMode photon::PhotonCamera::GetLEDMode |
( |
| ) |
const |
Returns the current LED mode.
- Returns
- The current LED mode.
◆ GetPipelineIndex()
int photon::PhotonCamera::GetPipelineIndex |
( |
| ) |
const |
Returns the active pipeline index.
- Returns
- The active pipeline index.
◆ IsConnected()
bool photon::PhotonCamera::IsConnected |
( |
| ) |
|
Returns whether the camera is connected and actively returning new data.
Connection status is debounced.
- Returns
- True if the camera is actively sending frame data, false otherwise.
◆ SetDriverMode()
void photon::PhotonCamera::SetDriverMode |
( |
bool | driverMode | ) |
|
Toggles driver mode.
- Parameters
-
driverMode | Whether to set driver mode. |
◆ SetLEDMode()
void photon::PhotonCamera::SetLEDMode |
( |
LEDMode | led | ) |
|
Sets the LED mode.
- Parameters
-
◆ SetPipelineIndex()
void photon::PhotonCamera::SetPipelineIndex |
( |
int | index | ) |
|
Allows the user to select the active pipeline index.
- Parameters
-
index | The active pipeline index. |
◆ SetVersionCheckEnabled()
static void photon::PhotonCamera::SetVersionCheckEnabled |
( |
bool | enabled | ) |
|
|
static |
◆ TakeInputSnapshot()
void photon::PhotonCamera::TakeInputSnapshot |
( |
void | | ) |
|
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 space and eventually cause the system to stop working. Clear out images in /opt/photonvision/photonvision_config/imgSaves frequently to prevent issues.
◆ TakeOutputSnapshot()
void photon::PhotonCamera::TakeOutputSnapshot |
( |
void | | ) |
|
Request the camera to save a new image file from the output stream with overlays.
Images take up space in the filesystem of the PhotonCamera. Calling it frequently will fill up disk space and eventually cause the system to stop working. Clear out images in /opt/photonvision/photonvision_config/imgSaves frequently to prevent issues.
◆ cameraDistortionSubscriber
nt::DoubleArraySubscriber photon::PhotonCamera::cameraDistortionSubscriber |
|
protected |
◆ cameraIntrinsicsSubscriber
nt::DoubleArraySubscriber photon::PhotonCamera::cameraIntrinsicsSubscriber |
|
protected |
◆ cameraName
std::string photon::PhotonCamera::cameraName |
|
protected |
◆ disconnectAlert
frc::Alert photon::PhotonCamera::disconnectAlert |
|
protected |
◆ driverModePublisher
nt::BooleanPublisher photon::PhotonCamera::driverModePublisher |
|
protected |
◆ driverModeSubscriber
nt::BooleanSubscriber photon::PhotonCamera::driverModeSubscriber |
|
protected |
◆ heartbeatSubscriber
nt::IntegerSubscriber photon::PhotonCamera::heartbeatSubscriber |
|
protected |
◆ inputSaveImgEntry
nt::IntegerPublisher photon::PhotonCamera::inputSaveImgEntry |
|
protected |
◆ inputSaveImgSubscriber
nt::IntegerSubscriber photon::PhotonCamera::inputSaveImgSubscriber |
|
protected |
◆ ledModePub
nt::IntegerPublisher photon::PhotonCamera::ledModePub |
|
protected |
◆ ledModeSub
nt::IntegerSubscriber photon::PhotonCamera::ledModeSub |
|
protected |
◆ ledModeSubscriber
nt::IntegerSubscriber photon::PhotonCamera::ledModeSubscriber |
|
protected |
◆ mainTable
std::shared_ptr<nt::NetworkTable> photon::PhotonCamera::mainTable |
|
protected |
◆ outputSaveImgEntry
nt::IntegerPublisher photon::PhotonCamera::outputSaveImgEntry |
|
protected |
◆ outputSaveImgSubscriber
nt::IntegerSubscriber photon::PhotonCamera::outputSaveImgSubscriber |
|
protected |
◆ path
std::string photon::PhotonCamera::path |
|
protected |
◆ pipelineIndexPub
nt::IntegerPublisher photon::PhotonCamera::pipelineIndexPub |
|
protected |
◆ pipelineIndexSub
nt::IntegerSubscriber photon::PhotonCamera::pipelineIndexSub |
|
protected |
◆ rawBytesEntry
nt::RawSubscriber photon::PhotonCamera::rawBytesEntry |
|
protected |
◆ rootTable
std::shared_ptr<nt::NetworkTable> photon::PhotonCamera::rootTable |
|
protected |
◆ test
bool photon::PhotonCamera::test = false |
◆ testResult
◆ timesyncAlert
frc::Alert photon::PhotonCamera::timesyncAlert |
|
protected |
◆ topicNameSubscriber
nt::MultiSubscriber photon::PhotonCamera::topicNameSubscriber |
|
protected |
◆ versionEntry
nt::StringSubscriber photon::PhotonCamera::versionEntry |
|
protected |
The documentation for this class was generated from the following file: