Skip to content

Commit 4b5bc6a

Browse files
authored
Update logic for metric publisher topic name (#2011)
1 parent 758fbb9 commit 4b5bc6a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

photon-core/src/main/java/org/photonvision/common/hardware/metrics/MetricsManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.photonvision.common.hardware.metrics;
1919

2020
import edu.wpi.first.cscore.CameraServerJNI;
21+
import edu.wpi.first.networktables.NetworkTable;
2122
import edu.wpi.first.networktables.ProtobufPublisher;
2223
import java.io.PrintWriter;
2324
import java.io.StringWriter;
@@ -246,7 +247,8 @@ public void publishMetrics() {
246247
logger.debug("Publishing Metrics...");
247248

248249
// Check that the hostname hasn't changed
249-
if (!metricPublisher.getTopic().getName().equals(CameraServerJNI.getHostname())) {
250+
if (!CameraServerJNI.getHostname()
251+
.equals(NetworkTable.basenameKey(metricPublisher.getTopic().getName()))) {
250252
logger.warn("Metrics publisher name does not match hostname! Reinitializing publisher...");
251253
metricPublisher.close();
252254
metricPublisher =

0 commit comments

Comments
 (0)