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