001// Copyright (c) FIRST and other WPILib contributors. 002// Open Source Software; you can modify and/or share it under the terms of 003// the WPILib BSD license file in the root directory of this project. 004// Code generated by protocol buffer compiler. Do not edit! 005package edu.wpi.first.math.proto; 006 007import java.io.IOException; 008import us.hebi.quickbuf.Descriptors; 009import us.hebi.quickbuf.FieldName; 010import us.hebi.quickbuf.InvalidProtocolBufferException; 011import us.hebi.quickbuf.JsonSink; 012import us.hebi.quickbuf.JsonSource; 013import us.hebi.quickbuf.MessageFactory; 014import us.hebi.quickbuf.ProtoMessage; 015import us.hebi.quickbuf.ProtoSink; 016import us.hebi.quickbuf.ProtoSource; 017import us.hebi.quickbuf.ProtoUtil; 018import us.hebi.quickbuf.RepeatedByte; 019import us.hebi.quickbuf.RepeatedMessage; 020 021public final class Kinematics { 022 private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(3021, 023 "ChBraW5lbWF0aWNzLnByb3RvEgl3cGkucHJvdG8aEGdlb21ldHJ5MmQucHJvdG8iTQoVUHJvdG9idWZD" + 024 "aGFzc2lzU3BlZWRzEg4KAnZ4GAEgASgBUgJ2eBIOCgJ2eRgCIAEoAVICdnkSFAoFb21lZ2EYAyABKAFS" + 025 "BW9tZWdhIkYKI1Byb3RvYnVmRGlmZmVyZW50aWFsRHJpdmVLaW5lbWF0aWNzEh8KC3RyYWNrX3dpZHRo" + 026 "GAEgASgBUgp0cmFja1dpZHRoIlAKJFByb3RvYnVmRGlmZmVyZW50aWFsRHJpdmVXaGVlbFNwZWVkcxIS" + 027 "CgRsZWZ0GAEgASgBUgRsZWZ0EhQKBXJpZ2h0GAIgASgBUgVyaWdodCJTCidQcm90b2J1ZkRpZmZlcmVu" + 028 "dGlhbERyaXZlV2hlZWxQb3NpdGlvbnMSEgoEbGVmdBgBIAEoAVIEbGVmdBIUCgVyaWdodBgCIAEoAVIF" + 029 "cmlnaHQipAIKHlByb3RvYnVmTWVjYW51bURyaXZlS2luZW1hdGljcxI/Cgpmcm9udF9sZWZ0GAEgASgL" + 030 "MiAud3BpLnByb3RvLlByb3RvYnVmVHJhbnNsYXRpb24yZFIJZnJvbnRMZWZ0EkEKC2Zyb250X3JpZ2h0" + 031 "GAIgASgLMiAud3BpLnByb3RvLlByb3RvYnVmVHJhbnNsYXRpb24yZFIKZnJvbnRSaWdodBI9CglyZWFy" + 032 "X2xlZnQYAyABKAsyIC53cGkucHJvdG8uUHJvdG9idWZUcmFuc2xhdGlvbjJkUghyZWFyTGVmdBI/Cgpy" + 033 "ZWFyX3JpZ2h0GAQgASgLMiAud3BpLnByb3RvLlByb3RvYnVmVHJhbnNsYXRpb24yZFIJcmVhclJpZ2h0" + 034 "IqABCiJQcm90b2J1Zk1lY2FudW1Ecml2ZVdoZWVsUG9zaXRpb25zEh0KCmZyb250X2xlZnQYASABKAFS" + 035 "CWZyb250TGVmdBIfCgtmcm9udF9yaWdodBgCIAEoAVIKZnJvbnRSaWdodBIbCglyZWFyX2xlZnQYAyAB" + 036 "KAFSCHJlYXJMZWZ0Eh0KCnJlYXJfcmlnaHQYBCABKAFSCXJlYXJSaWdodCKdAQofUHJvdG9idWZNZWNh" + 037 "bnVtRHJpdmVXaGVlbFNwZWVkcxIdCgpmcm9udF9sZWZ0GAEgASgBUglmcm9udExlZnQSHwoLZnJvbnRf" + 038 "cmlnaHQYAiABKAFSCmZyb250UmlnaHQSGwoJcmVhcl9sZWZ0GAMgASgBUghyZWFyTGVmdBIdCgpyZWFy" + 039 "X3JpZ2h0GAQgASgBUglyZWFyUmlnaHQiWwodUHJvdG9idWZTd2VydmVEcml2ZUtpbmVtYXRpY3MSOgoH" + 040 "bW9kdWxlcxgBIAMoCzIgLndwaS5wcm90by5Qcm90b2J1ZlRyYW5zbGF0aW9uMmRSB21vZHVsZXMibwoc" + 041 "UHJvdG9idWZTd2VydmVNb2R1bGVQb3NpdGlvbhIaCghkaXN0YW5jZRgBIAEoAVIIZGlzdGFuY2USMwoF" + 042 "YW5nbGUYAiABKAsyHS53cGkucHJvdG8uUHJvdG9idWZSb3RhdGlvbjJkUgVhbmdsZSJmChlQcm90b2J1", 043 "ZlN3ZXJ2ZU1vZHVsZVN0YXRlEhQKBXNwZWVkGAEgASgBUgVzcGVlZBIzCgVhbmdsZRgCIAEoCzIdLndw" + 044 "aS5wcm90by5Qcm90b2J1ZlJvdGF0aW9uMmRSBWFuZ2xlQhoKGGVkdS53cGkuZmlyc3QubWF0aC5wcm90" + 045 "b0qZDQoGEgQAAD0BCggKAQwSAwAAEgoICgECEgMCABIKCQoCAwASAwQAGgoICgEIEgMGADEKCQoCCAES" + 046 "AwYAMQoKCgIEABIECAAMAQoKCgMEAAESAwgIHQoLCgQEAAIAEgMJAhAKDAoFBAACAAUSAwkCCAoMCgUE" + 047 "AAIAARIDCQkLCgwKBQQAAgADEgMJDg8KCwoEBAACARIDCgIQCgwKBQQAAgEFEgMKAggKDAoFBAACAQES" + 048 "AwoJCwoMCgUEAAIBAxIDCg4PCgsKBAQAAgISAwsCEwoMCgUEAAICBRIDCwIICgwKBQQAAgIBEgMLCQ4K" + 049 "DAoFBAACAgMSAwsREgoKCgIEARIEDgAQAQoKCgMEAQESAw4IKwoLCgQEAQIAEgMPAhkKDAoFBAECAAUS" + 050 "Aw8CCAoMCgUEAQIAARIDDwkUCgwKBQQBAgADEgMPFxgKCgoCBAISBBIAFQEKCgoDBAIBEgMSCCwKCwoE" + 051 "BAICABIDEwISCgwKBQQCAgAFEgMTAggKDAoFBAICAAESAxMJDQoMCgUEAgIAAxIDExARCgsKBAQCAgES" + 052 "AxQCEwoMCgUEAgIBBRIDFAIICgwKBQQCAgEBEgMUCQ4KDAoFBAICAQMSAxQREgoKCgIEAxIEFwAaAQoK" + 053 "CgMEAwESAxcILwoLCgQEAwIAEgMYAhIKDAoFBAMCAAUSAxgCCAoMCgUEAwIAARIDGAkNCgwKBQQDAgAD" + 054 "EgMYEBEKCwoEBAMCARIDGQITCgwKBQQDAgEFEgMZAggKDAoFBAMCAQESAxkJDgoMCgUEAwIBAxIDGRES" + 055 "CgoKAgQEEgQcACEBCgoKAwQEARIDHAgmCgsKBAQEAgASAx0CJwoMCgUEBAIABhIDHQIXCgwKBQQEAgAB" + 056 "EgMdGCIKDAoFBAQCAAMSAx0lJgoLCgQEBAIBEgMeAigKDAoFBAQCAQYSAx4CFwoMCgUEBAIBARIDHhgj" + 057 "CgwKBQQEAgEDEgMeJicKCwoEBAQCAhIDHwImCgwKBQQEAgIGEgMfAhcKDAoFBAQCAgESAx8YIQoMCgUE" + 058 "BAICAxIDHyQlCgsKBAQEAgMSAyACJwoMCgUEBAIDBhIDIAIXCgwKBQQEAgMBEgMgGCIKDAoFBAQCAwMS" + 059 "AyAlJgoKCgIEBRIEIwAoAQoKCgMEBQESAyMIKgoLCgQEBQIAEgMkAhgKDAoFBAUCAAUSAyQCCAoMCgUE" + 060 "BQIAARIDJAkTCgwKBQQFAgADEgMkFhcKCwoEBAUCARIDJQIZCgwKBQQFAgEFEgMlAggKDAoFBAUCAQES" + 061 "AyUJFAoMCgUEBQIBAxIDJRcYCgsKBAQFAgISAyYCFwoMCgUEBQICBRIDJgIICgwKBQQFAgIBEgMmCRIK" + 062 "DAoFBAUCAgMSAyYVFgoLCgQEBQIDEgMnAhgKDAoFBAUCAwUSAycCCAoMCgUEBQIDARIDJwkTCgwKBQQF", 063 "AgMDEgMnFhcKCgoCBAYSBCoALwEKCgoDBAYBEgMqCCcKCwoEBAYCABIDKwIYCgwKBQQGAgAFEgMrAggK" + 064 "DAoFBAYCAAESAysJEwoMCgUEBgIAAxIDKxYXCgsKBAQGAgESAywCGQoMCgUEBgIBBRIDLAIICgwKBQQG" + 065 "AgEBEgMsCRQKDAoFBAYCAQMSAywXGAoLCgQEBgICEgMtAhcKDAoFBAYCAgUSAy0CCAoMCgUEBgICARID" + 066 "LQkSCgwKBQQGAgIDEgMtFRYKCwoEBAYCAxIDLgIYCgwKBQQGAgMFEgMuAggKDAoFBAYCAwESAy4JEwoM" + 067 "CgUEBgIDAxIDLhYXCgoKAgQHEgQxADMBCgoKAwQHARIDMQglCgsKBAQHAgASAzICLQoMCgUEBwIABBID" + 068 "MgIKCgwKBQQHAgAGEgMyCyAKDAoFBAcCAAESAzIhKAoMCgUEBwIAAxIDMissCgoKAgQIEgQ1ADgBCgoK" + 069 "AwQIARIDNQgkCgsKBAQIAgASAzYCFgoMCgUECAIABRIDNgIICgwKBQQIAgABEgM2CREKDAoFBAgCAAMS" + 070 "AzYUFQoLCgQECAIBEgM3Ah8KDAoFBAgCAQYSAzcCFAoMCgUECAIBARIDNxUaCgwKBQQIAgEDEgM3HR4K" + 071 "CgoCBAkSBDoAPQEKCgoDBAkBEgM6CCEKCwoEBAkCABIDOwITCgwKBQQJAgAFEgM7AggKDAoFBAkCAAES" + 072 "AzsJDgoMCgUECQIAAxIDOxESCgsKBAQJAgESAzwCHwoMCgUECQIBBhIDPAIUCgwKBQQJAgEBEgM8FRoK" + 073 "DAoFBAkCAQMSAzwdHmIGcHJvdG8z"); 074 075 static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("kinematics.proto", "wpi.proto", descriptorData, Geometry2D.getDescriptor()); 076 077 static final Descriptors.Descriptor wpi_proto_ProtobufChassisSpeeds_descriptor = descriptor.internalContainedType(49, 77, "ProtobufChassisSpeeds", "wpi.proto.ProtobufChassisSpeeds"); 078 079 static final Descriptors.Descriptor wpi_proto_ProtobufDifferentialDriveKinematics_descriptor = descriptor.internalContainedType(128, 70, "ProtobufDifferentialDriveKinematics", "wpi.proto.ProtobufDifferentialDriveKinematics"); 080 081 static final Descriptors.Descriptor wpi_proto_ProtobufDifferentialDriveWheelSpeeds_descriptor = descriptor.internalContainedType(200, 80, "ProtobufDifferentialDriveWheelSpeeds", "wpi.proto.ProtobufDifferentialDriveWheelSpeeds"); 082 083 static final Descriptors.Descriptor wpi_proto_ProtobufDifferentialDriveWheelPositions_descriptor = descriptor.internalContainedType(282, 83, "ProtobufDifferentialDriveWheelPositions", "wpi.proto.ProtobufDifferentialDriveWheelPositions"); 084 085 static final Descriptors.Descriptor wpi_proto_ProtobufMecanumDriveKinematics_descriptor = descriptor.internalContainedType(368, 292, "ProtobufMecanumDriveKinematics", "wpi.proto.ProtobufMecanumDriveKinematics"); 086 087 static final Descriptors.Descriptor wpi_proto_ProtobufMecanumDriveWheelPositions_descriptor = descriptor.internalContainedType(663, 160, "ProtobufMecanumDriveWheelPositions", "wpi.proto.ProtobufMecanumDriveWheelPositions"); 088 089 static final Descriptors.Descriptor wpi_proto_ProtobufMecanumDriveWheelSpeeds_descriptor = descriptor.internalContainedType(826, 157, "ProtobufMecanumDriveWheelSpeeds", "wpi.proto.ProtobufMecanumDriveWheelSpeeds"); 090 091 static final Descriptors.Descriptor wpi_proto_ProtobufSwerveDriveKinematics_descriptor = descriptor.internalContainedType(985, 91, "ProtobufSwerveDriveKinematics", "wpi.proto.ProtobufSwerveDriveKinematics"); 092 093 static final Descriptors.Descriptor wpi_proto_ProtobufSwerveModulePosition_descriptor = descriptor.internalContainedType(1078, 111, "ProtobufSwerveModulePosition", "wpi.proto.ProtobufSwerveModulePosition"); 094 095 static final Descriptors.Descriptor wpi_proto_ProtobufSwerveModuleState_descriptor = descriptor.internalContainedType(1191, 102, "ProtobufSwerveModuleState", "wpi.proto.ProtobufSwerveModuleState"); 096 097 /** 098 * @return this proto file's descriptor. 099 */ 100 public static Descriptors.FileDescriptor getDescriptor() { 101 return descriptor; 102 } 103 104 /** 105 * Protobuf type {@code ProtobufChassisSpeeds} 106 */ 107 public static final class ProtobufChassisSpeeds extends ProtoMessage<ProtobufChassisSpeeds> implements Cloneable { 108 private static final long serialVersionUID = 0L; 109 110 /** 111 * <code>optional double vx = 1;</code> 112 */ 113 private double vx; 114 115 /** 116 * <code>optional double vy = 2;</code> 117 */ 118 private double vy; 119 120 /** 121 * <code>optional double omega = 3;</code> 122 */ 123 private double omega; 124 125 private ProtobufChassisSpeeds() { 126 } 127 128 /** 129 * @return a new empty instance of {@code ProtobufChassisSpeeds} 130 */ 131 public static ProtobufChassisSpeeds newInstance() { 132 return new ProtobufChassisSpeeds(); 133 } 134 135 /** 136 * <code>optional double vx = 1;</code> 137 * @return whether the vx field is set 138 */ 139 public boolean hasVx() { 140 return (bitField0_ & 0x00000001) != 0; 141 } 142 143 /** 144 * <code>optional double vx = 1;</code> 145 * @return this 146 */ 147 public ProtobufChassisSpeeds clearVx() { 148 bitField0_ &= ~0x00000001; 149 vx = 0D; 150 return this; 151 } 152 153 /** 154 * <code>optional double vx = 1;</code> 155 * @return the vx 156 */ 157 public double getVx() { 158 return vx; 159 } 160 161 /** 162 * <code>optional double vx = 1;</code> 163 * @param value the vx to set 164 * @return this 165 */ 166 public ProtobufChassisSpeeds setVx(final double value) { 167 bitField0_ |= 0x00000001; 168 vx = value; 169 return this; 170 } 171 172 /** 173 * <code>optional double vy = 2;</code> 174 * @return whether the vy field is set 175 */ 176 public boolean hasVy() { 177 return (bitField0_ & 0x00000002) != 0; 178 } 179 180 /** 181 * <code>optional double vy = 2;</code> 182 * @return this 183 */ 184 public ProtobufChassisSpeeds clearVy() { 185 bitField0_ &= ~0x00000002; 186 vy = 0D; 187 return this; 188 } 189 190 /** 191 * <code>optional double vy = 2;</code> 192 * @return the vy 193 */ 194 public double getVy() { 195 return vy; 196 } 197 198 /** 199 * <code>optional double vy = 2;</code> 200 * @param value the vy to set 201 * @return this 202 */ 203 public ProtobufChassisSpeeds setVy(final double value) { 204 bitField0_ |= 0x00000002; 205 vy = value; 206 return this; 207 } 208 209 /** 210 * <code>optional double omega = 3;</code> 211 * @return whether the omega field is set 212 */ 213 public boolean hasOmega() { 214 return (bitField0_ & 0x00000004) != 0; 215 } 216 217 /** 218 * <code>optional double omega = 3;</code> 219 * @return this 220 */ 221 public ProtobufChassisSpeeds clearOmega() { 222 bitField0_ &= ~0x00000004; 223 omega = 0D; 224 return this; 225 } 226 227 /** 228 * <code>optional double omega = 3;</code> 229 * @return the omega 230 */ 231 public double getOmega() { 232 return omega; 233 } 234 235 /** 236 * <code>optional double omega = 3;</code> 237 * @param value the omega to set 238 * @return this 239 */ 240 public ProtobufChassisSpeeds setOmega(final double value) { 241 bitField0_ |= 0x00000004; 242 omega = value; 243 return this; 244 } 245 246 @Override 247 public ProtobufChassisSpeeds copyFrom(final ProtobufChassisSpeeds other) { 248 cachedSize = other.cachedSize; 249 if ((bitField0_ | other.bitField0_) != 0) { 250 bitField0_ = other.bitField0_; 251 vx = other.vx; 252 vy = other.vy; 253 omega = other.omega; 254 } 255 return this; 256 } 257 258 @Override 259 public ProtobufChassisSpeeds mergeFrom(final ProtobufChassisSpeeds other) { 260 if (other.isEmpty()) { 261 return this; 262 } 263 cachedSize = -1; 264 if (other.hasVx()) { 265 setVx(other.vx); 266 } 267 if (other.hasVy()) { 268 setVy(other.vy); 269 } 270 if (other.hasOmega()) { 271 setOmega(other.omega); 272 } 273 return this; 274 } 275 276 @Override 277 public ProtobufChassisSpeeds clear() { 278 if (isEmpty()) { 279 return this; 280 } 281 cachedSize = -1; 282 bitField0_ = 0; 283 vx = 0D; 284 vy = 0D; 285 omega = 0D; 286 return this; 287 } 288 289 @Override 290 public ProtobufChassisSpeeds clearQuick() { 291 if (isEmpty()) { 292 return this; 293 } 294 cachedSize = -1; 295 bitField0_ = 0; 296 return this; 297 } 298 299 @Override 300 public boolean equals(Object o) { 301 if (o == this) { 302 return true; 303 } 304 if (!(o instanceof ProtobufChassisSpeeds)) { 305 return false; 306 } 307 ProtobufChassisSpeeds other = (ProtobufChassisSpeeds) o; 308 return bitField0_ == other.bitField0_ 309 && (!hasVx() || ProtoUtil.isEqual(vx, other.vx)) 310 && (!hasVy() || ProtoUtil.isEqual(vy, other.vy)) 311 && (!hasOmega() || ProtoUtil.isEqual(omega, other.omega)); 312 } 313 314 @Override 315 public void writeTo(final ProtoSink output) throws IOException { 316 if ((bitField0_ & 0x00000001) != 0) { 317 output.writeRawByte((byte) 9); 318 output.writeDoubleNoTag(vx); 319 } 320 if ((bitField0_ & 0x00000002) != 0) { 321 output.writeRawByte((byte) 17); 322 output.writeDoubleNoTag(vy); 323 } 324 if ((bitField0_ & 0x00000004) != 0) { 325 output.writeRawByte((byte) 25); 326 output.writeDoubleNoTag(omega); 327 } 328 } 329 330 @Override 331 protected int computeSerializedSize() { 332 int size = 0; 333 if ((bitField0_ & 0x00000001) != 0) { 334 size += 9; 335 } 336 if ((bitField0_ & 0x00000002) != 0) { 337 size += 9; 338 } 339 if ((bitField0_ & 0x00000004) != 0) { 340 size += 9; 341 } 342 return size; 343 } 344 345 @Override 346 @SuppressWarnings("fallthrough") 347 public ProtobufChassisSpeeds mergeFrom(final ProtoSource input) throws IOException { 348 // Enabled Fall-Through Optimization (QuickBuffers) 349 int tag = input.readTag(); 350 while (true) { 351 switch (tag) { 352 case 9: { 353 // vx 354 vx = input.readDouble(); 355 bitField0_ |= 0x00000001; 356 tag = input.readTag(); 357 if (tag != 17) { 358 break; 359 } 360 } 361 case 17: { 362 // vy 363 vy = input.readDouble(); 364 bitField0_ |= 0x00000002; 365 tag = input.readTag(); 366 if (tag != 25) { 367 break; 368 } 369 } 370 case 25: { 371 // omega 372 omega = input.readDouble(); 373 bitField0_ |= 0x00000004; 374 tag = input.readTag(); 375 if (tag != 0) { 376 break; 377 } 378 } 379 case 0: { 380 return this; 381 } 382 default: { 383 if (!input.skipField(tag)) { 384 return this; 385 } 386 tag = input.readTag(); 387 break; 388 } 389 } 390 } 391 } 392 393 @Override 394 public void writeTo(final JsonSink output) throws IOException { 395 output.beginObject(); 396 if ((bitField0_ & 0x00000001) != 0) { 397 output.writeDouble(FieldNames.vx, vx); 398 } 399 if ((bitField0_ & 0x00000002) != 0) { 400 output.writeDouble(FieldNames.vy, vy); 401 } 402 if ((bitField0_ & 0x00000004) != 0) { 403 output.writeDouble(FieldNames.omega, omega); 404 } 405 output.endObject(); 406 } 407 408 @Override 409 public ProtobufChassisSpeeds mergeFrom(final JsonSource input) throws IOException { 410 if (!input.beginObject()) { 411 return this; 412 } 413 while (!input.isAtEnd()) { 414 switch (input.readFieldHash()) { 415 case 3778: { 416 if (input.isAtField(FieldNames.vx)) { 417 if (!input.trySkipNullValue()) { 418 vx = input.readDouble(); 419 bitField0_ |= 0x00000001; 420 } 421 } else { 422 input.skipUnknownField(); 423 } 424 break; 425 } 426 case 3779: { 427 if (input.isAtField(FieldNames.vy)) { 428 if (!input.trySkipNullValue()) { 429 vy = input.readDouble(); 430 bitField0_ |= 0x00000002; 431 } 432 } else { 433 input.skipUnknownField(); 434 } 435 break; 436 } 437 case 105858401: { 438 if (input.isAtField(FieldNames.omega)) { 439 if (!input.trySkipNullValue()) { 440 omega = input.readDouble(); 441 bitField0_ |= 0x00000004; 442 } 443 } else { 444 input.skipUnknownField(); 445 } 446 break; 447 } 448 default: { 449 input.skipUnknownField(); 450 break; 451 } 452 } 453 } 454 input.endObject(); 455 return this; 456 } 457 458 @Override 459 public ProtobufChassisSpeeds clone() { 460 return new ProtobufChassisSpeeds().copyFrom(this); 461 } 462 463 @Override 464 public boolean isEmpty() { 465 return ((bitField0_) == 0); 466 } 467 468 public static ProtobufChassisSpeeds parseFrom(final byte[] data) throws 469 InvalidProtocolBufferException { 470 return ProtoMessage.mergeFrom(new ProtobufChassisSpeeds(), data).checkInitialized(); 471 } 472 473 public static ProtobufChassisSpeeds parseFrom(final ProtoSource input) throws IOException { 474 return ProtoMessage.mergeFrom(new ProtobufChassisSpeeds(), input).checkInitialized(); 475 } 476 477 public static ProtobufChassisSpeeds parseFrom(final JsonSource input) throws IOException { 478 return ProtoMessage.mergeFrom(new ProtobufChassisSpeeds(), input).checkInitialized(); 479 } 480 481 /** 482 * @return factory for creating ProtobufChassisSpeeds messages 483 */ 484 public static MessageFactory<ProtobufChassisSpeeds> getFactory() { 485 return ProtobufChassisSpeedsFactory.INSTANCE; 486 } 487 488 /** 489 * @return this type's descriptor. 490 */ 491 public static Descriptors.Descriptor getDescriptor() { 492 return Kinematics.wpi_proto_ProtobufChassisSpeeds_descriptor; 493 } 494 495 private enum ProtobufChassisSpeedsFactory implements MessageFactory<ProtobufChassisSpeeds> { 496 INSTANCE; 497 498 @Override 499 public ProtobufChassisSpeeds create() { 500 return ProtobufChassisSpeeds.newInstance(); 501 } 502 } 503 504 /** 505 * Contains name constants used for serializing JSON 506 */ 507 static class FieldNames { 508 static final FieldName vx = FieldName.forField("vx"); 509 510 static final FieldName vy = FieldName.forField("vy"); 511 512 static final FieldName omega = FieldName.forField("omega"); 513 } 514 } 515 516 /** 517 * Protobuf type {@code ProtobufDifferentialDriveKinematics} 518 */ 519 public static final class ProtobufDifferentialDriveKinematics extends ProtoMessage<ProtobufDifferentialDriveKinematics> implements Cloneable { 520 private static final long serialVersionUID = 0L; 521 522 /** 523 * <code>optional double track_width = 1;</code> 524 */ 525 private double trackWidth; 526 527 private ProtobufDifferentialDriveKinematics() { 528 } 529 530 /** 531 * @return a new empty instance of {@code ProtobufDifferentialDriveKinematics} 532 */ 533 public static ProtobufDifferentialDriveKinematics newInstance() { 534 return new ProtobufDifferentialDriveKinematics(); 535 } 536 537 /** 538 * <code>optional double track_width = 1;</code> 539 * @return whether the trackWidth field is set 540 */ 541 public boolean hasTrackWidth() { 542 return (bitField0_ & 0x00000001) != 0; 543 } 544 545 /** 546 * <code>optional double track_width = 1;</code> 547 * @return this 548 */ 549 public ProtobufDifferentialDriveKinematics clearTrackWidth() { 550 bitField0_ &= ~0x00000001; 551 trackWidth = 0D; 552 return this; 553 } 554 555 /** 556 * <code>optional double track_width = 1;</code> 557 * @return the trackWidth 558 */ 559 public double getTrackWidth() { 560 return trackWidth; 561 } 562 563 /** 564 * <code>optional double track_width = 1;</code> 565 * @param value the trackWidth to set 566 * @return this 567 */ 568 public ProtobufDifferentialDriveKinematics setTrackWidth(final double value) { 569 bitField0_ |= 0x00000001; 570 trackWidth = value; 571 return this; 572 } 573 574 @Override 575 public ProtobufDifferentialDriveKinematics copyFrom( 576 final ProtobufDifferentialDriveKinematics other) { 577 cachedSize = other.cachedSize; 578 if ((bitField0_ | other.bitField0_) != 0) { 579 bitField0_ = other.bitField0_; 580 trackWidth = other.trackWidth; 581 } 582 return this; 583 } 584 585 @Override 586 public ProtobufDifferentialDriveKinematics mergeFrom( 587 final ProtobufDifferentialDriveKinematics other) { 588 if (other.isEmpty()) { 589 return this; 590 } 591 cachedSize = -1; 592 if (other.hasTrackWidth()) { 593 setTrackWidth(other.trackWidth); 594 } 595 return this; 596 } 597 598 @Override 599 public ProtobufDifferentialDriveKinematics clear() { 600 if (isEmpty()) { 601 return this; 602 } 603 cachedSize = -1; 604 bitField0_ = 0; 605 trackWidth = 0D; 606 return this; 607 } 608 609 @Override 610 public ProtobufDifferentialDriveKinematics clearQuick() { 611 if (isEmpty()) { 612 return this; 613 } 614 cachedSize = -1; 615 bitField0_ = 0; 616 return this; 617 } 618 619 @Override 620 public boolean equals(Object o) { 621 if (o == this) { 622 return true; 623 } 624 if (!(o instanceof ProtobufDifferentialDriveKinematics)) { 625 return false; 626 } 627 ProtobufDifferentialDriveKinematics other = (ProtobufDifferentialDriveKinematics) o; 628 return bitField0_ == other.bitField0_ 629 && (!hasTrackWidth() || ProtoUtil.isEqual(trackWidth, other.trackWidth)); 630 } 631 632 @Override 633 public void writeTo(final ProtoSink output) throws IOException { 634 if ((bitField0_ & 0x00000001) != 0) { 635 output.writeRawByte((byte) 9); 636 output.writeDoubleNoTag(trackWidth); 637 } 638 } 639 640 @Override 641 protected int computeSerializedSize() { 642 int size = 0; 643 if ((bitField0_ & 0x00000001) != 0) { 644 size += 9; 645 } 646 return size; 647 } 648 649 @Override 650 @SuppressWarnings("fallthrough") 651 public ProtobufDifferentialDriveKinematics mergeFrom(final ProtoSource input) throws 652 IOException { 653 // Enabled Fall-Through Optimization (QuickBuffers) 654 int tag = input.readTag(); 655 while (true) { 656 switch (tag) { 657 case 9: { 658 // trackWidth 659 trackWidth = input.readDouble(); 660 bitField0_ |= 0x00000001; 661 tag = input.readTag(); 662 if (tag != 0) { 663 break; 664 } 665 } 666 case 0: { 667 return this; 668 } 669 default: { 670 if (!input.skipField(tag)) { 671 return this; 672 } 673 tag = input.readTag(); 674 break; 675 } 676 } 677 } 678 } 679 680 @Override 681 public void writeTo(final JsonSink output) throws IOException { 682 output.beginObject(); 683 if ((bitField0_ & 0x00000001) != 0) { 684 output.writeDouble(FieldNames.trackWidth, trackWidth); 685 } 686 output.endObject(); 687 } 688 689 @Override 690 public ProtobufDifferentialDriveKinematics mergeFrom(final JsonSource input) throws 691 IOException { 692 if (!input.beginObject()) { 693 return this; 694 } 695 while (!input.isAtEnd()) { 696 switch (input.readFieldHash()) { 697 case 1152213819: 698 case 1600986578: { 699 if (input.isAtField(FieldNames.trackWidth)) { 700 if (!input.trySkipNullValue()) { 701 trackWidth = input.readDouble(); 702 bitField0_ |= 0x00000001; 703 } 704 } else { 705 input.skipUnknownField(); 706 } 707 break; 708 } 709 default: { 710 input.skipUnknownField(); 711 break; 712 } 713 } 714 } 715 input.endObject(); 716 return this; 717 } 718 719 @Override 720 public ProtobufDifferentialDriveKinematics clone() { 721 return new ProtobufDifferentialDriveKinematics().copyFrom(this); 722 } 723 724 @Override 725 public boolean isEmpty() { 726 return ((bitField0_) == 0); 727 } 728 729 public static ProtobufDifferentialDriveKinematics parseFrom(final byte[] data) throws 730 InvalidProtocolBufferException { 731 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveKinematics(), data).checkInitialized(); 732 } 733 734 public static ProtobufDifferentialDriveKinematics parseFrom(final ProtoSource input) throws 735 IOException { 736 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveKinematics(), input).checkInitialized(); 737 } 738 739 public static ProtobufDifferentialDriveKinematics parseFrom(final JsonSource input) throws 740 IOException { 741 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveKinematics(), input).checkInitialized(); 742 } 743 744 /** 745 * @return factory for creating ProtobufDifferentialDriveKinematics messages 746 */ 747 public static MessageFactory<ProtobufDifferentialDriveKinematics> getFactory() { 748 return ProtobufDifferentialDriveKinematicsFactory.INSTANCE; 749 } 750 751 /** 752 * @return this type's descriptor. 753 */ 754 public static Descriptors.Descriptor getDescriptor() { 755 return Kinematics.wpi_proto_ProtobufDifferentialDriveKinematics_descriptor; 756 } 757 758 private enum ProtobufDifferentialDriveKinematicsFactory implements MessageFactory<ProtobufDifferentialDriveKinematics> { 759 INSTANCE; 760 761 @Override 762 public ProtobufDifferentialDriveKinematics create() { 763 return ProtobufDifferentialDriveKinematics.newInstance(); 764 } 765 } 766 767 /** 768 * Contains name constants used for serializing JSON 769 */ 770 static class FieldNames { 771 static final FieldName trackWidth = FieldName.forField("trackWidth", "track_width"); 772 } 773 } 774 775 /** 776 * Protobuf type {@code ProtobufDifferentialDriveWheelSpeeds} 777 */ 778 public static final class ProtobufDifferentialDriveWheelSpeeds extends ProtoMessage<ProtobufDifferentialDriveWheelSpeeds> implements Cloneable { 779 private static final long serialVersionUID = 0L; 780 781 /** 782 * <code>optional double left = 1;</code> 783 */ 784 private double left; 785 786 /** 787 * <code>optional double right = 2;</code> 788 */ 789 private double right; 790 791 private ProtobufDifferentialDriveWheelSpeeds() { 792 } 793 794 /** 795 * @return a new empty instance of {@code ProtobufDifferentialDriveWheelSpeeds} 796 */ 797 public static ProtobufDifferentialDriveWheelSpeeds newInstance() { 798 return new ProtobufDifferentialDriveWheelSpeeds(); 799 } 800 801 /** 802 * <code>optional double left = 1;</code> 803 * @return whether the left field is set 804 */ 805 public boolean hasLeft() { 806 return (bitField0_ & 0x00000001) != 0; 807 } 808 809 /** 810 * <code>optional double left = 1;</code> 811 * @return this 812 */ 813 public ProtobufDifferentialDriveWheelSpeeds clearLeft() { 814 bitField0_ &= ~0x00000001; 815 left = 0D; 816 return this; 817 } 818 819 /** 820 * <code>optional double left = 1;</code> 821 * @return the left 822 */ 823 public double getLeft() { 824 return left; 825 } 826 827 /** 828 * <code>optional double left = 1;</code> 829 * @param value the left to set 830 * @return this 831 */ 832 public ProtobufDifferentialDriveWheelSpeeds setLeft(final double value) { 833 bitField0_ |= 0x00000001; 834 left = value; 835 return this; 836 } 837 838 /** 839 * <code>optional double right = 2;</code> 840 * @return whether the right field is set 841 */ 842 public boolean hasRight() { 843 return (bitField0_ & 0x00000002) != 0; 844 } 845 846 /** 847 * <code>optional double right = 2;</code> 848 * @return this 849 */ 850 public ProtobufDifferentialDriveWheelSpeeds clearRight() { 851 bitField0_ &= ~0x00000002; 852 right = 0D; 853 return this; 854 } 855 856 /** 857 * <code>optional double right = 2;</code> 858 * @return the right 859 */ 860 public double getRight() { 861 return right; 862 } 863 864 /** 865 * <code>optional double right = 2;</code> 866 * @param value the right to set 867 * @return this 868 */ 869 public ProtobufDifferentialDriveWheelSpeeds setRight(final double value) { 870 bitField0_ |= 0x00000002; 871 right = value; 872 return this; 873 } 874 875 @Override 876 public ProtobufDifferentialDriveWheelSpeeds copyFrom( 877 final ProtobufDifferentialDriveWheelSpeeds other) { 878 cachedSize = other.cachedSize; 879 if ((bitField0_ | other.bitField0_) != 0) { 880 bitField0_ = other.bitField0_; 881 left = other.left; 882 right = other.right; 883 } 884 return this; 885 } 886 887 @Override 888 public ProtobufDifferentialDriveWheelSpeeds mergeFrom( 889 final ProtobufDifferentialDriveWheelSpeeds other) { 890 if (other.isEmpty()) { 891 return this; 892 } 893 cachedSize = -1; 894 if (other.hasLeft()) { 895 setLeft(other.left); 896 } 897 if (other.hasRight()) { 898 setRight(other.right); 899 } 900 return this; 901 } 902 903 @Override 904 public ProtobufDifferentialDriveWheelSpeeds clear() { 905 if (isEmpty()) { 906 return this; 907 } 908 cachedSize = -1; 909 bitField0_ = 0; 910 left = 0D; 911 right = 0D; 912 return this; 913 } 914 915 @Override 916 public ProtobufDifferentialDriveWheelSpeeds clearQuick() { 917 if (isEmpty()) { 918 return this; 919 } 920 cachedSize = -1; 921 bitField0_ = 0; 922 return this; 923 } 924 925 @Override 926 public boolean equals(Object o) { 927 if (o == this) { 928 return true; 929 } 930 if (!(o instanceof ProtobufDifferentialDriveWheelSpeeds)) { 931 return false; 932 } 933 ProtobufDifferentialDriveWheelSpeeds other = (ProtobufDifferentialDriveWheelSpeeds) o; 934 return bitField0_ == other.bitField0_ 935 && (!hasLeft() || ProtoUtil.isEqual(left, other.left)) 936 && (!hasRight() || ProtoUtil.isEqual(right, other.right)); 937 } 938 939 @Override 940 public void writeTo(final ProtoSink output) throws IOException { 941 if ((bitField0_ & 0x00000001) != 0) { 942 output.writeRawByte((byte) 9); 943 output.writeDoubleNoTag(left); 944 } 945 if ((bitField0_ & 0x00000002) != 0) { 946 output.writeRawByte((byte) 17); 947 output.writeDoubleNoTag(right); 948 } 949 } 950 951 @Override 952 protected int computeSerializedSize() { 953 int size = 0; 954 if ((bitField0_ & 0x00000001) != 0) { 955 size += 9; 956 } 957 if ((bitField0_ & 0x00000002) != 0) { 958 size += 9; 959 } 960 return size; 961 } 962 963 @Override 964 @SuppressWarnings("fallthrough") 965 public ProtobufDifferentialDriveWheelSpeeds mergeFrom(final ProtoSource input) throws 966 IOException { 967 // Enabled Fall-Through Optimization (QuickBuffers) 968 int tag = input.readTag(); 969 while (true) { 970 switch (tag) { 971 case 9: { 972 // left 973 left = input.readDouble(); 974 bitField0_ |= 0x00000001; 975 tag = input.readTag(); 976 if (tag != 17) { 977 break; 978 } 979 } 980 case 17: { 981 // right 982 right = input.readDouble(); 983 bitField0_ |= 0x00000002; 984 tag = input.readTag(); 985 if (tag != 0) { 986 break; 987 } 988 } 989 case 0: { 990 return this; 991 } 992 default: { 993 if (!input.skipField(tag)) { 994 return this; 995 } 996 tag = input.readTag(); 997 break; 998 } 999 } 1000 } 1001 } 1002 1003 @Override 1004 public void writeTo(final JsonSink output) throws IOException { 1005 output.beginObject(); 1006 if ((bitField0_ & 0x00000001) != 0) { 1007 output.writeDouble(FieldNames.left, left); 1008 } 1009 if ((bitField0_ & 0x00000002) != 0) { 1010 output.writeDouble(FieldNames.right, right); 1011 } 1012 output.endObject(); 1013 } 1014 1015 @Override 1016 public ProtobufDifferentialDriveWheelSpeeds mergeFrom(final JsonSource input) throws 1017 IOException { 1018 if (!input.beginObject()) { 1019 return this; 1020 } 1021 while (!input.isAtEnd()) { 1022 switch (input.readFieldHash()) { 1023 case 3317767: { 1024 if (input.isAtField(FieldNames.left)) { 1025 if (!input.trySkipNullValue()) { 1026 left = input.readDouble(); 1027 bitField0_ |= 0x00000001; 1028 } 1029 } else { 1030 input.skipUnknownField(); 1031 } 1032 break; 1033 } 1034 case 108511772: { 1035 if (input.isAtField(FieldNames.right)) { 1036 if (!input.trySkipNullValue()) { 1037 right = input.readDouble(); 1038 bitField0_ |= 0x00000002; 1039 } 1040 } else { 1041 input.skipUnknownField(); 1042 } 1043 break; 1044 } 1045 default: { 1046 input.skipUnknownField(); 1047 break; 1048 } 1049 } 1050 } 1051 input.endObject(); 1052 return this; 1053 } 1054 1055 @Override 1056 public ProtobufDifferentialDriveWheelSpeeds clone() { 1057 return new ProtobufDifferentialDriveWheelSpeeds().copyFrom(this); 1058 } 1059 1060 @Override 1061 public boolean isEmpty() { 1062 return ((bitField0_) == 0); 1063 } 1064 1065 public static ProtobufDifferentialDriveWheelSpeeds parseFrom(final byte[] data) throws 1066 InvalidProtocolBufferException { 1067 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelSpeeds(), data).checkInitialized(); 1068 } 1069 1070 public static ProtobufDifferentialDriveWheelSpeeds parseFrom(final ProtoSource input) throws 1071 IOException { 1072 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelSpeeds(), input).checkInitialized(); 1073 } 1074 1075 public static ProtobufDifferentialDriveWheelSpeeds parseFrom(final JsonSource input) throws 1076 IOException { 1077 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelSpeeds(), input).checkInitialized(); 1078 } 1079 1080 /** 1081 * @return factory for creating ProtobufDifferentialDriveWheelSpeeds messages 1082 */ 1083 public static MessageFactory<ProtobufDifferentialDriveWheelSpeeds> getFactory() { 1084 return ProtobufDifferentialDriveWheelSpeedsFactory.INSTANCE; 1085 } 1086 1087 /** 1088 * @return this type's descriptor. 1089 */ 1090 public static Descriptors.Descriptor getDescriptor() { 1091 return Kinematics.wpi_proto_ProtobufDifferentialDriveWheelSpeeds_descriptor; 1092 } 1093 1094 private enum ProtobufDifferentialDriveWheelSpeedsFactory implements MessageFactory<ProtobufDifferentialDriveWheelSpeeds> { 1095 INSTANCE; 1096 1097 @Override 1098 public ProtobufDifferentialDriveWheelSpeeds create() { 1099 return ProtobufDifferentialDriveWheelSpeeds.newInstance(); 1100 } 1101 } 1102 1103 /** 1104 * Contains name constants used for serializing JSON 1105 */ 1106 static class FieldNames { 1107 static final FieldName left = FieldName.forField("left"); 1108 1109 static final FieldName right = FieldName.forField("right"); 1110 } 1111 } 1112 1113 /** 1114 * Protobuf type {@code ProtobufDifferentialDriveWheelPositions} 1115 */ 1116 public static final class ProtobufDifferentialDriveWheelPositions extends ProtoMessage<ProtobufDifferentialDriveWheelPositions> implements Cloneable { 1117 private static final long serialVersionUID = 0L; 1118 1119 /** 1120 * <code>optional double left = 1;</code> 1121 */ 1122 private double left; 1123 1124 /** 1125 * <code>optional double right = 2;</code> 1126 */ 1127 private double right; 1128 1129 private ProtobufDifferentialDriveWheelPositions() { 1130 } 1131 1132 /** 1133 * @return a new empty instance of {@code ProtobufDifferentialDriveWheelPositions} 1134 */ 1135 public static ProtobufDifferentialDriveWheelPositions newInstance() { 1136 return new ProtobufDifferentialDriveWheelPositions(); 1137 } 1138 1139 /** 1140 * <code>optional double left = 1;</code> 1141 * @return whether the left field is set 1142 */ 1143 public boolean hasLeft() { 1144 return (bitField0_ & 0x00000001) != 0; 1145 } 1146 1147 /** 1148 * <code>optional double left = 1;</code> 1149 * @return this 1150 */ 1151 public ProtobufDifferentialDriveWheelPositions clearLeft() { 1152 bitField0_ &= ~0x00000001; 1153 left = 0D; 1154 return this; 1155 } 1156 1157 /** 1158 * <code>optional double left = 1;</code> 1159 * @return the left 1160 */ 1161 public double getLeft() { 1162 return left; 1163 } 1164 1165 /** 1166 * <code>optional double left = 1;</code> 1167 * @param value the left to set 1168 * @return this 1169 */ 1170 public ProtobufDifferentialDriveWheelPositions setLeft(final double value) { 1171 bitField0_ |= 0x00000001; 1172 left = value; 1173 return this; 1174 } 1175 1176 /** 1177 * <code>optional double right = 2;</code> 1178 * @return whether the right field is set 1179 */ 1180 public boolean hasRight() { 1181 return (bitField0_ & 0x00000002) != 0; 1182 } 1183 1184 /** 1185 * <code>optional double right = 2;</code> 1186 * @return this 1187 */ 1188 public ProtobufDifferentialDriveWheelPositions clearRight() { 1189 bitField0_ &= ~0x00000002; 1190 right = 0D; 1191 return this; 1192 } 1193 1194 /** 1195 * <code>optional double right = 2;</code> 1196 * @return the right 1197 */ 1198 public double getRight() { 1199 return right; 1200 } 1201 1202 /** 1203 * <code>optional double right = 2;</code> 1204 * @param value the right to set 1205 * @return this 1206 */ 1207 public ProtobufDifferentialDriveWheelPositions setRight(final double value) { 1208 bitField0_ |= 0x00000002; 1209 right = value; 1210 return this; 1211 } 1212 1213 @Override 1214 public ProtobufDifferentialDriveWheelPositions copyFrom( 1215 final ProtobufDifferentialDriveWheelPositions other) { 1216 cachedSize = other.cachedSize; 1217 if ((bitField0_ | other.bitField0_) != 0) { 1218 bitField0_ = other.bitField0_; 1219 left = other.left; 1220 right = other.right; 1221 } 1222 return this; 1223 } 1224 1225 @Override 1226 public ProtobufDifferentialDriveWheelPositions mergeFrom( 1227 final ProtobufDifferentialDriveWheelPositions other) { 1228 if (other.isEmpty()) { 1229 return this; 1230 } 1231 cachedSize = -1; 1232 if (other.hasLeft()) { 1233 setLeft(other.left); 1234 } 1235 if (other.hasRight()) { 1236 setRight(other.right); 1237 } 1238 return this; 1239 } 1240 1241 @Override 1242 public ProtobufDifferentialDriveWheelPositions clear() { 1243 if (isEmpty()) { 1244 return this; 1245 } 1246 cachedSize = -1; 1247 bitField0_ = 0; 1248 left = 0D; 1249 right = 0D; 1250 return this; 1251 } 1252 1253 @Override 1254 public ProtobufDifferentialDriveWheelPositions clearQuick() { 1255 if (isEmpty()) { 1256 return this; 1257 } 1258 cachedSize = -1; 1259 bitField0_ = 0; 1260 return this; 1261 } 1262 1263 @Override 1264 public boolean equals(Object o) { 1265 if (o == this) { 1266 return true; 1267 } 1268 if (!(o instanceof ProtobufDifferentialDriveWheelPositions)) { 1269 return false; 1270 } 1271 ProtobufDifferentialDriveWheelPositions other = (ProtobufDifferentialDriveWheelPositions) o; 1272 return bitField0_ == other.bitField0_ 1273 && (!hasLeft() || ProtoUtil.isEqual(left, other.left)) 1274 && (!hasRight() || ProtoUtil.isEqual(right, other.right)); 1275 } 1276 1277 @Override 1278 public void writeTo(final ProtoSink output) throws IOException { 1279 if ((bitField0_ & 0x00000001) != 0) { 1280 output.writeRawByte((byte) 9); 1281 output.writeDoubleNoTag(left); 1282 } 1283 if ((bitField0_ & 0x00000002) != 0) { 1284 output.writeRawByte((byte) 17); 1285 output.writeDoubleNoTag(right); 1286 } 1287 } 1288 1289 @Override 1290 protected int computeSerializedSize() { 1291 int size = 0; 1292 if ((bitField0_ & 0x00000001) != 0) { 1293 size += 9; 1294 } 1295 if ((bitField0_ & 0x00000002) != 0) { 1296 size += 9; 1297 } 1298 return size; 1299 } 1300 1301 @Override 1302 @SuppressWarnings("fallthrough") 1303 public ProtobufDifferentialDriveWheelPositions mergeFrom(final ProtoSource input) throws 1304 IOException { 1305 // Enabled Fall-Through Optimization (QuickBuffers) 1306 int tag = input.readTag(); 1307 while (true) { 1308 switch (tag) { 1309 case 9: { 1310 // left 1311 left = input.readDouble(); 1312 bitField0_ |= 0x00000001; 1313 tag = input.readTag(); 1314 if (tag != 17) { 1315 break; 1316 } 1317 } 1318 case 17: { 1319 // right 1320 right = input.readDouble(); 1321 bitField0_ |= 0x00000002; 1322 tag = input.readTag(); 1323 if (tag != 0) { 1324 break; 1325 } 1326 } 1327 case 0: { 1328 return this; 1329 } 1330 default: { 1331 if (!input.skipField(tag)) { 1332 return this; 1333 } 1334 tag = input.readTag(); 1335 break; 1336 } 1337 } 1338 } 1339 } 1340 1341 @Override 1342 public void writeTo(final JsonSink output) throws IOException { 1343 output.beginObject(); 1344 if ((bitField0_ & 0x00000001) != 0) { 1345 output.writeDouble(FieldNames.left, left); 1346 } 1347 if ((bitField0_ & 0x00000002) != 0) { 1348 output.writeDouble(FieldNames.right, right); 1349 } 1350 output.endObject(); 1351 } 1352 1353 @Override 1354 public ProtobufDifferentialDriveWheelPositions mergeFrom(final JsonSource input) throws 1355 IOException { 1356 if (!input.beginObject()) { 1357 return this; 1358 } 1359 while (!input.isAtEnd()) { 1360 switch (input.readFieldHash()) { 1361 case 3317767: { 1362 if (input.isAtField(FieldNames.left)) { 1363 if (!input.trySkipNullValue()) { 1364 left = input.readDouble(); 1365 bitField0_ |= 0x00000001; 1366 } 1367 } else { 1368 input.skipUnknownField(); 1369 } 1370 break; 1371 } 1372 case 108511772: { 1373 if (input.isAtField(FieldNames.right)) { 1374 if (!input.trySkipNullValue()) { 1375 right = input.readDouble(); 1376 bitField0_ |= 0x00000002; 1377 } 1378 } else { 1379 input.skipUnknownField(); 1380 } 1381 break; 1382 } 1383 default: { 1384 input.skipUnknownField(); 1385 break; 1386 } 1387 } 1388 } 1389 input.endObject(); 1390 return this; 1391 } 1392 1393 @Override 1394 public ProtobufDifferentialDriveWheelPositions clone() { 1395 return new ProtobufDifferentialDriveWheelPositions().copyFrom(this); 1396 } 1397 1398 @Override 1399 public boolean isEmpty() { 1400 return ((bitField0_) == 0); 1401 } 1402 1403 public static ProtobufDifferentialDriveWheelPositions parseFrom(final byte[] data) throws 1404 InvalidProtocolBufferException { 1405 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelPositions(), data).checkInitialized(); 1406 } 1407 1408 public static ProtobufDifferentialDriveWheelPositions parseFrom(final ProtoSource input) throws 1409 IOException { 1410 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelPositions(), input).checkInitialized(); 1411 } 1412 1413 public static ProtobufDifferentialDriveWheelPositions parseFrom(final JsonSource input) throws 1414 IOException { 1415 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelPositions(), input).checkInitialized(); 1416 } 1417 1418 /** 1419 * @return factory for creating ProtobufDifferentialDriveWheelPositions messages 1420 */ 1421 public static MessageFactory<ProtobufDifferentialDriveWheelPositions> getFactory() { 1422 return ProtobufDifferentialDriveWheelPositionsFactory.INSTANCE; 1423 } 1424 1425 /** 1426 * @return this type's descriptor. 1427 */ 1428 public static Descriptors.Descriptor getDescriptor() { 1429 return Kinematics.wpi_proto_ProtobufDifferentialDriveWheelPositions_descriptor; 1430 } 1431 1432 private enum ProtobufDifferentialDriveWheelPositionsFactory implements MessageFactory<ProtobufDifferentialDriveWheelPositions> { 1433 INSTANCE; 1434 1435 @Override 1436 public ProtobufDifferentialDriveWheelPositions create() { 1437 return ProtobufDifferentialDriveWheelPositions.newInstance(); 1438 } 1439 } 1440 1441 /** 1442 * Contains name constants used for serializing JSON 1443 */ 1444 static class FieldNames { 1445 static final FieldName left = FieldName.forField("left"); 1446 1447 static final FieldName right = FieldName.forField("right"); 1448 } 1449 } 1450 1451 /** 1452 * Protobuf type {@code ProtobufMecanumDriveKinematics} 1453 */ 1454 public static final class ProtobufMecanumDriveKinematics extends ProtoMessage<ProtobufMecanumDriveKinematics> implements Cloneable { 1455 private static final long serialVersionUID = 0L; 1456 1457 /** 1458 * <code>optional .wpi.proto.ProtobufTranslation2d front_left = 1;</code> 1459 */ 1460 private final Geometry2D.ProtobufTranslation2d frontLeft = Geometry2D.ProtobufTranslation2d.newInstance(); 1461 1462 /** 1463 * <code>optional .wpi.proto.ProtobufTranslation2d front_right = 2;</code> 1464 */ 1465 private final Geometry2D.ProtobufTranslation2d frontRight = Geometry2D.ProtobufTranslation2d.newInstance(); 1466 1467 /** 1468 * <code>optional .wpi.proto.ProtobufTranslation2d rear_left = 3;</code> 1469 */ 1470 private final Geometry2D.ProtobufTranslation2d rearLeft = Geometry2D.ProtobufTranslation2d.newInstance(); 1471 1472 /** 1473 * <code>optional .wpi.proto.ProtobufTranslation2d rear_right = 4;</code> 1474 */ 1475 private final Geometry2D.ProtobufTranslation2d rearRight = Geometry2D.ProtobufTranslation2d.newInstance(); 1476 1477 private ProtobufMecanumDriveKinematics() { 1478 } 1479 1480 /** 1481 * @return a new empty instance of {@code ProtobufMecanumDriveKinematics} 1482 */ 1483 public static ProtobufMecanumDriveKinematics newInstance() { 1484 return new ProtobufMecanumDriveKinematics(); 1485 } 1486 1487 /** 1488 * <code>optional .wpi.proto.ProtobufTranslation2d front_left = 1;</code> 1489 * @return whether the frontLeft field is set 1490 */ 1491 public boolean hasFrontLeft() { 1492 return (bitField0_ & 0x00000001) != 0; 1493 } 1494 1495 /** 1496 * <code>optional .wpi.proto.ProtobufTranslation2d front_left = 1;</code> 1497 * @return this 1498 */ 1499 public ProtobufMecanumDriveKinematics clearFrontLeft() { 1500 bitField0_ &= ~0x00000001; 1501 frontLeft.clear(); 1502 return this; 1503 } 1504 1505 /** 1506 * <code>optional .wpi.proto.ProtobufTranslation2d front_left = 1;</code> 1507 * 1508 * This method returns the internal storage object without modifying any has state. 1509 * The returned object should not be modified and be treated as read-only. 1510 * 1511 * Use {@link #getMutableFrontLeft()} if you want to modify it. 1512 * 1513 * @return internal storage object for reading 1514 */ 1515 public Geometry2D.ProtobufTranslation2d getFrontLeft() { 1516 return frontLeft; 1517 } 1518 1519 /** 1520 * <code>optional .wpi.proto.ProtobufTranslation2d front_left = 1;</code> 1521 * 1522 * This method returns the internal storage object and sets the corresponding 1523 * has state. The returned object will become part of this message and its 1524 * contents may be modified as long as the has state is not cleared. 1525 * 1526 * @return internal storage object for modifications 1527 */ 1528 public Geometry2D.ProtobufTranslation2d getMutableFrontLeft() { 1529 bitField0_ |= 0x00000001; 1530 return frontLeft; 1531 } 1532 1533 /** 1534 * <code>optional .wpi.proto.ProtobufTranslation2d front_left = 1;</code> 1535 * @param value the frontLeft to set 1536 * @return this 1537 */ 1538 public ProtobufMecanumDriveKinematics setFrontLeft( 1539 final Geometry2D.ProtobufTranslation2d value) { 1540 bitField0_ |= 0x00000001; 1541 frontLeft.copyFrom(value); 1542 return this; 1543 } 1544 1545 /** 1546 * <code>optional .wpi.proto.ProtobufTranslation2d front_right = 2;</code> 1547 * @return whether the frontRight field is set 1548 */ 1549 public boolean hasFrontRight() { 1550 return (bitField0_ & 0x00000002) != 0; 1551 } 1552 1553 /** 1554 * <code>optional .wpi.proto.ProtobufTranslation2d front_right = 2;</code> 1555 * @return this 1556 */ 1557 public ProtobufMecanumDriveKinematics clearFrontRight() { 1558 bitField0_ &= ~0x00000002; 1559 frontRight.clear(); 1560 return this; 1561 } 1562 1563 /** 1564 * <code>optional .wpi.proto.ProtobufTranslation2d front_right = 2;</code> 1565 * 1566 * This method returns the internal storage object without modifying any has state. 1567 * The returned object should not be modified and be treated as read-only. 1568 * 1569 * Use {@link #getMutableFrontRight()} if you want to modify it. 1570 * 1571 * @return internal storage object for reading 1572 */ 1573 public Geometry2D.ProtobufTranslation2d getFrontRight() { 1574 return frontRight; 1575 } 1576 1577 /** 1578 * <code>optional .wpi.proto.ProtobufTranslation2d front_right = 2;</code> 1579 * 1580 * This method returns the internal storage object and sets the corresponding 1581 * has state. The returned object will become part of this message and its 1582 * contents may be modified as long as the has state is not cleared. 1583 * 1584 * @return internal storage object for modifications 1585 */ 1586 public Geometry2D.ProtobufTranslation2d getMutableFrontRight() { 1587 bitField0_ |= 0x00000002; 1588 return frontRight; 1589 } 1590 1591 /** 1592 * <code>optional .wpi.proto.ProtobufTranslation2d front_right = 2;</code> 1593 * @param value the frontRight to set 1594 * @return this 1595 */ 1596 public ProtobufMecanumDriveKinematics setFrontRight( 1597 final Geometry2D.ProtobufTranslation2d value) { 1598 bitField0_ |= 0x00000002; 1599 frontRight.copyFrom(value); 1600 return this; 1601 } 1602 1603 /** 1604 * <code>optional .wpi.proto.ProtobufTranslation2d rear_left = 3;</code> 1605 * @return whether the rearLeft field is set 1606 */ 1607 public boolean hasRearLeft() { 1608 return (bitField0_ & 0x00000004) != 0; 1609 } 1610 1611 /** 1612 * <code>optional .wpi.proto.ProtobufTranslation2d rear_left = 3;</code> 1613 * @return this 1614 */ 1615 public ProtobufMecanumDriveKinematics clearRearLeft() { 1616 bitField0_ &= ~0x00000004; 1617 rearLeft.clear(); 1618 return this; 1619 } 1620 1621 /** 1622 * <code>optional .wpi.proto.ProtobufTranslation2d rear_left = 3;</code> 1623 * 1624 * This method returns the internal storage object without modifying any has state. 1625 * The returned object should not be modified and be treated as read-only. 1626 * 1627 * Use {@link #getMutableRearLeft()} if you want to modify it. 1628 * 1629 * @return internal storage object for reading 1630 */ 1631 public Geometry2D.ProtobufTranslation2d getRearLeft() { 1632 return rearLeft; 1633 } 1634 1635 /** 1636 * <code>optional .wpi.proto.ProtobufTranslation2d rear_left = 3;</code> 1637 * 1638 * This method returns the internal storage object and sets the corresponding 1639 * has state. The returned object will become part of this message and its 1640 * contents may be modified as long as the has state is not cleared. 1641 * 1642 * @return internal storage object for modifications 1643 */ 1644 public Geometry2D.ProtobufTranslation2d getMutableRearLeft() { 1645 bitField0_ |= 0x00000004; 1646 return rearLeft; 1647 } 1648 1649 /** 1650 * <code>optional .wpi.proto.ProtobufTranslation2d rear_left = 3;</code> 1651 * @param value the rearLeft to set 1652 * @return this 1653 */ 1654 public ProtobufMecanumDriveKinematics setRearLeft( 1655 final Geometry2D.ProtobufTranslation2d value) { 1656 bitField0_ |= 0x00000004; 1657 rearLeft.copyFrom(value); 1658 return this; 1659 } 1660 1661 /** 1662 * <code>optional .wpi.proto.ProtobufTranslation2d rear_right = 4;</code> 1663 * @return whether the rearRight field is set 1664 */ 1665 public boolean hasRearRight() { 1666 return (bitField0_ & 0x00000008) != 0; 1667 } 1668 1669 /** 1670 * <code>optional .wpi.proto.ProtobufTranslation2d rear_right = 4;</code> 1671 * @return this 1672 */ 1673 public ProtobufMecanumDriveKinematics clearRearRight() { 1674 bitField0_ &= ~0x00000008; 1675 rearRight.clear(); 1676 return this; 1677 } 1678 1679 /** 1680 * <code>optional .wpi.proto.ProtobufTranslation2d rear_right = 4;</code> 1681 * 1682 * This method returns the internal storage object without modifying any has state. 1683 * The returned object should not be modified and be treated as read-only. 1684 * 1685 * Use {@link #getMutableRearRight()} if you want to modify it. 1686 * 1687 * @return internal storage object for reading 1688 */ 1689 public Geometry2D.ProtobufTranslation2d getRearRight() { 1690 return rearRight; 1691 } 1692 1693 /** 1694 * <code>optional .wpi.proto.ProtobufTranslation2d rear_right = 4;</code> 1695 * 1696 * This method returns the internal storage object and sets the corresponding 1697 * has state. The returned object will become part of this message and its 1698 * contents may be modified as long as the has state is not cleared. 1699 * 1700 * @return internal storage object for modifications 1701 */ 1702 public Geometry2D.ProtobufTranslation2d getMutableRearRight() { 1703 bitField0_ |= 0x00000008; 1704 return rearRight; 1705 } 1706 1707 /** 1708 * <code>optional .wpi.proto.ProtobufTranslation2d rear_right = 4;</code> 1709 * @param value the rearRight to set 1710 * @return this 1711 */ 1712 public ProtobufMecanumDriveKinematics setRearRight( 1713 final Geometry2D.ProtobufTranslation2d value) { 1714 bitField0_ |= 0x00000008; 1715 rearRight.copyFrom(value); 1716 return this; 1717 } 1718 1719 @Override 1720 public ProtobufMecanumDriveKinematics copyFrom(final ProtobufMecanumDriveKinematics other) { 1721 cachedSize = other.cachedSize; 1722 if ((bitField0_ | other.bitField0_) != 0) { 1723 bitField0_ = other.bitField0_; 1724 frontLeft.copyFrom(other.frontLeft); 1725 frontRight.copyFrom(other.frontRight); 1726 rearLeft.copyFrom(other.rearLeft); 1727 rearRight.copyFrom(other.rearRight); 1728 } 1729 return this; 1730 } 1731 1732 @Override 1733 public ProtobufMecanumDriveKinematics mergeFrom(final ProtobufMecanumDriveKinematics other) { 1734 if (other.isEmpty()) { 1735 return this; 1736 } 1737 cachedSize = -1; 1738 if (other.hasFrontLeft()) { 1739 getMutableFrontLeft().mergeFrom(other.frontLeft); 1740 } 1741 if (other.hasFrontRight()) { 1742 getMutableFrontRight().mergeFrom(other.frontRight); 1743 } 1744 if (other.hasRearLeft()) { 1745 getMutableRearLeft().mergeFrom(other.rearLeft); 1746 } 1747 if (other.hasRearRight()) { 1748 getMutableRearRight().mergeFrom(other.rearRight); 1749 } 1750 return this; 1751 } 1752 1753 @Override 1754 public ProtobufMecanumDriveKinematics clear() { 1755 if (isEmpty()) { 1756 return this; 1757 } 1758 cachedSize = -1; 1759 bitField0_ = 0; 1760 frontLeft.clear(); 1761 frontRight.clear(); 1762 rearLeft.clear(); 1763 rearRight.clear(); 1764 return this; 1765 } 1766 1767 @Override 1768 public ProtobufMecanumDriveKinematics clearQuick() { 1769 if (isEmpty()) { 1770 return this; 1771 } 1772 cachedSize = -1; 1773 bitField0_ = 0; 1774 frontLeft.clearQuick(); 1775 frontRight.clearQuick(); 1776 rearLeft.clearQuick(); 1777 rearRight.clearQuick(); 1778 return this; 1779 } 1780 1781 @Override 1782 public boolean equals(Object o) { 1783 if (o == this) { 1784 return true; 1785 } 1786 if (!(o instanceof ProtobufMecanumDriveKinematics)) { 1787 return false; 1788 } 1789 ProtobufMecanumDriveKinematics other = (ProtobufMecanumDriveKinematics) o; 1790 return bitField0_ == other.bitField0_ 1791 && (!hasFrontLeft() || frontLeft.equals(other.frontLeft)) 1792 && (!hasFrontRight() || frontRight.equals(other.frontRight)) 1793 && (!hasRearLeft() || rearLeft.equals(other.rearLeft)) 1794 && (!hasRearRight() || rearRight.equals(other.rearRight)); 1795 } 1796 1797 @Override 1798 public void writeTo(final ProtoSink output) throws IOException { 1799 if ((bitField0_ & 0x00000001) != 0) { 1800 output.writeRawByte((byte) 10); 1801 output.writeMessageNoTag(frontLeft); 1802 } 1803 if ((bitField0_ & 0x00000002) != 0) { 1804 output.writeRawByte((byte) 18); 1805 output.writeMessageNoTag(frontRight); 1806 } 1807 if ((bitField0_ & 0x00000004) != 0) { 1808 output.writeRawByte((byte) 26); 1809 output.writeMessageNoTag(rearLeft); 1810 } 1811 if ((bitField0_ & 0x00000008) != 0) { 1812 output.writeRawByte((byte) 34); 1813 output.writeMessageNoTag(rearRight); 1814 } 1815 } 1816 1817 @Override 1818 protected int computeSerializedSize() { 1819 int size = 0; 1820 if ((bitField0_ & 0x00000001) != 0) { 1821 size += 1 + ProtoSink.computeMessageSizeNoTag(frontLeft); 1822 } 1823 if ((bitField0_ & 0x00000002) != 0) { 1824 size += 1 + ProtoSink.computeMessageSizeNoTag(frontRight); 1825 } 1826 if ((bitField0_ & 0x00000004) != 0) { 1827 size += 1 + ProtoSink.computeMessageSizeNoTag(rearLeft); 1828 } 1829 if ((bitField0_ & 0x00000008) != 0) { 1830 size += 1 + ProtoSink.computeMessageSizeNoTag(rearRight); 1831 } 1832 return size; 1833 } 1834 1835 @Override 1836 @SuppressWarnings("fallthrough") 1837 public ProtobufMecanumDriveKinematics mergeFrom(final ProtoSource input) throws IOException { 1838 // Enabled Fall-Through Optimization (QuickBuffers) 1839 int tag = input.readTag(); 1840 while (true) { 1841 switch (tag) { 1842 case 10: { 1843 // frontLeft 1844 input.readMessage(frontLeft); 1845 bitField0_ |= 0x00000001; 1846 tag = input.readTag(); 1847 if (tag != 18) { 1848 break; 1849 } 1850 } 1851 case 18: { 1852 // frontRight 1853 input.readMessage(frontRight); 1854 bitField0_ |= 0x00000002; 1855 tag = input.readTag(); 1856 if (tag != 26) { 1857 break; 1858 } 1859 } 1860 case 26: { 1861 // rearLeft 1862 input.readMessage(rearLeft); 1863 bitField0_ |= 0x00000004; 1864 tag = input.readTag(); 1865 if (tag != 34) { 1866 break; 1867 } 1868 } 1869 case 34: { 1870 // rearRight 1871 input.readMessage(rearRight); 1872 bitField0_ |= 0x00000008; 1873 tag = input.readTag(); 1874 if (tag != 0) { 1875 break; 1876 } 1877 } 1878 case 0: { 1879 return this; 1880 } 1881 default: { 1882 if (!input.skipField(tag)) { 1883 return this; 1884 } 1885 tag = input.readTag(); 1886 break; 1887 } 1888 } 1889 } 1890 } 1891 1892 @Override 1893 public void writeTo(final JsonSink output) throws IOException { 1894 output.beginObject(); 1895 if ((bitField0_ & 0x00000001) != 0) { 1896 output.writeMessage(FieldNames.frontLeft, frontLeft); 1897 } 1898 if ((bitField0_ & 0x00000002) != 0) { 1899 output.writeMessage(FieldNames.frontRight, frontRight); 1900 } 1901 if ((bitField0_ & 0x00000004) != 0) { 1902 output.writeMessage(FieldNames.rearLeft, rearLeft); 1903 } 1904 if ((bitField0_ & 0x00000008) != 0) { 1905 output.writeMessage(FieldNames.rearRight, rearRight); 1906 } 1907 output.endObject(); 1908 } 1909 1910 @Override 1911 public ProtobufMecanumDriveKinematics mergeFrom(final JsonSource input) throws IOException { 1912 if (!input.beginObject()) { 1913 return this; 1914 } 1915 while (!input.isAtEnd()) { 1916 switch (input.readFieldHash()) { 1917 case 127514064: 1918 case -324277155: { 1919 if (input.isAtField(FieldNames.frontLeft)) { 1920 if (!input.trySkipNullValue()) { 1921 input.readMessage(frontLeft); 1922 bitField0_ |= 0x00000001; 1923 } 1924 } else { 1925 input.skipUnknownField(); 1926 } 1927 break; 1928 } 1929 case -336370317: 1930 case -1456996218: { 1931 if (input.isAtField(FieldNames.frontRight)) { 1932 if (!input.trySkipNullValue()) { 1933 input.readMessage(frontRight); 1934 bitField0_ |= 0x00000002; 1935 } 1936 } else { 1937 input.skipUnknownField(); 1938 } 1939 break; 1940 } 1941 case -854852661: 1942 case -712874558: { 1943 if (input.isAtField(FieldNames.rearLeft)) { 1944 if (!input.trySkipNullValue()) { 1945 input.readMessage(rearLeft); 1946 bitField0_ |= 0x00000004; 1947 } 1948 } else { 1949 input.skipUnknownField(); 1950 } 1951 break; 1952 } 1953 case -724967720: 1954 case -618613823: { 1955 if (input.isAtField(FieldNames.rearRight)) { 1956 if (!input.trySkipNullValue()) { 1957 input.readMessage(rearRight); 1958 bitField0_ |= 0x00000008; 1959 } 1960 } else { 1961 input.skipUnknownField(); 1962 } 1963 break; 1964 } 1965 default: { 1966 input.skipUnknownField(); 1967 break; 1968 } 1969 } 1970 } 1971 input.endObject(); 1972 return this; 1973 } 1974 1975 @Override 1976 public ProtobufMecanumDriveKinematics clone() { 1977 return new ProtobufMecanumDriveKinematics().copyFrom(this); 1978 } 1979 1980 @Override 1981 public boolean isEmpty() { 1982 return ((bitField0_) == 0); 1983 } 1984 1985 public static ProtobufMecanumDriveKinematics parseFrom(final byte[] data) throws 1986 InvalidProtocolBufferException { 1987 return ProtoMessage.mergeFrom(new ProtobufMecanumDriveKinematics(), data).checkInitialized(); 1988 } 1989 1990 public static ProtobufMecanumDriveKinematics parseFrom(final ProtoSource input) throws 1991 IOException { 1992 return ProtoMessage.mergeFrom(new ProtobufMecanumDriveKinematics(), input).checkInitialized(); 1993 } 1994 1995 public static ProtobufMecanumDriveKinematics parseFrom(final JsonSource input) throws 1996 IOException { 1997 return ProtoMessage.mergeFrom(new ProtobufMecanumDriveKinematics(), input).checkInitialized(); 1998 } 1999 2000 /** 2001 * @return factory for creating ProtobufMecanumDriveKinematics messages 2002 */ 2003 public static MessageFactory<ProtobufMecanumDriveKinematics> getFactory() { 2004 return ProtobufMecanumDriveKinematicsFactory.INSTANCE; 2005 } 2006 2007 /** 2008 * @return this type's descriptor. 2009 */ 2010 public static Descriptors.Descriptor getDescriptor() { 2011 return Kinematics.wpi_proto_ProtobufMecanumDriveKinematics_descriptor; 2012 } 2013 2014 private enum ProtobufMecanumDriveKinematicsFactory implements MessageFactory<ProtobufMecanumDriveKinematics> { 2015 INSTANCE; 2016 2017 @Override 2018 public ProtobufMecanumDriveKinematics create() { 2019 return ProtobufMecanumDriveKinematics.newInstance(); 2020 } 2021 } 2022 2023 /** 2024 * Contains name constants used for serializing JSON 2025 */ 2026 static class FieldNames { 2027 static final FieldName frontLeft = FieldName.forField("frontLeft", "front_left"); 2028 2029 static final FieldName frontRight = FieldName.forField("frontRight", "front_right"); 2030 2031 static final FieldName rearLeft = FieldName.forField("rearLeft", "rear_left"); 2032 2033 static final FieldName rearRight = FieldName.forField("rearRight", "rear_right"); 2034 } 2035 } 2036 2037 /** 2038 * Protobuf type {@code ProtobufMecanumDriveWheelPositions} 2039 */ 2040 public static final class ProtobufMecanumDriveWheelPositions extends ProtoMessage<ProtobufMecanumDriveWheelPositions> implements Cloneable { 2041 private static final long serialVersionUID = 0L; 2042 2043 /** 2044 * <code>optional double front_left = 1;</code> 2045 */ 2046 private double frontLeft; 2047 2048 /** 2049 * <code>optional double front_right = 2;</code> 2050 */ 2051 private double frontRight; 2052 2053 /** 2054 * <code>optional double rear_left = 3;</code> 2055 */ 2056 private double rearLeft; 2057 2058 /** 2059 * <code>optional double rear_right = 4;</code> 2060 */ 2061 private double rearRight; 2062 2063 private ProtobufMecanumDriveWheelPositions() { 2064 } 2065 2066 /** 2067 * @return a new empty instance of {@code ProtobufMecanumDriveWheelPositions} 2068 */ 2069 public static ProtobufMecanumDriveWheelPositions newInstance() { 2070 return new ProtobufMecanumDriveWheelPositions(); 2071 } 2072 2073 /** 2074 * <code>optional double front_left = 1;</code> 2075 * @return whether the frontLeft field is set 2076 */ 2077 public boolean hasFrontLeft() { 2078 return (bitField0_ & 0x00000001) != 0; 2079 } 2080 2081 /** 2082 * <code>optional double front_left = 1;</code> 2083 * @return this 2084 */ 2085 public ProtobufMecanumDriveWheelPositions clearFrontLeft() { 2086 bitField0_ &= ~0x00000001; 2087 frontLeft = 0D; 2088 return this; 2089 } 2090 2091 /** 2092 * <code>optional double front_left = 1;</code> 2093 * @return the frontLeft 2094 */ 2095 public double getFrontLeft() { 2096 return frontLeft; 2097 } 2098 2099 /** 2100 * <code>optional double front_left = 1;</code> 2101 * @param value the frontLeft to set 2102 * @return this 2103 */ 2104 public ProtobufMecanumDriveWheelPositions setFrontLeft(final double value) { 2105 bitField0_ |= 0x00000001; 2106 frontLeft = value; 2107 return this; 2108 } 2109 2110 /** 2111 * <code>optional double front_right = 2;</code> 2112 * @return whether the frontRight field is set 2113 */ 2114 public boolean hasFrontRight() { 2115 return (bitField0_ & 0x00000002) != 0; 2116 } 2117 2118 /** 2119 * <code>optional double front_right = 2;</code> 2120 * @return this 2121 */ 2122 public ProtobufMecanumDriveWheelPositions clearFrontRight() { 2123 bitField0_ &= ~0x00000002; 2124 frontRight = 0D; 2125 return this; 2126 } 2127 2128 /** 2129 * <code>optional double front_right = 2;</code> 2130 * @return the frontRight 2131 */ 2132 public double getFrontRight() { 2133 return frontRight; 2134 } 2135 2136 /** 2137 * <code>optional double front_right = 2;</code> 2138 * @param value the frontRight to set 2139 * @return this 2140 */ 2141 public ProtobufMecanumDriveWheelPositions setFrontRight(final double value) { 2142 bitField0_ |= 0x00000002; 2143 frontRight = value; 2144 return this; 2145 } 2146 2147 /** 2148 * <code>optional double rear_left = 3;</code> 2149 * @return whether the rearLeft field is set 2150 */ 2151 public boolean hasRearLeft() { 2152 return (bitField0_ & 0x00000004) != 0; 2153 } 2154 2155 /** 2156 * <code>optional double rear_left = 3;</code> 2157 * @return this 2158 */ 2159 public ProtobufMecanumDriveWheelPositions clearRearLeft() { 2160 bitField0_ &= ~0x00000004; 2161 rearLeft = 0D; 2162 return this; 2163 } 2164 2165 /** 2166 * <code>optional double rear_left = 3;</code> 2167 * @return the rearLeft 2168 */ 2169 public double getRearLeft() { 2170 return rearLeft; 2171 } 2172 2173 /** 2174 * <code>optional double rear_left = 3;</code> 2175 * @param value the rearLeft to set 2176 * @return this 2177 */ 2178 public ProtobufMecanumDriveWheelPositions setRearLeft(final double value) { 2179 bitField0_ |= 0x00000004; 2180 rearLeft = value; 2181 return this; 2182 } 2183 2184 /** 2185 * <code>optional double rear_right = 4;</code> 2186 * @return whether the rearRight field is set 2187 */ 2188 public boolean hasRearRight() { 2189 return (bitField0_ & 0x00000008) != 0; 2190 } 2191 2192 /** 2193 * <code>optional double rear_right = 4;</code> 2194 * @return this 2195 */ 2196 public ProtobufMecanumDriveWheelPositions clearRearRight() { 2197 bitField0_ &= ~0x00000008; 2198 rearRight = 0D; 2199 return this; 2200 } 2201 2202 /** 2203 * <code>optional double rear_right = 4;</code> 2204 * @return the rearRight 2205 */ 2206 public double getRearRight() { 2207 return rearRight; 2208 } 2209 2210 /** 2211 * <code>optional double rear_right = 4;</code> 2212 * @param value the rearRight to set 2213 * @return this 2214 */ 2215 public ProtobufMecanumDriveWheelPositions setRearRight(final double value) { 2216 bitField0_ |= 0x00000008; 2217 rearRight = value; 2218 return this; 2219 } 2220 2221 @Override 2222 public ProtobufMecanumDriveWheelPositions copyFrom( 2223 final ProtobufMecanumDriveWheelPositions other) { 2224 cachedSize = other.cachedSize; 2225 if ((bitField0_ | other.bitField0_) != 0) { 2226 bitField0_ = other.bitField0_; 2227 frontLeft = other.frontLeft; 2228 frontRight = other.frontRight; 2229 rearLeft = other.rearLeft; 2230 rearRight = other.rearRight; 2231 } 2232 return this; 2233 } 2234 2235 @Override 2236 public ProtobufMecanumDriveWheelPositions mergeFrom( 2237 final ProtobufMecanumDriveWheelPositions other) { 2238 if (other.isEmpty()) { 2239 return this; 2240 } 2241 cachedSize = -1; 2242 if (other.hasFrontLeft()) { 2243 setFrontLeft(other.frontLeft); 2244 } 2245 if (other.hasFrontRight()) { 2246 setFrontRight(other.frontRight); 2247 } 2248 if (other.hasRearLeft()) { 2249 setRearLeft(other.rearLeft); 2250 } 2251 if (other.hasRearRight()) { 2252 setRearRight(other.rearRight); 2253 } 2254 return this; 2255 } 2256 2257 @Override 2258 public ProtobufMecanumDriveWheelPositions clear() { 2259 if (isEmpty()) { 2260 return this; 2261 } 2262 cachedSize = -1; 2263 bitField0_ = 0; 2264 frontLeft = 0D; 2265 frontRight = 0D; 2266 rearLeft = 0D; 2267 rearRight = 0D; 2268 return this; 2269 } 2270 2271 @Override 2272 public ProtobufMecanumDriveWheelPositions clearQuick() { 2273 if (isEmpty()) { 2274 return this; 2275 } 2276 cachedSize = -1; 2277 bitField0_ = 0; 2278 return this; 2279 } 2280 2281 @Override 2282 public boolean equals(Object o) { 2283 if (o == this) { 2284 return true; 2285 } 2286 if (!(o instanceof ProtobufMecanumDriveWheelPositions)) { 2287 return false; 2288 } 2289 ProtobufMecanumDriveWheelPositions other = (ProtobufMecanumDriveWheelPositions) o; 2290 return bitField0_ == other.bitField0_ 2291 && (!hasFrontLeft() || ProtoUtil.isEqual(frontLeft, other.frontLeft)) 2292 && (!hasFrontRight() || ProtoUtil.isEqual(frontRight, other.frontRight)) 2293 && (!hasRearLeft() || ProtoUtil.isEqual(rearLeft, other.rearLeft)) 2294 && (!hasRearRight() || ProtoUtil.isEqual(rearRight, other.rearRight)); 2295 } 2296 2297 @Override 2298 public void writeTo(final ProtoSink output) throws IOException { 2299 if ((bitField0_ & 0x00000001) != 0) { 2300 output.writeRawByte((byte) 9); 2301 output.writeDoubleNoTag(frontLeft); 2302 } 2303 if ((bitField0_ & 0x00000002) != 0) { 2304 output.writeRawByte((byte) 17); 2305 output.writeDoubleNoTag(frontRight); 2306 } 2307 if ((bitField0_ & 0x00000004) != 0) { 2308 output.writeRawByte((byte) 25); 2309 output.writeDoubleNoTag(rearLeft); 2310 } 2311 if ((bitField0_ & 0x00000008) != 0) { 2312 output.writeRawByte((byte) 33); 2313 output.writeDoubleNoTag(rearRight); 2314 } 2315 } 2316 2317 @Override 2318 protected int computeSerializedSize() { 2319 int size = 0; 2320 if ((bitField0_ & 0x00000001) != 0) { 2321 size += 9; 2322 } 2323 if ((bitField0_ & 0x00000002) != 0) { 2324 size += 9; 2325 } 2326 if ((bitField0_ & 0x00000004) != 0) { 2327 size += 9; 2328 } 2329 if ((bitField0_ & 0x00000008) != 0) { 2330 size += 9; 2331 } 2332 return size; 2333 } 2334 2335 @Override 2336 @SuppressWarnings("fallthrough") 2337 public ProtobufMecanumDriveWheelPositions mergeFrom(final ProtoSource input) throws 2338 IOException { 2339 // Enabled Fall-Through Optimization (QuickBuffers) 2340 int tag = input.readTag(); 2341 while (true) { 2342 switch (tag) { 2343 case 9: { 2344 // frontLeft 2345 frontLeft = input.readDouble(); 2346 bitField0_ |= 0x00000001; 2347 tag = input.readTag(); 2348 if (tag != 17) { 2349 break; 2350 } 2351 } 2352 case 17: { 2353 // frontRight 2354 frontRight = input.readDouble(); 2355 bitField0_ |= 0x00000002; 2356 tag = input.readTag(); 2357 if (tag != 25) { 2358 break; 2359 } 2360 } 2361 case 25: { 2362 // rearLeft 2363 rearLeft = input.readDouble(); 2364 bitField0_ |= 0x00000004; 2365 tag = input.readTag(); 2366 if (tag != 33) { 2367 break; 2368 } 2369 } 2370 case 33: { 2371 // rearRight 2372 rearRight = input.readDouble(); 2373 bitField0_ |= 0x00000008; 2374 tag = input.readTag(); 2375 if (tag != 0) { 2376 break; 2377 } 2378 } 2379 case 0: { 2380 return this; 2381 } 2382 default: { 2383 if (!input.skipField(tag)) { 2384 return this; 2385 } 2386 tag = input.readTag(); 2387 break; 2388 } 2389 } 2390 } 2391 } 2392 2393 @Override 2394 public void writeTo(final JsonSink output) throws IOException { 2395 output.beginObject(); 2396 if ((bitField0_ & 0x00000001) != 0) { 2397 output.writeDouble(FieldNames.frontLeft, frontLeft); 2398 } 2399 if ((bitField0_ & 0x00000002) != 0) { 2400 output.writeDouble(FieldNames.frontRight, frontRight); 2401 } 2402 if ((bitField0_ & 0x00000004) != 0) { 2403 output.writeDouble(FieldNames.rearLeft, rearLeft); 2404 } 2405 if ((bitField0_ & 0x00000008) != 0) { 2406 output.writeDouble(FieldNames.rearRight, rearRight); 2407 } 2408 output.endObject(); 2409 } 2410 2411 @Override 2412 public ProtobufMecanumDriveWheelPositions mergeFrom(final JsonSource input) throws IOException { 2413 if (!input.beginObject()) { 2414 return this; 2415 } 2416 while (!input.isAtEnd()) { 2417 switch (input.readFieldHash()) { 2418 case 127514064: 2419 case -324277155: { 2420 if (input.isAtField(FieldNames.frontLeft)) { 2421 if (!input.trySkipNullValue()) { 2422 frontLeft = input.readDouble(); 2423 bitField0_ |= 0x00000001; 2424 } 2425 } else { 2426 input.skipUnknownField(); 2427 } 2428 break; 2429 } 2430 case -336370317: 2431 case -1456996218: { 2432 if (input.isAtField(FieldNames.frontRight)) { 2433 if (!input.trySkipNullValue()) { 2434 frontRight = input.readDouble(); 2435 bitField0_ |= 0x00000002; 2436 } 2437 } else { 2438 input.skipUnknownField(); 2439 } 2440 break; 2441 } 2442 case -854852661: 2443 case -712874558: { 2444 if (input.isAtField(FieldNames.rearLeft)) { 2445 if (!input.trySkipNullValue()) { 2446 rearLeft = input.readDouble(); 2447 bitField0_ |= 0x00000004; 2448 } 2449 } else { 2450 input.skipUnknownField(); 2451 } 2452 break; 2453 } 2454 case -724967720: 2455 case -618613823: { 2456 if (input.isAtField(FieldNames.rearRight)) { 2457 if (!input.trySkipNullValue()) { 2458 rearRight = input.readDouble(); 2459 bitField0_ |= 0x00000008; 2460 } 2461 } else { 2462 input.skipUnknownField(); 2463 } 2464 break; 2465 } 2466 default: { 2467 input.skipUnknownField(); 2468 break; 2469 } 2470 } 2471 } 2472 input.endObject(); 2473 return this; 2474 } 2475 2476 @Override 2477 public ProtobufMecanumDriveWheelPositions clone() { 2478 return new ProtobufMecanumDriveWheelPositions().copyFrom(this); 2479 } 2480 2481 @Override 2482 public boolean isEmpty() { 2483 return ((bitField0_) == 0); 2484 } 2485 2486 public static ProtobufMecanumDriveWheelPositions parseFrom(final byte[] data) throws 2487 InvalidProtocolBufferException { 2488 return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelPositions(), data).checkInitialized(); 2489 } 2490 2491 public static ProtobufMecanumDriveWheelPositions parseFrom(final ProtoSource input) throws 2492 IOException { 2493 return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelPositions(), input).checkInitialized(); 2494 } 2495 2496 public static ProtobufMecanumDriveWheelPositions parseFrom(final JsonSource input) throws 2497 IOException { 2498 return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelPositions(), input).checkInitialized(); 2499 } 2500 2501 /** 2502 * @return factory for creating ProtobufMecanumDriveWheelPositions messages 2503 */ 2504 public static MessageFactory<ProtobufMecanumDriveWheelPositions> getFactory() { 2505 return ProtobufMecanumDriveWheelPositionsFactory.INSTANCE; 2506 } 2507 2508 /** 2509 * @return this type's descriptor. 2510 */ 2511 public static Descriptors.Descriptor getDescriptor() { 2512 return Kinematics.wpi_proto_ProtobufMecanumDriveWheelPositions_descriptor; 2513 } 2514 2515 private enum ProtobufMecanumDriveWheelPositionsFactory implements MessageFactory<ProtobufMecanumDriveWheelPositions> { 2516 INSTANCE; 2517 2518 @Override 2519 public ProtobufMecanumDriveWheelPositions create() { 2520 return ProtobufMecanumDriveWheelPositions.newInstance(); 2521 } 2522 } 2523 2524 /** 2525 * Contains name constants used for serializing JSON 2526 */ 2527 static class FieldNames { 2528 static final FieldName frontLeft = FieldName.forField("frontLeft", "front_left"); 2529 2530 static final FieldName frontRight = FieldName.forField("frontRight", "front_right"); 2531 2532 static final FieldName rearLeft = FieldName.forField("rearLeft", "rear_left"); 2533 2534 static final FieldName rearRight = FieldName.forField("rearRight", "rear_right"); 2535 } 2536 } 2537 2538 /** 2539 * Protobuf type {@code ProtobufMecanumDriveWheelSpeeds} 2540 */ 2541 public static final class ProtobufMecanumDriveWheelSpeeds extends ProtoMessage<ProtobufMecanumDriveWheelSpeeds> implements Cloneable { 2542 private static final long serialVersionUID = 0L; 2543 2544 /** 2545 * <code>optional double front_left = 1;</code> 2546 */ 2547 private double frontLeft; 2548 2549 /** 2550 * <code>optional double front_right = 2;</code> 2551 */ 2552 private double frontRight; 2553 2554 /** 2555 * <code>optional double rear_left = 3;</code> 2556 */ 2557 private double rearLeft; 2558 2559 /** 2560 * <code>optional double rear_right = 4;</code> 2561 */ 2562 private double rearRight; 2563 2564 private ProtobufMecanumDriveWheelSpeeds() { 2565 } 2566 2567 /** 2568 * @return a new empty instance of {@code ProtobufMecanumDriveWheelSpeeds} 2569 */ 2570 public static ProtobufMecanumDriveWheelSpeeds newInstance() { 2571 return new ProtobufMecanumDriveWheelSpeeds(); 2572 } 2573 2574 /** 2575 * <code>optional double front_left = 1;</code> 2576 * @return whether the frontLeft field is set 2577 */ 2578 public boolean hasFrontLeft() { 2579 return (bitField0_ & 0x00000001) != 0; 2580 } 2581 2582 /** 2583 * <code>optional double front_left = 1;</code> 2584 * @return this 2585 */ 2586 public ProtobufMecanumDriveWheelSpeeds clearFrontLeft() { 2587 bitField0_ &= ~0x00000001; 2588 frontLeft = 0D; 2589 return this; 2590 } 2591 2592 /** 2593 * <code>optional double front_left = 1;</code> 2594 * @return the frontLeft 2595 */ 2596 public double getFrontLeft() { 2597 return frontLeft; 2598 } 2599 2600 /** 2601 * <code>optional double front_left = 1;</code> 2602 * @param value the frontLeft to set 2603 * @return this 2604 */ 2605 public ProtobufMecanumDriveWheelSpeeds setFrontLeft(final double value) { 2606 bitField0_ |= 0x00000001; 2607 frontLeft = value; 2608 return this; 2609 } 2610 2611 /** 2612 * <code>optional double front_right = 2;</code> 2613 * @return whether the frontRight field is set 2614 */ 2615 public boolean hasFrontRight() { 2616 return (bitField0_ & 0x00000002) != 0; 2617 } 2618 2619 /** 2620 * <code>optional double front_right = 2;</code> 2621 * @return this 2622 */ 2623 public ProtobufMecanumDriveWheelSpeeds clearFrontRight() { 2624 bitField0_ &= ~0x00000002; 2625 frontRight = 0D; 2626 return this; 2627 } 2628 2629 /** 2630 * <code>optional double front_right = 2;</code> 2631 * @return the frontRight 2632 */ 2633 public double getFrontRight() { 2634 return frontRight; 2635 } 2636 2637 /** 2638 * <code>optional double front_right = 2;</code> 2639 * @param value the frontRight to set 2640 * @return this 2641 */ 2642 public ProtobufMecanumDriveWheelSpeeds setFrontRight(final double value) { 2643 bitField0_ |= 0x00000002; 2644 frontRight = value; 2645 return this; 2646 } 2647 2648 /** 2649 * <code>optional double rear_left = 3;</code> 2650 * @return whether the rearLeft field is set 2651 */ 2652 public boolean hasRearLeft() { 2653 return (bitField0_ & 0x00000004) != 0; 2654 } 2655 2656 /** 2657 * <code>optional double rear_left = 3;</code> 2658 * @return this 2659 */ 2660 public ProtobufMecanumDriveWheelSpeeds clearRearLeft() { 2661 bitField0_ &= ~0x00000004; 2662 rearLeft = 0D; 2663 return this; 2664 } 2665 2666 /** 2667 * <code>optional double rear_left = 3;</code> 2668 * @return the rearLeft 2669 */ 2670 public double getRearLeft() { 2671 return rearLeft; 2672 } 2673 2674 /** 2675 * <code>optional double rear_left = 3;</code> 2676 * @param value the rearLeft to set 2677 * @return this 2678 */ 2679 public ProtobufMecanumDriveWheelSpeeds setRearLeft(final double value) { 2680 bitField0_ |= 0x00000004; 2681 rearLeft = value; 2682 return this; 2683 } 2684 2685 /** 2686 * <code>optional double rear_right = 4;</code> 2687 * @return whether the rearRight field is set 2688 */ 2689 public boolean hasRearRight() { 2690 return (bitField0_ & 0x00000008) != 0; 2691 } 2692 2693 /** 2694 * <code>optional double rear_right = 4;</code> 2695 * @return this 2696 */ 2697 public ProtobufMecanumDriveWheelSpeeds clearRearRight() { 2698 bitField0_ &= ~0x00000008; 2699 rearRight = 0D; 2700 return this; 2701 } 2702 2703 /** 2704 * <code>optional double rear_right = 4;</code> 2705 * @return the rearRight 2706 */ 2707 public double getRearRight() { 2708 return rearRight; 2709 } 2710 2711 /** 2712 * <code>optional double rear_right = 4;</code> 2713 * @param value the rearRight to set 2714 * @return this 2715 */ 2716 public ProtobufMecanumDriveWheelSpeeds setRearRight(final double value) { 2717 bitField0_ |= 0x00000008; 2718 rearRight = value; 2719 return this; 2720 } 2721 2722 @Override 2723 public ProtobufMecanumDriveWheelSpeeds copyFrom(final ProtobufMecanumDriveWheelSpeeds other) { 2724 cachedSize = other.cachedSize; 2725 if ((bitField0_ | other.bitField0_) != 0) { 2726 bitField0_ = other.bitField0_; 2727 frontLeft = other.frontLeft; 2728 frontRight = other.frontRight; 2729 rearLeft = other.rearLeft; 2730 rearRight = other.rearRight; 2731 } 2732 return this; 2733 } 2734 2735 @Override 2736 public ProtobufMecanumDriveWheelSpeeds mergeFrom(final ProtobufMecanumDriveWheelSpeeds other) { 2737 if (other.isEmpty()) { 2738 return this; 2739 } 2740 cachedSize = -1; 2741 if (other.hasFrontLeft()) { 2742 setFrontLeft(other.frontLeft); 2743 } 2744 if (other.hasFrontRight()) { 2745 setFrontRight(other.frontRight); 2746 } 2747 if (other.hasRearLeft()) { 2748 setRearLeft(other.rearLeft); 2749 } 2750 if (other.hasRearRight()) { 2751 setRearRight(other.rearRight); 2752 } 2753 return this; 2754 } 2755 2756 @Override 2757 public ProtobufMecanumDriveWheelSpeeds clear() { 2758 if (isEmpty()) { 2759 return this; 2760 } 2761 cachedSize = -1; 2762 bitField0_ = 0; 2763 frontLeft = 0D; 2764 frontRight = 0D; 2765 rearLeft = 0D; 2766 rearRight = 0D; 2767 return this; 2768 } 2769 2770 @Override 2771 public ProtobufMecanumDriveWheelSpeeds clearQuick() { 2772 if (isEmpty()) { 2773 return this; 2774 } 2775 cachedSize = -1; 2776 bitField0_ = 0; 2777 return this; 2778 } 2779 2780 @Override 2781 public boolean equals(Object o) { 2782 if (o == this) { 2783 return true; 2784 } 2785 if (!(o instanceof ProtobufMecanumDriveWheelSpeeds)) { 2786 return false; 2787 } 2788 ProtobufMecanumDriveWheelSpeeds other = (ProtobufMecanumDriveWheelSpeeds) o; 2789 return bitField0_ == other.bitField0_ 2790 && (!hasFrontLeft() || ProtoUtil.isEqual(frontLeft, other.frontLeft)) 2791 && (!hasFrontRight() || ProtoUtil.isEqual(frontRight, other.frontRight)) 2792 && (!hasRearLeft() || ProtoUtil.isEqual(rearLeft, other.rearLeft)) 2793 && (!hasRearRight() || ProtoUtil.isEqual(rearRight, other.rearRight)); 2794 } 2795 2796 @Override 2797 public void writeTo(final ProtoSink output) throws IOException { 2798 if ((bitField0_ & 0x00000001) != 0) { 2799 output.writeRawByte((byte) 9); 2800 output.writeDoubleNoTag(frontLeft); 2801 } 2802 if ((bitField0_ & 0x00000002) != 0) { 2803 output.writeRawByte((byte) 17); 2804 output.writeDoubleNoTag(frontRight); 2805 } 2806 if ((bitField0_ & 0x00000004) != 0) { 2807 output.writeRawByte((byte) 25); 2808 output.writeDoubleNoTag(rearLeft); 2809 } 2810 if ((bitField0_ & 0x00000008) != 0) { 2811 output.writeRawByte((byte) 33); 2812 output.writeDoubleNoTag(rearRight); 2813 } 2814 } 2815 2816 @Override 2817 protected int computeSerializedSize() { 2818 int size = 0; 2819 if ((bitField0_ & 0x00000001) != 0) { 2820 size += 9; 2821 } 2822 if ((bitField0_ & 0x00000002) != 0) { 2823 size += 9; 2824 } 2825 if ((bitField0_ & 0x00000004) != 0) { 2826 size += 9; 2827 } 2828 if ((bitField0_ & 0x00000008) != 0) { 2829 size += 9; 2830 } 2831 return size; 2832 } 2833 2834 @Override 2835 @SuppressWarnings("fallthrough") 2836 public ProtobufMecanumDriveWheelSpeeds mergeFrom(final ProtoSource input) throws IOException { 2837 // Enabled Fall-Through Optimization (QuickBuffers) 2838 int tag = input.readTag(); 2839 while (true) { 2840 switch (tag) { 2841 case 9: { 2842 // frontLeft 2843 frontLeft = input.readDouble(); 2844 bitField0_ |= 0x00000001; 2845 tag = input.readTag(); 2846 if (tag != 17) { 2847 break; 2848 } 2849 } 2850 case 17: { 2851 // frontRight 2852 frontRight = input.readDouble(); 2853 bitField0_ |= 0x00000002; 2854 tag = input.readTag(); 2855 if (tag != 25) { 2856 break; 2857 } 2858 } 2859 case 25: { 2860 // rearLeft 2861 rearLeft = input.readDouble(); 2862 bitField0_ |= 0x00000004; 2863 tag = input.readTag(); 2864 if (tag != 33) { 2865 break; 2866 } 2867 } 2868 case 33: { 2869 // rearRight 2870 rearRight = input.readDouble(); 2871 bitField0_ |= 0x00000008; 2872 tag = input.readTag(); 2873 if (tag != 0) { 2874 break; 2875 } 2876 } 2877 case 0: { 2878 return this; 2879 } 2880 default: { 2881 if (!input.skipField(tag)) { 2882 return this; 2883 } 2884 tag = input.readTag(); 2885 break; 2886 } 2887 } 2888 } 2889 } 2890 2891 @Override 2892 public void writeTo(final JsonSink output) throws IOException { 2893 output.beginObject(); 2894 if ((bitField0_ & 0x00000001) != 0) { 2895 output.writeDouble(FieldNames.frontLeft, frontLeft); 2896 } 2897 if ((bitField0_ & 0x00000002) != 0) { 2898 output.writeDouble(FieldNames.frontRight, frontRight); 2899 } 2900 if ((bitField0_ & 0x00000004) != 0) { 2901 output.writeDouble(FieldNames.rearLeft, rearLeft); 2902 } 2903 if ((bitField0_ & 0x00000008) != 0) { 2904 output.writeDouble(FieldNames.rearRight, rearRight); 2905 } 2906 output.endObject(); 2907 } 2908 2909 @Override 2910 public ProtobufMecanumDriveWheelSpeeds mergeFrom(final JsonSource input) throws IOException { 2911 if (!input.beginObject()) { 2912 return this; 2913 } 2914 while (!input.isAtEnd()) { 2915 switch (input.readFieldHash()) { 2916 case 127514064: 2917 case -324277155: { 2918 if (input.isAtField(FieldNames.frontLeft)) { 2919 if (!input.trySkipNullValue()) { 2920 frontLeft = input.readDouble(); 2921 bitField0_ |= 0x00000001; 2922 } 2923 } else { 2924 input.skipUnknownField(); 2925 } 2926 break; 2927 } 2928 case -336370317: 2929 case -1456996218: { 2930 if (input.isAtField(FieldNames.frontRight)) { 2931 if (!input.trySkipNullValue()) { 2932 frontRight = input.readDouble(); 2933 bitField0_ |= 0x00000002; 2934 } 2935 } else { 2936 input.skipUnknownField(); 2937 } 2938 break; 2939 } 2940 case -854852661: 2941 case -712874558: { 2942 if (input.isAtField(FieldNames.rearLeft)) { 2943 if (!input.trySkipNullValue()) { 2944 rearLeft = input.readDouble(); 2945 bitField0_ |= 0x00000004; 2946 } 2947 } else { 2948 input.skipUnknownField(); 2949 } 2950 break; 2951 } 2952 case -724967720: 2953 case -618613823: { 2954 if (input.isAtField(FieldNames.rearRight)) { 2955 if (!input.trySkipNullValue()) { 2956 rearRight = input.readDouble(); 2957 bitField0_ |= 0x00000008; 2958 } 2959 } else { 2960 input.skipUnknownField(); 2961 } 2962 break; 2963 } 2964 default: { 2965 input.skipUnknownField(); 2966 break; 2967 } 2968 } 2969 } 2970 input.endObject(); 2971 return this; 2972 } 2973 2974 @Override 2975 public ProtobufMecanumDriveWheelSpeeds clone() { 2976 return new ProtobufMecanumDriveWheelSpeeds().copyFrom(this); 2977 } 2978 2979 @Override 2980 public boolean isEmpty() { 2981 return ((bitField0_) == 0); 2982 } 2983 2984 public static ProtobufMecanumDriveWheelSpeeds parseFrom(final byte[] data) throws 2985 InvalidProtocolBufferException { 2986 return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelSpeeds(), data).checkInitialized(); 2987 } 2988 2989 public static ProtobufMecanumDriveWheelSpeeds parseFrom(final ProtoSource input) throws 2990 IOException { 2991 return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelSpeeds(), input).checkInitialized(); 2992 } 2993 2994 public static ProtobufMecanumDriveWheelSpeeds parseFrom(final JsonSource input) throws 2995 IOException { 2996 return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelSpeeds(), input).checkInitialized(); 2997 } 2998 2999 /** 3000 * @return factory for creating ProtobufMecanumDriveWheelSpeeds messages 3001 */ 3002 public static MessageFactory<ProtobufMecanumDriveWheelSpeeds> getFactory() { 3003 return ProtobufMecanumDriveWheelSpeedsFactory.INSTANCE; 3004 } 3005 3006 /** 3007 * @return this type's descriptor. 3008 */ 3009 public static Descriptors.Descriptor getDescriptor() { 3010 return Kinematics.wpi_proto_ProtobufMecanumDriveWheelSpeeds_descriptor; 3011 } 3012 3013 private enum ProtobufMecanumDriveWheelSpeedsFactory implements MessageFactory<ProtobufMecanumDriveWheelSpeeds> { 3014 INSTANCE; 3015 3016 @Override 3017 public ProtobufMecanumDriveWheelSpeeds create() { 3018 return ProtobufMecanumDriveWheelSpeeds.newInstance(); 3019 } 3020 } 3021 3022 /** 3023 * Contains name constants used for serializing JSON 3024 */ 3025 static class FieldNames { 3026 static final FieldName frontLeft = FieldName.forField("frontLeft", "front_left"); 3027 3028 static final FieldName frontRight = FieldName.forField("frontRight", "front_right"); 3029 3030 static final FieldName rearLeft = FieldName.forField("rearLeft", "rear_left"); 3031 3032 static final FieldName rearRight = FieldName.forField("rearRight", "rear_right"); 3033 } 3034 } 3035 3036 /** 3037 * Protobuf type {@code ProtobufSwerveDriveKinematics} 3038 */ 3039 public static final class ProtobufSwerveDriveKinematics extends ProtoMessage<ProtobufSwerveDriveKinematics> implements Cloneable { 3040 private static final long serialVersionUID = 0L; 3041 3042 /** 3043 * <code>repeated .wpi.proto.ProtobufTranslation2d modules = 1;</code> 3044 */ 3045 private final RepeatedMessage<Geometry2D.ProtobufTranslation2d> modules = RepeatedMessage.newEmptyInstance(Geometry2D.ProtobufTranslation2d.getFactory()); 3046 3047 private ProtobufSwerveDriveKinematics() { 3048 } 3049 3050 /** 3051 * @return a new empty instance of {@code ProtobufSwerveDriveKinematics} 3052 */ 3053 public static ProtobufSwerveDriveKinematics newInstance() { 3054 return new ProtobufSwerveDriveKinematics(); 3055 } 3056 3057 /** 3058 * <code>repeated .wpi.proto.ProtobufTranslation2d modules = 1;</code> 3059 * @return whether the modules field is set 3060 */ 3061 public boolean hasModules() { 3062 return (bitField0_ & 0x00000001) != 0; 3063 } 3064 3065 /** 3066 * <code>repeated .wpi.proto.ProtobufTranslation2d modules = 1;</code> 3067 * @return this 3068 */ 3069 public ProtobufSwerveDriveKinematics clearModules() { 3070 bitField0_ &= ~0x00000001; 3071 modules.clear(); 3072 return this; 3073 } 3074 3075 /** 3076 * <code>repeated .wpi.proto.ProtobufTranslation2d modules = 1;</code> 3077 * 3078 * This method returns the internal storage object without modifying any has state. 3079 * The returned object should not be modified and be treated as read-only. 3080 * 3081 * Use {@link #getMutableModules()} if you want to modify it. 3082 * 3083 * @return internal storage object for reading 3084 */ 3085 public RepeatedMessage<Geometry2D.ProtobufTranslation2d> getModules() { 3086 return modules; 3087 } 3088 3089 /** 3090 * <code>repeated .wpi.proto.ProtobufTranslation2d modules = 1;</code> 3091 * 3092 * This method returns the internal storage object and sets the corresponding 3093 * has state. The returned object will become part of this message and its 3094 * contents may be modified as long as the has state is not cleared. 3095 * 3096 * @return internal storage object for modifications 3097 */ 3098 public RepeatedMessage<Geometry2D.ProtobufTranslation2d> getMutableModules() { 3099 bitField0_ |= 0x00000001; 3100 return modules; 3101 } 3102 3103 /** 3104 * <code>repeated .wpi.proto.ProtobufTranslation2d modules = 1;</code> 3105 * @param value the modules to add 3106 * @return this 3107 */ 3108 public ProtobufSwerveDriveKinematics addModules(final Geometry2D.ProtobufTranslation2d value) { 3109 bitField0_ |= 0x00000001; 3110 modules.add(value); 3111 return this; 3112 } 3113 3114 /** 3115 * <code>repeated .wpi.proto.ProtobufTranslation2d modules = 1;</code> 3116 * @param values the modules to add 3117 * @return this 3118 */ 3119 public ProtobufSwerveDriveKinematics addAllModules( 3120 final Geometry2D.ProtobufTranslation2d... values) { 3121 bitField0_ |= 0x00000001; 3122 modules.addAll(values); 3123 return this; 3124 } 3125 3126 @Override 3127 public ProtobufSwerveDriveKinematics copyFrom(final ProtobufSwerveDriveKinematics other) { 3128 cachedSize = other.cachedSize; 3129 if ((bitField0_ | other.bitField0_) != 0) { 3130 bitField0_ = other.bitField0_; 3131 modules.copyFrom(other.modules); 3132 } 3133 return this; 3134 } 3135 3136 @Override 3137 public ProtobufSwerveDriveKinematics mergeFrom(final ProtobufSwerveDriveKinematics other) { 3138 if (other.isEmpty()) { 3139 return this; 3140 } 3141 cachedSize = -1; 3142 if (other.hasModules()) { 3143 getMutableModules().addAll(other.modules); 3144 } 3145 return this; 3146 } 3147 3148 @Override 3149 public ProtobufSwerveDriveKinematics clear() { 3150 if (isEmpty()) { 3151 return this; 3152 } 3153 cachedSize = -1; 3154 bitField0_ = 0; 3155 modules.clear(); 3156 return this; 3157 } 3158 3159 @Override 3160 public ProtobufSwerveDriveKinematics clearQuick() { 3161 if (isEmpty()) { 3162 return this; 3163 } 3164 cachedSize = -1; 3165 bitField0_ = 0; 3166 modules.clearQuick(); 3167 return this; 3168 } 3169 3170 @Override 3171 public boolean equals(Object o) { 3172 if (o == this) { 3173 return true; 3174 } 3175 if (!(o instanceof ProtobufSwerveDriveKinematics)) { 3176 return false; 3177 } 3178 ProtobufSwerveDriveKinematics other = (ProtobufSwerveDriveKinematics) o; 3179 return bitField0_ == other.bitField0_ 3180 && (!hasModules() || modules.equals(other.modules)); 3181 } 3182 3183 @Override 3184 public void writeTo(final ProtoSink output) throws IOException { 3185 if ((bitField0_ & 0x00000001) != 0) { 3186 for (int i = 0; i < modules.length(); i++) { 3187 output.writeRawByte((byte) 10); 3188 output.writeMessageNoTag(modules.get(i)); 3189 } 3190 } 3191 } 3192 3193 @Override 3194 protected int computeSerializedSize() { 3195 int size = 0; 3196 if ((bitField0_ & 0x00000001) != 0) { 3197 size += (1 * modules.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(modules); 3198 } 3199 return size; 3200 } 3201 3202 @Override 3203 @SuppressWarnings("fallthrough") 3204 public ProtobufSwerveDriveKinematics mergeFrom(final ProtoSource input) throws IOException { 3205 // Enabled Fall-Through Optimization (QuickBuffers) 3206 int tag = input.readTag(); 3207 while (true) { 3208 switch (tag) { 3209 case 10: { 3210 // modules 3211 tag = input.readRepeatedMessage(modules, tag); 3212 bitField0_ |= 0x00000001; 3213 if (tag != 0) { 3214 break; 3215 } 3216 } 3217 case 0: { 3218 return this; 3219 } 3220 default: { 3221 if (!input.skipField(tag)) { 3222 return this; 3223 } 3224 tag = input.readTag(); 3225 break; 3226 } 3227 } 3228 } 3229 } 3230 3231 @Override 3232 public void writeTo(final JsonSink output) throws IOException { 3233 output.beginObject(); 3234 if ((bitField0_ & 0x00000001) != 0) { 3235 output.writeRepeatedMessage(FieldNames.modules, modules); 3236 } 3237 output.endObject(); 3238 } 3239 3240 @Override 3241 public ProtobufSwerveDriveKinematics mergeFrom(final JsonSource input) throws IOException { 3242 if (!input.beginObject()) { 3243 return this; 3244 } 3245 while (!input.isAtEnd()) { 3246 switch (input.readFieldHash()) { 3247 case 1227433863: { 3248 if (input.isAtField(FieldNames.modules)) { 3249 if (!input.trySkipNullValue()) { 3250 input.readRepeatedMessage(modules); 3251 bitField0_ |= 0x00000001; 3252 } 3253 } else { 3254 input.skipUnknownField(); 3255 } 3256 break; 3257 } 3258 default: { 3259 input.skipUnknownField(); 3260 break; 3261 } 3262 } 3263 } 3264 input.endObject(); 3265 return this; 3266 } 3267 3268 @Override 3269 public ProtobufSwerveDriveKinematics clone() { 3270 return new ProtobufSwerveDriveKinematics().copyFrom(this); 3271 } 3272 3273 @Override 3274 public boolean isEmpty() { 3275 return ((bitField0_) == 0); 3276 } 3277 3278 public static ProtobufSwerveDriveKinematics parseFrom(final byte[] data) throws 3279 InvalidProtocolBufferException { 3280 return ProtoMessage.mergeFrom(new ProtobufSwerveDriveKinematics(), data).checkInitialized(); 3281 } 3282 3283 public static ProtobufSwerveDriveKinematics parseFrom(final ProtoSource input) throws 3284 IOException { 3285 return ProtoMessage.mergeFrom(new ProtobufSwerveDriveKinematics(), input).checkInitialized(); 3286 } 3287 3288 public static ProtobufSwerveDriveKinematics parseFrom(final JsonSource input) throws 3289 IOException { 3290 return ProtoMessage.mergeFrom(new ProtobufSwerveDriveKinematics(), input).checkInitialized(); 3291 } 3292 3293 /** 3294 * @return factory for creating ProtobufSwerveDriveKinematics messages 3295 */ 3296 public static MessageFactory<ProtobufSwerveDriveKinematics> getFactory() { 3297 return ProtobufSwerveDriveKinematicsFactory.INSTANCE; 3298 } 3299 3300 /** 3301 * @return this type's descriptor. 3302 */ 3303 public static Descriptors.Descriptor getDescriptor() { 3304 return Kinematics.wpi_proto_ProtobufSwerveDriveKinematics_descriptor; 3305 } 3306 3307 private enum ProtobufSwerveDriveKinematicsFactory implements MessageFactory<ProtobufSwerveDriveKinematics> { 3308 INSTANCE; 3309 3310 @Override 3311 public ProtobufSwerveDriveKinematics create() { 3312 return ProtobufSwerveDriveKinematics.newInstance(); 3313 } 3314 } 3315 3316 /** 3317 * Contains name constants used for serializing JSON 3318 */ 3319 static class FieldNames { 3320 static final FieldName modules = FieldName.forField("modules"); 3321 } 3322 } 3323 3324 /** 3325 * Protobuf type {@code ProtobufSwerveModulePosition} 3326 */ 3327 public static final class ProtobufSwerveModulePosition extends ProtoMessage<ProtobufSwerveModulePosition> implements Cloneable { 3328 private static final long serialVersionUID = 0L; 3329 3330 /** 3331 * <code>optional double distance = 1;</code> 3332 */ 3333 private double distance; 3334 3335 /** 3336 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3337 */ 3338 private final Geometry2D.ProtobufRotation2d angle = Geometry2D.ProtobufRotation2d.newInstance(); 3339 3340 private ProtobufSwerveModulePosition() { 3341 } 3342 3343 /** 3344 * @return a new empty instance of {@code ProtobufSwerveModulePosition} 3345 */ 3346 public static ProtobufSwerveModulePosition newInstance() { 3347 return new ProtobufSwerveModulePosition(); 3348 } 3349 3350 /** 3351 * <code>optional double distance = 1;</code> 3352 * @return whether the distance field is set 3353 */ 3354 public boolean hasDistance() { 3355 return (bitField0_ & 0x00000001) != 0; 3356 } 3357 3358 /** 3359 * <code>optional double distance = 1;</code> 3360 * @return this 3361 */ 3362 public ProtobufSwerveModulePosition clearDistance() { 3363 bitField0_ &= ~0x00000001; 3364 distance = 0D; 3365 return this; 3366 } 3367 3368 /** 3369 * <code>optional double distance = 1;</code> 3370 * @return the distance 3371 */ 3372 public double getDistance() { 3373 return distance; 3374 } 3375 3376 /** 3377 * <code>optional double distance = 1;</code> 3378 * @param value the distance to set 3379 * @return this 3380 */ 3381 public ProtobufSwerveModulePosition setDistance(final double value) { 3382 bitField0_ |= 0x00000001; 3383 distance = value; 3384 return this; 3385 } 3386 3387 /** 3388 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3389 * @return whether the angle field is set 3390 */ 3391 public boolean hasAngle() { 3392 return (bitField0_ & 0x00000002) != 0; 3393 } 3394 3395 /** 3396 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3397 * @return this 3398 */ 3399 public ProtobufSwerveModulePosition clearAngle() { 3400 bitField0_ &= ~0x00000002; 3401 angle.clear(); 3402 return this; 3403 } 3404 3405 /** 3406 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3407 * 3408 * This method returns the internal storage object without modifying any has state. 3409 * The returned object should not be modified and be treated as read-only. 3410 * 3411 * Use {@link #getMutableAngle()} if you want to modify it. 3412 * 3413 * @return internal storage object for reading 3414 */ 3415 public Geometry2D.ProtobufRotation2d getAngle() { 3416 return angle; 3417 } 3418 3419 /** 3420 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3421 * 3422 * This method returns the internal storage object and sets the corresponding 3423 * has state. The returned object will become part of this message and its 3424 * contents may be modified as long as the has state is not cleared. 3425 * 3426 * @return internal storage object for modifications 3427 */ 3428 public Geometry2D.ProtobufRotation2d getMutableAngle() { 3429 bitField0_ |= 0x00000002; 3430 return angle; 3431 } 3432 3433 /** 3434 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3435 * @param value the angle to set 3436 * @return this 3437 */ 3438 public ProtobufSwerveModulePosition setAngle(final Geometry2D.ProtobufRotation2d value) { 3439 bitField0_ |= 0x00000002; 3440 angle.copyFrom(value); 3441 return this; 3442 } 3443 3444 @Override 3445 public ProtobufSwerveModulePosition copyFrom(final ProtobufSwerveModulePosition other) { 3446 cachedSize = other.cachedSize; 3447 if ((bitField0_ | other.bitField0_) != 0) { 3448 bitField0_ = other.bitField0_; 3449 distance = other.distance; 3450 angle.copyFrom(other.angle); 3451 } 3452 return this; 3453 } 3454 3455 @Override 3456 public ProtobufSwerveModulePosition mergeFrom(final ProtobufSwerveModulePosition other) { 3457 if (other.isEmpty()) { 3458 return this; 3459 } 3460 cachedSize = -1; 3461 if (other.hasDistance()) { 3462 setDistance(other.distance); 3463 } 3464 if (other.hasAngle()) { 3465 getMutableAngle().mergeFrom(other.angle); 3466 } 3467 return this; 3468 } 3469 3470 @Override 3471 public ProtobufSwerveModulePosition clear() { 3472 if (isEmpty()) { 3473 return this; 3474 } 3475 cachedSize = -1; 3476 bitField0_ = 0; 3477 distance = 0D; 3478 angle.clear(); 3479 return this; 3480 } 3481 3482 @Override 3483 public ProtobufSwerveModulePosition clearQuick() { 3484 if (isEmpty()) { 3485 return this; 3486 } 3487 cachedSize = -1; 3488 bitField0_ = 0; 3489 angle.clearQuick(); 3490 return this; 3491 } 3492 3493 @Override 3494 public boolean equals(Object o) { 3495 if (o == this) { 3496 return true; 3497 } 3498 if (!(o instanceof ProtobufSwerveModulePosition)) { 3499 return false; 3500 } 3501 ProtobufSwerveModulePosition other = (ProtobufSwerveModulePosition) o; 3502 return bitField0_ == other.bitField0_ 3503 && (!hasDistance() || ProtoUtil.isEqual(distance, other.distance)) 3504 && (!hasAngle() || angle.equals(other.angle)); 3505 } 3506 3507 @Override 3508 public void writeTo(final ProtoSink output) throws IOException { 3509 if ((bitField0_ & 0x00000001) != 0) { 3510 output.writeRawByte((byte) 9); 3511 output.writeDoubleNoTag(distance); 3512 } 3513 if ((bitField0_ & 0x00000002) != 0) { 3514 output.writeRawByte((byte) 18); 3515 output.writeMessageNoTag(angle); 3516 } 3517 } 3518 3519 @Override 3520 protected int computeSerializedSize() { 3521 int size = 0; 3522 if ((bitField0_ & 0x00000001) != 0) { 3523 size += 9; 3524 } 3525 if ((bitField0_ & 0x00000002) != 0) { 3526 size += 1 + ProtoSink.computeMessageSizeNoTag(angle); 3527 } 3528 return size; 3529 } 3530 3531 @Override 3532 @SuppressWarnings("fallthrough") 3533 public ProtobufSwerveModulePosition mergeFrom(final ProtoSource input) throws IOException { 3534 // Enabled Fall-Through Optimization (QuickBuffers) 3535 int tag = input.readTag(); 3536 while (true) { 3537 switch (tag) { 3538 case 9: { 3539 // distance 3540 distance = input.readDouble(); 3541 bitField0_ |= 0x00000001; 3542 tag = input.readTag(); 3543 if (tag != 18) { 3544 break; 3545 } 3546 } 3547 case 18: { 3548 // angle 3549 input.readMessage(angle); 3550 bitField0_ |= 0x00000002; 3551 tag = input.readTag(); 3552 if (tag != 0) { 3553 break; 3554 } 3555 } 3556 case 0: { 3557 return this; 3558 } 3559 default: { 3560 if (!input.skipField(tag)) { 3561 return this; 3562 } 3563 tag = input.readTag(); 3564 break; 3565 } 3566 } 3567 } 3568 } 3569 3570 @Override 3571 public void writeTo(final JsonSink output) throws IOException { 3572 output.beginObject(); 3573 if ((bitField0_ & 0x00000001) != 0) { 3574 output.writeDouble(FieldNames.distance, distance); 3575 } 3576 if ((bitField0_ & 0x00000002) != 0) { 3577 output.writeMessage(FieldNames.angle, angle); 3578 } 3579 output.endObject(); 3580 } 3581 3582 @Override 3583 public ProtobufSwerveModulePosition mergeFrom(final JsonSource input) throws IOException { 3584 if (!input.beginObject()) { 3585 return this; 3586 } 3587 while (!input.isAtEnd()) { 3588 switch (input.readFieldHash()) { 3589 case 288459765: { 3590 if (input.isAtField(FieldNames.distance)) { 3591 if (!input.trySkipNullValue()) { 3592 distance = input.readDouble(); 3593 bitField0_ |= 0x00000001; 3594 } 3595 } else { 3596 input.skipUnknownField(); 3597 } 3598 break; 3599 } 3600 case 92960979: { 3601 if (input.isAtField(FieldNames.angle)) { 3602 if (!input.trySkipNullValue()) { 3603 input.readMessage(angle); 3604 bitField0_ |= 0x00000002; 3605 } 3606 } else { 3607 input.skipUnknownField(); 3608 } 3609 break; 3610 } 3611 default: { 3612 input.skipUnknownField(); 3613 break; 3614 } 3615 } 3616 } 3617 input.endObject(); 3618 return this; 3619 } 3620 3621 @Override 3622 public ProtobufSwerveModulePosition clone() { 3623 return new ProtobufSwerveModulePosition().copyFrom(this); 3624 } 3625 3626 @Override 3627 public boolean isEmpty() { 3628 return ((bitField0_) == 0); 3629 } 3630 3631 public static ProtobufSwerveModulePosition parseFrom(final byte[] data) throws 3632 InvalidProtocolBufferException { 3633 return ProtoMessage.mergeFrom(new ProtobufSwerveModulePosition(), data).checkInitialized(); 3634 } 3635 3636 public static ProtobufSwerveModulePosition parseFrom(final ProtoSource input) throws 3637 IOException { 3638 return ProtoMessage.mergeFrom(new ProtobufSwerveModulePosition(), input).checkInitialized(); 3639 } 3640 3641 public static ProtobufSwerveModulePosition parseFrom(final JsonSource input) throws 3642 IOException { 3643 return ProtoMessage.mergeFrom(new ProtobufSwerveModulePosition(), input).checkInitialized(); 3644 } 3645 3646 /** 3647 * @return factory for creating ProtobufSwerveModulePosition messages 3648 */ 3649 public static MessageFactory<ProtobufSwerveModulePosition> getFactory() { 3650 return ProtobufSwerveModulePositionFactory.INSTANCE; 3651 } 3652 3653 /** 3654 * @return this type's descriptor. 3655 */ 3656 public static Descriptors.Descriptor getDescriptor() { 3657 return Kinematics.wpi_proto_ProtobufSwerveModulePosition_descriptor; 3658 } 3659 3660 private enum ProtobufSwerveModulePositionFactory implements MessageFactory<ProtobufSwerveModulePosition> { 3661 INSTANCE; 3662 3663 @Override 3664 public ProtobufSwerveModulePosition create() { 3665 return ProtobufSwerveModulePosition.newInstance(); 3666 } 3667 } 3668 3669 /** 3670 * Contains name constants used for serializing JSON 3671 */ 3672 static class FieldNames { 3673 static final FieldName distance = FieldName.forField("distance"); 3674 3675 static final FieldName angle = FieldName.forField("angle"); 3676 } 3677 } 3678 3679 /** 3680 * Protobuf type {@code ProtobufSwerveModuleState} 3681 */ 3682 public static final class ProtobufSwerveModuleState extends ProtoMessage<ProtobufSwerveModuleState> implements Cloneable { 3683 private static final long serialVersionUID = 0L; 3684 3685 /** 3686 * <code>optional double speed = 1;</code> 3687 */ 3688 private double speed; 3689 3690 /** 3691 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3692 */ 3693 private final Geometry2D.ProtobufRotation2d angle = Geometry2D.ProtobufRotation2d.newInstance(); 3694 3695 private ProtobufSwerveModuleState() { 3696 } 3697 3698 /** 3699 * @return a new empty instance of {@code ProtobufSwerveModuleState} 3700 */ 3701 public static ProtobufSwerveModuleState newInstance() { 3702 return new ProtobufSwerveModuleState(); 3703 } 3704 3705 /** 3706 * <code>optional double speed = 1;</code> 3707 * @return whether the speed field is set 3708 */ 3709 public boolean hasSpeed() { 3710 return (bitField0_ & 0x00000001) != 0; 3711 } 3712 3713 /** 3714 * <code>optional double speed = 1;</code> 3715 * @return this 3716 */ 3717 public ProtobufSwerveModuleState clearSpeed() { 3718 bitField0_ &= ~0x00000001; 3719 speed = 0D; 3720 return this; 3721 } 3722 3723 /** 3724 * <code>optional double speed = 1;</code> 3725 * @return the speed 3726 */ 3727 public double getSpeed() { 3728 return speed; 3729 } 3730 3731 /** 3732 * <code>optional double speed = 1;</code> 3733 * @param value the speed to set 3734 * @return this 3735 */ 3736 public ProtobufSwerveModuleState setSpeed(final double value) { 3737 bitField0_ |= 0x00000001; 3738 speed = value; 3739 return this; 3740 } 3741 3742 /** 3743 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3744 * @return whether the angle field is set 3745 */ 3746 public boolean hasAngle() { 3747 return (bitField0_ & 0x00000002) != 0; 3748 } 3749 3750 /** 3751 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3752 * @return this 3753 */ 3754 public ProtobufSwerveModuleState clearAngle() { 3755 bitField0_ &= ~0x00000002; 3756 angle.clear(); 3757 return this; 3758 } 3759 3760 /** 3761 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3762 * 3763 * This method returns the internal storage object without modifying any has state. 3764 * The returned object should not be modified and be treated as read-only. 3765 * 3766 * Use {@link #getMutableAngle()} if you want to modify it. 3767 * 3768 * @return internal storage object for reading 3769 */ 3770 public Geometry2D.ProtobufRotation2d getAngle() { 3771 return angle; 3772 } 3773 3774 /** 3775 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3776 * 3777 * This method returns the internal storage object and sets the corresponding 3778 * has state. The returned object will become part of this message and its 3779 * contents may be modified as long as the has state is not cleared. 3780 * 3781 * @return internal storage object for modifications 3782 */ 3783 public Geometry2D.ProtobufRotation2d getMutableAngle() { 3784 bitField0_ |= 0x00000002; 3785 return angle; 3786 } 3787 3788 /** 3789 * <code>optional .wpi.proto.ProtobufRotation2d angle = 2;</code> 3790 * @param value the angle to set 3791 * @return this 3792 */ 3793 public ProtobufSwerveModuleState setAngle(final Geometry2D.ProtobufRotation2d value) { 3794 bitField0_ |= 0x00000002; 3795 angle.copyFrom(value); 3796 return this; 3797 } 3798 3799 @Override 3800 public ProtobufSwerveModuleState copyFrom(final ProtobufSwerveModuleState other) { 3801 cachedSize = other.cachedSize; 3802 if ((bitField0_ | other.bitField0_) != 0) { 3803 bitField0_ = other.bitField0_; 3804 speed = other.speed; 3805 angle.copyFrom(other.angle); 3806 } 3807 return this; 3808 } 3809 3810 @Override 3811 public ProtobufSwerveModuleState mergeFrom(final ProtobufSwerveModuleState other) { 3812 if (other.isEmpty()) { 3813 return this; 3814 } 3815 cachedSize = -1; 3816 if (other.hasSpeed()) { 3817 setSpeed(other.speed); 3818 } 3819 if (other.hasAngle()) { 3820 getMutableAngle().mergeFrom(other.angle); 3821 } 3822 return this; 3823 } 3824 3825 @Override 3826 public ProtobufSwerveModuleState clear() { 3827 if (isEmpty()) { 3828 return this; 3829 } 3830 cachedSize = -1; 3831 bitField0_ = 0; 3832 speed = 0D; 3833 angle.clear(); 3834 return this; 3835 } 3836 3837 @Override 3838 public ProtobufSwerveModuleState clearQuick() { 3839 if (isEmpty()) { 3840 return this; 3841 } 3842 cachedSize = -1; 3843 bitField0_ = 0; 3844 angle.clearQuick(); 3845 return this; 3846 } 3847 3848 @Override 3849 public boolean equals(Object o) { 3850 if (o == this) { 3851 return true; 3852 } 3853 if (!(o instanceof ProtobufSwerveModuleState)) { 3854 return false; 3855 } 3856 ProtobufSwerveModuleState other = (ProtobufSwerveModuleState) o; 3857 return bitField0_ == other.bitField0_ 3858 && (!hasSpeed() || ProtoUtil.isEqual(speed, other.speed)) 3859 && (!hasAngle() || angle.equals(other.angle)); 3860 } 3861 3862 @Override 3863 public void writeTo(final ProtoSink output) throws IOException { 3864 if ((bitField0_ & 0x00000001) != 0) { 3865 output.writeRawByte((byte) 9); 3866 output.writeDoubleNoTag(speed); 3867 } 3868 if ((bitField0_ & 0x00000002) != 0) { 3869 output.writeRawByte((byte) 18); 3870 output.writeMessageNoTag(angle); 3871 } 3872 } 3873 3874 @Override 3875 protected int computeSerializedSize() { 3876 int size = 0; 3877 if ((bitField0_ & 0x00000001) != 0) { 3878 size += 9; 3879 } 3880 if ((bitField0_ & 0x00000002) != 0) { 3881 size += 1 + ProtoSink.computeMessageSizeNoTag(angle); 3882 } 3883 return size; 3884 } 3885 3886 @Override 3887 @SuppressWarnings("fallthrough") 3888 public ProtobufSwerveModuleState mergeFrom(final ProtoSource input) throws IOException { 3889 // Enabled Fall-Through Optimization (QuickBuffers) 3890 int tag = input.readTag(); 3891 while (true) { 3892 switch (tag) { 3893 case 9: { 3894 // speed 3895 speed = input.readDouble(); 3896 bitField0_ |= 0x00000001; 3897 tag = input.readTag(); 3898 if (tag != 18) { 3899 break; 3900 } 3901 } 3902 case 18: { 3903 // angle 3904 input.readMessage(angle); 3905 bitField0_ |= 0x00000002; 3906 tag = input.readTag(); 3907 if (tag != 0) { 3908 break; 3909 } 3910 } 3911 case 0: { 3912 return this; 3913 } 3914 default: { 3915 if (!input.skipField(tag)) { 3916 return this; 3917 } 3918 tag = input.readTag(); 3919 break; 3920 } 3921 } 3922 } 3923 } 3924 3925 @Override 3926 public void writeTo(final JsonSink output) throws IOException { 3927 output.beginObject(); 3928 if ((bitField0_ & 0x00000001) != 0) { 3929 output.writeDouble(FieldNames.speed, speed); 3930 } 3931 if ((bitField0_ & 0x00000002) != 0) { 3932 output.writeMessage(FieldNames.angle, angle); 3933 } 3934 output.endObject(); 3935 } 3936 3937 @Override 3938 public ProtobufSwerveModuleState mergeFrom(final JsonSource input) throws IOException { 3939 if (!input.beginObject()) { 3940 return this; 3941 } 3942 while (!input.isAtEnd()) { 3943 switch (input.readFieldHash()) { 3944 case 109641799: { 3945 if (input.isAtField(FieldNames.speed)) { 3946 if (!input.trySkipNullValue()) { 3947 speed = input.readDouble(); 3948 bitField0_ |= 0x00000001; 3949 } 3950 } else { 3951 input.skipUnknownField(); 3952 } 3953 break; 3954 } 3955 case 92960979: { 3956 if (input.isAtField(FieldNames.angle)) { 3957 if (!input.trySkipNullValue()) { 3958 input.readMessage(angle); 3959 bitField0_ |= 0x00000002; 3960 } 3961 } else { 3962 input.skipUnknownField(); 3963 } 3964 break; 3965 } 3966 default: { 3967 input.skipUnknownField(); 3968 break; 3969 } 3970 } 3971 } 3972 input.endObject(); 3973 return this; 3974 } 3975 3976 @Override 3977 public ProtobufSwerveModuleState clone() { 3978 return new ProtobufSwerveModuleState().copyFrom(this); 3979 } 3980 3981 @Override 3982 public boolean isEmpty() { 3983 return ((bitField0_) == 0); 3984 } 3985 3986 public static ProtobufSwerveModuleState parseFrom(final byte[] data) throws 3987 InvalidProtocolBufferException { 3988 return ProtoMessage.mergeFrom(new ProtobufSwerveModuleState(), data).checkInitialized(); 3989 } 3990 3991 public static ProtobufSwerveModuleState parseFrom(final ProtoSource input) throws IOException { 3992 return ProtoMessage.mergeFrom(new ProtobufSwerveModuleState(), input).checkInitialized(); 3993 } 3994 3995 public static ProtobufSwerveModuleState parseFrom(final JsonSource input) throws IOException { 3996 return ProtoMessage.mergeFrom(new ProtobufSwerveModuleState(), input).checkInitialized(); 3997 } 3998 3999 /** 4000 * @return factory for creating ProtobufSwerveModuleState messages 4001 */ 4002 public static MessageFactory<ProtobufSwerveModuleState> getFactory() { 4003 return ProtobufSwerveModuleStateFactory.INSTANCE; 4004 } 4005 4006 /** 4007 * @return this type's descriptor. 4008 */ 4009 public static Descriptors.Descriptor getDescriptor() { 4010 return Kinematics.wpi_proto_ProtobufSwerveModuleState_descriptor; 4011 } 4012 4013 private enum ProtobufSwerveModuleStateFactory implements MessageFactory<ProtobufSwerveModuleState> { 4014 INSTANCE; 4015 4016 @Override 4017 public ProtobufSwerveModuleState create() { 4018 return ProtobufSwerveModuleState.newInstance(); 4019 } 4020 } 4021 4022 /** 4023 * Contains name constants used for serializing JSON 4024 */ 4025 static class FieldNames { 4026 static final FieldName speed = FieldName.forField("speed"); 4027 4028 static final FieldName angle = FieldName.forField("angle"); 4029 } 4030 } 4031}