Add protobuf publish setting slider (#1075)

Allows logging software and live data view to see results. Also removes the requirement for AScope to keep up with the packet serde schema and instead just use the Protobuf descriptor.
This commit is contained in:
Sriman Achanta
2023-12-31 00:14:21 -05:00
committed by GitHub
parent e3eff8731f
commit 2ecd988628
41 changed files with 1630 additions and 41 deletions

View File

@@ -37,6 +37,7 @@ public class NetworkConfig {
public String hostname = "photonvision";
public boolean runNTServer = false;
public boolean shouldManage;
public boolean shouldPublishProto = false;
@JsonIgnore public static final String NM_IFACE_STRING = "${interface}";
@JsonIgnore public static final String NM_IP_STRING = "${ipaddr}";
@@ -72,6 +73,7 @@ public class NetworkConfig {
@JsonProperty("hostname") String hostname,
@JsonProperty("runNTServer") boolean runNTServer,
@JsonProperty("shouldManage") boolean shouldManage,
@JsonProperty("shouldPublishProto") boolean shouldPublishProto,
@JsonProperty("networkManagerIface") String networkManagerIface,
@JsonProperty("setStaticCommand") String setStaticCommand,
@JsonProperty("setDHCPcommand") String setDHCPcommand) {
@@ -80,6 +82,7 @@ public class NetworkConfig {
this.staticIp = staticIp;
this.hostname = hostname;
this.runNTServer = runNTServer;
this.shouldPublishProto = shouldPublishProto;
this.networkManagerIface = networkManagerIface;
this.setStaticCommand = setStaticCommand;
this.setDHCPcommand = setDHCPcommand;

View File

@@ -22,6 +22,7 @@ import edu.wpi.first.networktables.NetworkTableEvent;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer;
import java.util.function.Supplier;
import org.photonvision.common.configuration.ConfigManager;
import org.photonvision.common.dataflow.CVPipelineResultConsumer;
import org.photonvision.common.logging.LogGroup;
import org.photonvision.common.logging.Logger;
@@ -135,6 +136,9 @@ public class NTDataPublisher implements CVPipelineResultConsumer {
result.multiTagResult);
ts.resultPublisher.accept(simplified, simplified.getPacketSize());
if (ConfigManager.getInstance().getConfig().getNetworkConfig().shouldPublishProto) {
ts.protoResultPublisher.set(simplified);
}
ts.pipelineIndexPublisher.set(pipelineIndexSupplier.get());
ts.driverModePublisher.set(driverModeSupplier.getAsBoolean());