001/* 002 * MIT License 003 * 004 * Copyright (c) PhotonVision 005 * 006 * Permission is hereby granted, free of charge, to any person obtaining a copy 007 * of this software and associated documentation files (the "Software"), to deal 008 * in the Software without restriction, including without limitation the rights 009 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 010 * copies of the Software, and to permit persons to whom the Software is 011 * furnished to do so, subject to the following conditions: 012 * 013 * The above copyright notice and this permission notice shall be included in all 014 * copies or substantial portions of the Software. 015 * 016 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 017 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 018 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 019 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 020 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 021 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 022 * SOFTWARE. 023 */ 024 025// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY 026 027package org.photonvision.struct; 028 029import org.photonvision.common.dataflow.structures.Packet; 030import org.photonvision.common.dataflow.structures.PacketSerde; 031 032// Assume that the base class lives here and we can import it 033import org.photonvision.targeting.*; 034 035// WPILib imports (if any) 036import org.wpilib.util.struct.Struct; 037 038 039/** 040 * Auto-generated serialization/deserialization helper for MultiTargetPNPResult 041 */ 042public class MultiTargetPNPResultSerde implements PacketSerde<MultiTargetPNPResult> { 043 044 @Override 045 public final String getInterfaceUUID() { return "541096947e9f3ca2d3f425ff7b04aa7b"; } 046 @Override 047 public final String getSchema() { return "PnpResult:ae4d655c0a3104d88df4f5db144c1e86 estimatedPose;int16 fiducialIDsUsed[?];"; } 048 @Override 049 public final String getTypeName() { return "MultiTargetPNPResult"; } 050 051 @Override 052 public int getMaxByteSize() { 053 // TODO Auto-generated method stub 054 throw new UnsupportedOperationException("Unimplemented method 'getMaxByteSize'"); 055 } 056 057 @Override 058 public void pack(Packet packet, MultiTargetPNPResult value) { 059 // field estimatedPose is of non-intrinsic type PnpResult 060 PnpResult.photonStruct.pack(packet, value.estimatedPose); 061 062 // fiducialIDsUsed is a intrinsic VLA! 063 packet.encode(value.fiducialIDsUsed); 064 } 065 066 @Override 067 public MultiTargetPNPResult unpack(Packet packet) { 068 var ret = new MultiTargetPNPResult(); 069 070 // estimatedPose is of non-intrinsic type PnpResult 071 ret.estimatedPose = PnpResult.photonStruct.unpack(packet); 072 073 // fiducialIDsUsed is a custom VLA! 074 ret.fiducialIDsUsed = packet.decodeShortList(); 075 076 return ret; 077 } 078 079 @Override 080 public PacketSerde<?>[] getNestedPhotonMessages() { 081 return new PacketSerde<?>[] { 082 PnpResult.photonStruct 083 }; 084 } 085 086 @Override 087 public Struct<?>[] getNestedWpilibMessages() { 088 return new Struct<?>[] { 089 090 }; 091 } 092}