Report cpp usage (#1045)

This commit is contained in:
Sriman Achanta
2023-12-16 15:26:00 -05:00
committed by GitHub
parent cba4db0bce
commit 6b8882fe53
4 changed files with 21 additions and 3 deletions

View File

@@ -24,6 +24,8 @@
#include "photon/PhotonCamera.h"
#include <hal/FRCUsageReporting.h>
#include <frc/Errors.h>
#include <frc/Timer.h>
#include <opencv2/core.hpp>
@@ -69,7 +71,10 @@ PhotonCamera::PhotonCamera(nt::NetworkTableInstance instance,
rootTable->GetBooleanTopic("driverModeRequest").Publish()),
m_topicNameSubscriber(instance, PHOTON_PREFIX, {.topicsOnly = true}),
path(rootTable->GetPath()),
m_cameraName(cameraName) {}
m_cameraName(cameraName) {
HAL_Report(HALUsageReporting::kResourceType_PhotonCamera, InstanceCount);
InstanceCount++;
}
PhotonCamera::PhotonCamera(const std::string_view cameraName)
: PhotonCamera(nt::NetworkTableInstance::GetDefault(), cameraName) {}