diff --git a/README.md b/README.md index 4fcf69c59..c559bb963 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Note that these are case sensitive! * arm64 * x86-64 * x86 -- `-PtgtIp`: Specifies where `./gradlew deploy` should try to copy the fat JAR to +- `-PtgtIP`: Specifies where `./gradlew deploy` should try to copy the fat JAR to - `-Pprofile`: enables JVM profiling ## Out-of-Source Dependencies diff --git a/photon-lib/py/photonlibpy/packet.py b/photon-lib/py/photonlibpy/packet.py index fee574ebd..a4e375d43 100644 --- a/photon-lib/py/photonlibpy/packet.py +++ b/photon-lib/py/photonlibpy/packet.py @@ -88,7 +88,7 @@ def _decodeGeneric(self, unpackFormat, numBytes): # Interpret the bytes as the requested type. # Note due to NT's byte order assumptions, # we have to flip the order of intList - value = struct.unpack(unpackFormat, bytes(reversed(intList)))[0] + value = struct.unpack(unpackFormat, bytes(intList))[0] return value @@ -98,7 +98,7 @@ def decode8(self) -> int: * * @return A decoded byte from the packet. """ - return self._decodeGeneric(">b", 1) + return self._decodeGeneric(" int: """ @@ -106,7 +106,7 @@ def decode16(self) -> int: * * @return A decoded short from the packet. """ - return self._decodeGeneric(">h", 2) + return self._decodeGeneric(" int: """ @@ -114,7 +114,7 @@ def decodeInt(self) -> int: * * @return A decoded int from the packet. """ - return self._decodeGeneric(">l", 4) + return self._decodeGeneric(" float: """ @@ -122,7 +122,7 @@ def decodeFloat(self) -> float: * * @return A decoded float from the packet. """ - return self._decodeGeneric(">f", 4) + return self._decodeGeneric(" int: """ @@ -130,7 +130,7 @@ def decodeLong(self) -> int: * * @return A decoded int64 from the packet. """ - return self._decodeGeneric(">q", 8) + return self._decodeGeneric(" float: """ @@ -138,7 +138,7 @@ def decodeDouble(self) -> float: * * @return A decoded double from the packet. """ - return self._decodeGeneric(">d", 8) + return self._decodeGeneric(" bool: """ diff --git a/photon-lib/py/photonlibpy/photonCamera.py b/photon-lib/py/photonlibpy/photonCamera.py index 32f337b20..eb2676d4c 100644 --- a/photon-lib/py/photonlibpy/photonCamera.py +++ b/photon-lib/py/photonlibpy/photonCamera.py @@ -225,7 +225,12 @@ def _versionCheck(self) -> None: ) versionString = self.versionEntry.get(defaultValue="") - if len(versionString) > 0 and versionString != PHOTONVISION_VERSION: + localUUID = PhotonPipelineResult.photonStruct.MESSAGE_VERSION + remoteUUID = self._rawBytesEntry.getTopic().getProperty("message_uuid") + + if remoteUUID is None or len(remoteUUID) == 0: + wpilib.reportWarning(f"PhotonVision coprocessor at path {self._path} has not reported a message interface UUID - is your coprocessor's camera started?", True) + elif localUUID != remoteUUID: # Verified version mismatch bfw = """ @@ -250,6 +255,6 @@ def _versionCheck(self) -> None: wpilib.reportWarning(bfw) - errText = f"Photon version {PHOTONLIB_VERSION} does not match coprocessor version {versionString}. Please install photonlibpy version {versionString}, or update your coprocessor to {PHOTONLIB_VERSION}." + errText = f"Photonlibpy version {PHOTONLIB_VERSION} (With message UUID {localUUID}) does not match coprocessor version {versionString} (with message UUID {remoteUUID}). Please install photonlibpy version {versionString}, or update your coprocessor to {PHOTONLIB_VERSION}." wpilib.reportError(errText, True) raise Exception(errText) diff --git a/photon-lib/src/main/java/org/photonvision/PhotonCamera.java b/photon-lib/src/main/java/org/photonvision/PhotonCamera.java index 1130d20a0..633cf5fcb 100644 --- a/photon-lib/src/main/java/org/photonvision/PhotonCamera.java +++ b/photon-lib/src/main/java/org/photonvision/PhotonCamera.java @@ -422,7 +422,7 @@ else if (!isConnected()) { DriverStation.reportWarning( "PhotonVision coprocessor at path " + path - + " has note reported a message interface UUID - is your coprocessor's camera started?", + + " has not reported a message interface UUID - is your coprocessor's camera started?", true); } else if (!local_uuid.equals(remote_uuid)) { // Error on a verified version mismatch diff --git a/scripts/catnt.py b/scripts/catnt.py index a971fda4b..8010e6841 100644 --- a/scripts/catnt.py +++ b/scripts/catnt.py @@ -5,7 +5,6 @@ def list_topics(inst: ntcore.NetworkTableInstance, root: str): - topics = inst.getTable(root).getTopics() subtables = inst.getTable(root).getSubTables()