mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Allow file uploads of any size and better report active cameras in PhotonCamera error print (#1298)
Previously reported itself which was confusing. New print: ``` Error at org.photonvision.PhotonCamera.verifyVersion(PhotonCamera.java:378): Found the following PhotonVision cameras active on NetworkTables: ==> HD_Pro_Webcam_C920 ==> Arducam_OV9281_USB_Camera ```
This commit is contained in:
@@ -91,9 +91,9 @@ PhotonCamera::PhotonCamera(nt::NetworkTableInstance instance,
|
||||
rootTable->GetBooleanTopic("driverMode").Subscribe(false)),
|
||||
driverModePublisher(
|
||||
rootTable->GetBooleanTopic("driverModeRequest").Publish()),
|
||||
m_topicNameSubscriber(instance, PHOTON_PREFIX, {.topicsOnly = true}),
|
||||
topicNameSubscriber(instance, PHOTON_PREFIX, {.topicsOnly = true}),
|
||||
path(rootTable->GetPath()),
|
||||
m_cameraName(cameraName) {
|
||||
cameraName(cameraName) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_PhotonCamera, InstanceCount);
|
||||
InstanceCount++;
|
||||
}
|
||||
@@ -173,7 +173,7 @@ void PhotonCamera::SetLEDMode(LEDMode mode) {
|
||||
}
|
||||
|
||||
const std::string_view PhotonCamera::GetCameraName() const {
|
||||
return m_cameraName;
|
||||
return cameraName;
|
||||
}
|
||||
|
||||
std::optional<cv::Mat> PhotonCamera::GetDistCoeffs() {
|
||||
@@ -232,4 +232,17 @@ void PhotonCamera::VerifyVersion() {
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> PhotonCamera::tablesThatLookLikePhotonCameras() {
|
||||
std::vector<std::string> cameraNames = mainTable->GetSubTables();
|
||||
|
||||
std::vector<std::string> ret;
|
||||
std::copy_if(
|
||||
cameraNames.begin(), cameraNames.end(), std::back_inserter(ret),
|
||||
[this](auto& it) {
|
||||
return mainTable->GetSubTable(it)->GetEntry("rawBytes").Exists();
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace photon
|
||||
|
||||
Reference in New Issue
Block a user