Update to match new WPILib organization

This commit is contained in:
Gold856
2025-12-29 16:16:56 -05:00
committed by samfreund
parent c34c854583
commit 934eed21d2
264 changed files with 3440 additions and 3299 deletions

View File

@@ -28,16 +28,17 @@
#include <string>
#include <vector>
#include <frc/Alert.h>
#include <networktables/BooleanTopic.h>
#include <networktables/DoubleArrayTopic.h>
#include <networktables/IntegerTopic.h>
#include <networktables/MultiSubscriber.h>
#include <networktables/NetworkTable.h>
#include <networktables/NetworkTableInstance.h>
#include <networktables/RawTopic.h>
#include <networktables/StringTopic.h>
#include <units/time.h>
#include <wpi/nt/BooleanTopic.hpp>
#include <wpi/nt/DoubleArrayTopic.hpp>
#include <wpi/nt/DoubleTopic.hpp>
#include <wpi/nt/IntegerTopic.hpp>
#include <wpi/nt/MultiSubscriber.hpp>
#include <wpi/nt/NetworkTable.hpp>
#include <wpi/nt/NetworkTableInstance.hpp>
#include <wpi/nt/RawTopic.hpp>
#include <wpi/nt/StringTopic.hpp>
#include <wpi/units/time.hpp>
#include <wpi/util/Alert.hpp>
#include "photon/targeting/PhotonPipelineResult.h"
@@ -63,7 +64,7 @@ class PhotonCamera {
* @param cameraName The name of the camera, as seen in the UI.
* over.
*/
explicit PhotonCamera(nt::NetworkTableInstance instance,
explicit PhotonCamera(wpi::nt::NetworkTableInstance instance,
const std::string_view cameraName);
/**
@@ -203,55 +204,55 @@ class PhotonCamera {
*/
static void SetVersionCheckEnabled(bool enabled);
std::shared_ptr<nt::NetworkTable> GetCameraTable() const { return rootTable; }
std::shared_ptr<wpi::nt::NetworkTable> GetCameraTable() const { return rootTable; }
// For use in tests
bool test = false;
std::vector<PhotonPipelineResult> testResult;
protected:
std::shared_ptr<nt::NetworkTable> mainTable;
std::shared_ptr<nt::NetworkTable> rootTable;
nt::RawSubscriber rawBytesEntry;
nt::IntegerPublisher inputSaveImgEntry;
nt::IntegerSubscriber inputSaveImgSubscriber;
nt::IntegerPublisher outputSaveImgEntry;
nt::IntegerSubscriber outputSaveImgSubscriber;
nt::IntegerPublisher pipelineIndexPub;
nt::IntegerSubscriber pipelineIndexSub;
nt::IntegerPublisher ledModePub;
nt::IntegerSubscriber ledModeSub;
nt::StringSubscriber versionEntry;
std::shared_ptr<wpi::nt::NetworkTable> mainTable;
std::shared_ptr<wpi::nt::NetworkTable> rootTable;
wpi::nt::RawSubscriber rawBytesEntry;
wpi::nt::IntegerPublisher inputSaveImgEntry;
wpi::nt::IntegerSubscriber inputSaveImgSubscriber;
wpi::nt::IntegerPublisher outputSaveImgEntry;
wpi::nt::IntegerSubscriber outputSaveImgSubscriber;
wpi::nt::IntegerPublisher pipelineIndexPub;
wpi::nt::IntegerSubscriber pipelineIndexSub;
wpi::nt::IntegerPublisher ledModePub;
wpi::nt::IntegerSubscriber ledModeSub;
wpi::nt::StringSubscriber versionEntry;
nt::DoubleArraySubscriber cameraIntrinsicsSubscriber;
nt::DoubleArraySubscriber cameraDistortionSubscriber;
wpi::nt::DoubleArraySubscriber cameraIntrinsicsSubscriber;
wpi::nt::DoubleArraySubscriber cameraDistortionSubscriber;
nt::BooleanSubscriber driverModeSubscriber;
nt::BooleanPublisher driverModePublisher;
nt::IntegerSubscriber fpsLimitSubscriber;
nt::IntegerPublisher fpsLimitPublisher;
wpi::nt::BooleanSubscriber driverModeSubscriber;
wpi::nt::BooleanPublisher driverModePublisher;
wpi::nt::IntegerSubscriber fpsLimitSubscriber;
wpi::nt::IntegerPublisher fpsLimitPublisher;
nt::IntegerSubscriber ledModeSubscriber;
wpi::nt::IntegerSubscriber ledModeSubscriber;
nt::IntegerSubscriber heartbeatSubscriber;
wpi::nt::IntegerSubscriber heartbeatSubscriber;
nt::MultiSubscriber topicNameSubscriber;
wpi::nt::MultiSubscriber topicNameSubscriber;
std::string path;
std::string cameraName;
frc::Alert disconnectAlert;
frc::Alert timesyncAlert;
wpi::Alert disconnectAlert;
wpi::Alert timesyncAlert;
private:
units::second_t lastVersionCheckTime = 0_s;
wpi::units::second_t lastVersionCheckTime = 0_s;
static bool VERSION_CHECK_ENABLED;
inline static int InstanceCount = 1;
units::second_t prevTimeSyncWarnTime = 0_s;
wpi::units::second_t prevTimeSyncWarnTime = 0_s;
int prevHeartbeatValue = -1;
units::second_t prevHeartbeatChangeTime = 0_s;
wpi::units::second_t prevHeartbeatChangeTime = 0_s;
void VerifyVersion();