Skip to content

Commit

Permalink
Merge branch 'master' into statusLedsRound2
Browse files Browse the repository at this point in the history
  • Loading branch information
gerth2 authored Dec 28, 2023
2 parents 4375ff4 + ebac32c commit 99b1a74
Showing 1 changed file with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,9 @@ public void pack(Packet packet, PhotonTrackedTarget value) {
packet.encode(value.area);
packet.encode(value.skew);
packet.encode(value.fiducialId);
if (value.fiducialId != -1) {
PacketUtils.packTransform3d(packet, value.bestCameraToTarget);
PacketUtils.packTransform3d(packet, value.altCameraToTarget);
packet.encode(value.poseAmbiguity);
}
PacketUtils.packTransform3d(packet, value.bestCameraToTarget);
PacketUtils.packTransform3d(packet, value.altCameraToTarget);
packet.encode(value.poseAmbiguity);

for (int i = 0; i < 4; i++) {
TargetCorner.serde.pack(packet, value.minAreaRectCorners.get(i));
Expand All @@ -250,18 +248,9 @@ public PhotonTrackedTarget unpack(Packet packet) {
var area = packet.decodeDouble();
var skew = packet.decodeDouble();
var fiducialId = packet.decodeInt();
Transform3d best;
Transform3d alt;
double ambiguity;
if (fiducialId != -1.0) {
best = PacketUtils.unpackTransform3d(packet);
alt = PacketUtils.unpackTransform3d(packet);
ambiguity = packet.decodeDouble();
} else {
best = new Transform3d();
alt = new Transform3d();
ambiguity = -1.0;
}
Transform3d best = PacketUtils.unpackTransform3d(packet);
Transform3d alt = PacketUtils.unpackTransform3d(packet);
double ambiguity = packet.decodeDouble();

var minAreaRectCorners = new ArrayList<TargetCorner>(4);
for (int i = 0; i < 4; i++) {
Expand Down

0 comments on commit 99b1a74

Please sign in to comment.