Publish FPS with camera (#2083)

This commit is contained in:
Jade
2025-09-12 22:10:37 +08:00
committed by GitHub
parent b43d0dde20
commit 058ca19262
2 changed files with 4 additions and 0 deletions

View File

@@ -171,6 +171,7 @@ public class NTDataPublisher implements CVPipelineResultConsumer {
ts.pipelineIndexPublisher.set(pipelineIndexSupplier.get());
ts.driverModePublisher.set(driverModeSupplier.getAsBoolean());
ts.latencyMillisEntry.set(acceptedResult.getLatencyMillis());
ts.fpsEntry.set(acceptedResult.fps);
ts.hasTargetEntry.set(acceptedResult.hasTargets());
if (acceptedResult.hasTargets()) {

View File

@@ -54,6 +54,7 @@ public class NTTopicSet {
public BooleanSubscriber driverModeSubscriber;
public DoublePublisher latencyMillisEntry;
public DoublePublisher fpsEntry;
public BooleanPublisher hasTargetEntry;
public DoublePublisher targetPitchEntry;
public DoublePublisher targetYawEntry;
@@ -100,6 +101,7 @@ public class NTTopicSet {
driverModeSubscriber.getTopic().publish().setDefault(false);
latencyMillisEntry = subTable.getDoubleTopic("latencyMillis").publish();
fpsEntry = subTable.getDoubleTopic("fps").publish();
hasTargetEntry = subTable.getBooleanTopic("hasTarget").publish();
targetPitchEntry = subTable.getDoubleTopic("targetPitch").publish();
@@ -128,6 +130,7 @@ public class NTTopicSet {
if (driverModeSubscriber != null) driverModeSubscriber.close();
if (latencyMillisEntry != null) latencyMillisEntry.close();
if (fpsEntry != null) fpsEntry.close();
if (hasTargetEntry != null) hasTargetEntry.close();
if (targetPitchEntry != null) targetPitchEntry.close();
if (targetAreaEntry != null) targetAreaEntry.close();