mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-21 01:01:41 +00:00
Expose camera name in PhotonCamera (#523)
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
This commit is contained in:
@@ -58,14 +58,14 @@ class PhotonCamera {
|
||||
* over.
|
||||
*/
|
||||
explicit PhotonCamera(std::shared_ptr<nt::NetworkTableInstance> instance,
|
||||
const std::string& cameraName);
|
||||
const std::string_view cameraName);
|
||||
|
||||
/**
|
||||
* Constructs a PhotonCamera from the name of the camera.
|
||||
* @param cameraName The nickname of the camera (found in the PhotonVision
|
||||
* UI).
|
||||
*/
|
||||
explicit PhotonCamera(const std::string& cameraName);
|
||||
explicit PhotonCamera(const std::string_view cameraName);
|
||||
|
||||
/**
|
||||
* Returns the latest pipeline result.
|
||||
@@ -131,6 +131,14 @@ class PhotonCamera {
|
||||
*/
|
||||
void SetLEDMode(LEDMode led);
|
||||
|
||||
/**
|
||||
* Returns the name of the camera.
|
||||
* This will return the same value that was given to the constructor as
|
||||
* cameraName.
|
||||
* @return The name of the camera.
|
||||
*/
|
||||
const std::string_view GetCameraName() const;
|
||||
|
||||
/**
|
||||
* Returns whether the latest target result has targets.
|
||||
* This method is deprecated; {@link PhotonPipelineResult#hasTargets()} should
|
||||
@@ -163,6 +171,7 @@ class PhotonCamera {
|
||||
nt::IntegerSubscriber ledModeSubscriber;
|
||||
|
||||
std::string path;
|
||||
std::string m_cameraName;
|
||||
|
||||
mutable Packet packet;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user