mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-21 01:01:41 +00:00
Update PhotonCamera error messages to be more specific (#697)
Closes #692
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <networktables/BooleanTopic.h>
|
||||
#include <networktables/DoubleTopic.h>
|
||||
#include <networktables/IntegerTopic.h>
|
||||
#include <networktables/MultiSubscriber.h>
|
||||
#include <networktables/NetworkTable.h>
|
||||
#include <networktables/NetworkTableInstance.h>
|
||||
#include <networktables/RawTopic.h>
|
||||
@@ -57,7 +58,7 @@ class PhotonCamera {
|
||||
* @param cameraName The name of the camera, as seen in the UI.
|
||||
* over.
|
||||
*/
|
||||
explicit PhotonCamera(std::shared_ptr<nt::NetworkTableInstance> instance,
|
||||
explicit PhotonCamera(nt::NetworkTableInstance instance,
|
||||
const std::string_view cameraName);
|
||||
|
||||
/**
|
||||
@@ -178,6 +179,8 @@ class PhotonCamera {
|
||||
nt::IntegerSubscriber pipelineIndexSubscriber;
|
||||
nt::IntegerSubscriber ledModeSubscriber;
|
||||
|
||||
nt::MultiSubscriber m_topicNameSubscriber;
|
||||
|
||||
std::string path;
|
||||
std::string m_cameraName;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
namespace photonlib {
|
||||
class SimPhotonCamera : public PhotonCamera {
|
||||
public:
|
||||
SimPhotonCamera(std::shared_ptr<nt::NetworkTableInstance> instance,
|
||||
SimPhotonCamera(nt::NetworkTableInstance instance,
|
||||
const std::string& cameraName)
|
||||
: PhotonCamera(instance, cameraName) {
|
||||
latencyMillisEntry = rootTable->GetEntry("latencyMillis");
|
||||
@@ -48,14 +48,12 @@ class SimPhotonCamera : public PhotonCamera {
|
||||
targetSkewEntry = rootTable->GetEntry("targetSkewEntry");
|
||||
targetPoseEntry = rootTable->GetEntry("targetPoseEntry");
|
||||
rawBytesPublisher = rootTable->GetRawTopic("rawBytes").Publish("raw");
|
||||
versionEntry = instance->GetTable("photonvision")->GetEntry("version");
|
||||
versionEntry = instance.GetTable("photonvision")->GetEntry("version");
|
||||
// versionEntry.SetString(PhotonVersion.versionString);
|
||||
}
|
||||
|
||||
explicit SimPhotonCamera(const std::string& cameraName)
|
||||
: SimPhotonCamera(std::make_shared<nt::NetworkTableInstance>(
|
||||
nt::NetworkTableInstance::GetDefault()),
|
||||
cameraName) {}
|
||||
: SimPhotonCamera(nt::NetworkTableInstance::GetDefault(), cameraName) {}
|
||||
|
||||
virtual ~SimPhotonCamera() = default;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user