mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-22 01:11:40 +00:00
Assert that version checking won't throw on startup (#1512)
# Overview Previously if the coproc came up later, getProperty would return the string literal "null", which made us print the BFW. Add tests to make sure that we don't do that anymore by rebooting a sim coproc + robot in a combination of different orders.
This commit is contained in:
@@ -30,7 +30,7 @@ public class PhotonPipelineMetadata implements PhotonStructSerializable<PhotonPi
|
||||
// Mirror of the heartbeat entry -- monotonically increasing
|
||||
public long sequenceID;
|
||||
|
||||
// Time from last Time Sync Pong received and the construction of this metadata
|
||||
// Time from last Time Sync Pong received and the construction of this metadata, in uS
|
||||
public long timeSinceLastPong;
|
||||
|
||||
public PhotonPipelineMetadata(
|
||||
@@ -73,12 +73,14 @@ public class PhotonPipelineMetadata implements PhotonStructSerializable<PhotonPi
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PhotonPipelineMetadata [sequenceID="
|
||||
+ sequenceID
|
||||
+ ", captureTimestampMicros="
|
||||
return "PhotonPipelineMetadata [captureTimestampMicros="
|
||||
+ captureTimestampMicros
|
||||
+ ", publishTimestampMicros="
|
||||
+ publishTimestampMicros
|
||||
+ ", sequenceID="
|
||||
+ sequenceID
|
||||
+ ", timeSinceLastPong="
|
||||
+ timeSinceLastPong
|
||||
+ "]";
|
||||
}
|
||||
|
||||
@@ -86,9 +88,10 @@ public class PhotonPipelineMetadata implements PhotonStructSerializable<PhotonPi
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (int) (sequenceID ^ (sequenceID >>> 32));
|
||||
result = prime * result + (int) (captureTimestampMicros ^ (captureTimestampMicros >>> 32));
|
||||
result = prime * result + (int) (publishTimestampMicros ^ (publishTimestampMicros >>> 32));
|
||||
result = prime * result + (int) (sequenceID ^ (sequenceID >>> 32));
|
||||
result = prime * result + (int) (timeSinceLastPong ^ (timeSinceLastPong >>> 32));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -98,9 +101,10 @@ public class PhotonPipelineMetadata implements PhotonStructSerializable<PhotonPi
|
||||
if (obj == null) return false;
|
||||
if (getClass() != obj.getClass()) return false;
|
||||
PhotonPipelineMetadata other = (PhotonPipelineMetadata) obj;
|
||||
if (sequenceID != other.sequenceID) return false;
|
||||
if (captureTimestampMicros != other.captureTimestampMicros) return false;
|
||||
if (publishTimestampMicros != other.publishTimestampMicros) return false;
|
||||
if (sequenceID != other.sequenceID) return false;
|
||||
if (timeSinceLastPong != other.timeSinceLastPong) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,5 +69,6 @@ public class PhotonPipelineResultProto
|
||||
msg.setSequenceId(value.metadata.getSequenceID());
|
||||
msg.setCaptureTimestampMicros(value.metadata.getCaptureTimestampMicros());
|
||||
msg.setNtPublishTimestampMicros(value.metadata.getPublishTimestampMicros());
|
||||
msg.setTimeSinceLastPongMicros(value.metadata.timeSinceLastPong);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user