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; 019 020public final class Controller { 021 private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(1684, 022 "ChBjb250cm9sbGVyLnByb3RvEgl3cGkucHJvdG8iWAoWUHJvdG9idWZBcm1GZWVkZm9yd2FyZBIOCgJr" + 023 "cxgBIAEoAVICa3MSDgoCa2cYAiABKAFSAmtnEg4KAmt2GAMgASgBUgJrdhIOCgJrYRgEIAEoAVICa2Ei" + 024 "ngEKJFByb3RvYnVmRGlmZmVyZW50aWFsRHJpdmVGZWVkZm9yd2FyZBIbCglrdl9saW5lYXIYASABKAFS" + 025 "CGt2TGluZWFyEhsKCWthX2xpbmVhchgCIAEoAVIIa2FMaW5lYXISHQoKa3ZfYW5ndWxhchgDIAEoAVIJ" + 026 "a3ZBbmd1bGFyEh0KCmthX2FuZ3VsYXIYBCABKAFSCWthQW5ndWxhciJdChtQcm90b2J1ZkVsZXZhdG9y" + 027 "RmVlZGZvcndhcmQSDgoCa3MYASABKAFSAmtzEg4KAmtnGAIgASgBUgJrZxIOCgJrdhgDIAEoAVICa3YS" + 028 "DgoCa2EYBCABKAFSAmthIlAKHlByb3RvYnVmU2ltcGxlTW90b3JGZWVkZm9yd2FyZBIOCgJrcxgBIAEo" + 029 "AVICa3MSDgoCa3YYAiABKAFSAmt2Eg4KAmthGAMgASgBUgJrYSJSCiZQcm90b2J1ZkRpZmZlcmVudGlh" + 030 "bERyaXZlV2hlZWxWb2x0YWdlcxISCgRsZWZ0GAEgASgBUgRsZWZ0EhQKBXJpZ2h0GAIgASgBUgVyaWdo" + 031 "dEIaChhlZHUud3BpLmZpcnN0Lm1hdGgucHJvdG9K0AgKBhIEAAAkAQoICgEMEgMAABIKCAoBAhIDAgAS" + 032 "CggKAQgSAwQAMQoJCgIIARIDBAAxCgoKAgQAEgQGAAsBCgoKAwQAARIDBggeCgsKBAQAAgASAwcCEAoM" + 033 "CgUEAAIABRIDBwIICgwKBQQAAgABEgMHCQsKDAoFBAACAAMSAwcODwoLCgQEAAIBEgMIAhAKDAoFBAAC" + 034 "AQUSAwgCCAoMCgUEAAIBARIDCAkLCgwKBQQAAgEDEgMIDg8KCwoEBAACAhIDCQIQCgwKBQQAAgIFEgMJ" + 035 "AggKDAoFBAACAgESAwkJCwoMCgUEAAICAxIDCQ4PCgsKBAQAAgMSAwoCEAoMCgUEAAIDBRIDCgIICgwK" + 036 "BQQAAgMBEgMKCQsKDAoFBAACAwMSAwoODwoKCgIEARIEDQASAQoKCgMEAQESAw0ILAoLCgQEAQIAEgMO" + 037 "AhcKDAoFBAECAAUSAw4CCAoMCgUEAQIAARIDDgkSCgwKBQQBAgADEgMOFRYKCwoEBAECARIDDwIXCgwK" + 038 "BQQBAgEFEgMPAggKDAoFBAECAQESAw8JEgoMCgUEAQIBAxIDDxUWCgsKBAQBAgISAxACGAoMCgUEAQIC" + 039 "BRIDEAIICgwKBQQBAgIBEgMQCRMKDAoFBAECAgMSAxAWFwoLCgQEAQIDEgMRAhgKDAoFBAECAwUSAxEC" + 040 "CAoMCgUEAQIDARIDEQkTCgwKBQQBAgMDEgMRFhcKCgoCBAISBBQAGQEKCgoDBAIBEgMUCCMKCwoEBAIC" + 041 "ABIDFQIQCgwKBQQCAgAFEgMVAggKDAoFBAICAAESAxUJCwoMCgUEAgIAAxIDFQ4PCgsKBAQCAgESAxYC", 042 "EAoMCgUEAgIBBRIDFgIICgwKBQQCAgEBEgMWCQsKDAoFBAICAQMSAxYODwoLCgQEAgICEgMXAhAKDAoF" + 043 "BAICAgUSAxcCCAoMCgUEAgICARIDFwkLCgwKBQQCAgIDEgMXDg8KCwoEBAICAxIDGAIQCgwKBQQCAgMF" + 044 "EgMYAggKDAoFBAICAwESAxgJCwoMCgUEAgIDAxIDGA4PCgoKAgQDEgQbAB8BCgoKAwQDARIDGwgmCgsK" + 045 "BAQDAgASAxwCEAoMCgUEAwIABRIDHAIICgwKBQQDAgABEgMcCQsKDAoFBAMCAAMSAxwODwoLCgQEAwIB" + 046 "EgMdAhAKDAoFBAMCAQUSAx0CCAoMCgUEAwIBARIDHQkLCgwKBQQDAgEDEgMdDg8KCwoEBAMCAhIDHgIQ" + 047 "CgwKBQQDAgIFEgMeAggKDAoFBAMCAgESAx4JCwoMCgUEAwICAxIDHg4PCgoKAgQEEgQhACQBCgoKAwQE" + 048 "ARIDIQguCgsKBAQEAgASAyICEgoMCgUEBAIABRIDIgIICgwKBQQEAgABEgMiCQ0KDAoFBAQCAAMSAyIQ" + 049 "EQoLCgQEBAIBEgMjAhMKDAoFBAQCAQUSAyMCCAoMCgUEBAIBARIDIwkOCgwKBQQEAgEDEgMjERJiBnBy" + 050 "b3RvMw=="); 051 052 static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("controller.proto", "wpi.proto", descriptorData); 053 054 static final Descriptors.Descriptor wpi_proto_ProtobufArmFeedforward_descriptor = descriptor.internalContainedType(31, 88, "ProtobufArmFeedforward", "wpi.proto.ProtobufArmFeedforward"); 055 056 static final Descriptors.Descriptor wpi_proto_ProtobufDifferentialDriveFeedforward_descriptor = descriptor.internalContainedType(122, 158, "ProtobufDifferentialDriveFeedforward", "wpi.proto.ProtobufDifferentialDriveFeedforward"); 057 058 static final Descriptors.Descriptor wpi_proto_ProtobufElevatorFeedforward_descriptor = descriptor.internalContainedType(282, 93, "ProtobufElevatorFeedforward", "wpi.proto.ProtobufElevatorFeedforward"); 059 060 static final Descriptors.Descriptor wpi_proto_ProtobufSimpleMotorFeedforward_descriptor = descriptor.internalContainedType(377, 80, "ProtobufSimpleMotorFeedforward", "wpi.proto.ProtobufSimpleMotorFeedforward"); 061 062 static final Descriptors.Descriptor wpi_proto_ProtobufDifferentialDriveWheelVoltages_descriptor = descriptor.internalContainedType(459, 82, "ProtobufDifferentialDriveWheelVoltages", "wpi.proto.ProtobufDifferentialDriveWheelVoltages"); 063 064 /** 065 * @return this proto file's descriptor. 066 */ 067 public static Descriptors.FileDescriptor getDescriptor() { 068 return descriptor; 069 } 070 071 /** 072 * Protobuf type {@code ProtobufArmFeedforward} 073 */ 074 public static final class ProtobufArmFeedforward extends ProtoMessage<ProtobufArmFeedforward> implements Cloneable { 075 private static final long serialVersionUID = 0L; 076 077 /** 078 * <code>optional double ks = 1;</code> 079 */ 080 private double ks; 081 082 /** 083 * <code>optional double kg = 2;</code> 084 */ 085 private double kg; 086 087 /** 088 * <code>optional double kv = 3;</code> 089 */ 090 private double kv; 091 092 /** 093 * <code>optional double ka = 4;</code> 094 */ 095 private double ka; 096 097 private ProtobufArmFeedforward() { 098 } 099 100 /** 101 * @return a new empty instance of {@code ProtobufArmFeedforward} 102 */ 103 public static ProtobufArmFeedforward newInstance() { 104 return new ProtobufArmFeedforward(); 105 } 106 107 /** 108 * <code>optional double ks = 1;</code> 109 * @return whether the ks field is set 110 */ 111 public boolean hasKs() { 112 return (bitField0_ & 0x00000001) != 0; 113 } 114 115 /** 116 * <code>optional double ks = 1;</code> 117 * @return this 118 */ 119 public ProtobufArmFeedforward clearKs() { 120 bitField0_ &= ~0x00000001; 121 ks = 0D; 122 return this; 123 } 124 125 /** 126 * <code>optional double ks = 1;</code> 127 * @return the ks 128 */ 129 public double getKs() { 130 return ks; 131 } 132 133 /** 134 * <code>optional double ks = 1;</code> 135 * @param value the ks to set 136 * @return this 137 */ 138 public ProtobufArmFeedforward setKs(final double value) { 139 bitField0_ |= 0x00000001; 140 ks = value; 141 return this; 142 } 143 144 /** 145 * <code>optional double kg = 2;</code> 146 * @return whether the kg field is set 147 */ 148 public boolean hasKg() { 149 return (bitField0_ & 0x00000002) != 0; 150 } 151 152 /** 153 * <code>optional double kg = 2;</code> 154 * @return this 155 */ 156 public ProtobufArmFeedforward clearKg() { 157 bitField0_ &= ~0x00000002; 158 kg = 0D; 159 return this; 160 } 161 162 /** 163 * <code>optional double kg = 2;</code> 164 * @return the kg 165 */ 166 public double getKg() { 167 return kg; 168 } 169 170 /** 171 * <code>optional double kg = 2;</code> 172 * @param value the kg to set 173 * @return this 174 */ 175 public ProtobufArmFeedforward setKg(final double value) { 176 bitField0_ |= 0x00000002; 177 kg = value; 178 return this; 179 } 180 181 /** 182 * <code>optional double kv = 3;</code> 183 * @return whether the kv field is set 184 */ 185 public boolean hasKv() { 186 return (bitField0_ & 0x00000004) != 0; 187 } 188 189 /** 190 * <code>optional double kv = 3;</code> 191 * @return this 192 */ 193 public ProtobufArmFeedforward clearKv() { 194 bitField0_ &= ~0x00000004; 195 kv = 0D; 196 return this; 197 } 198 199 /** 200 * <code>optional double kv = 3;</code> 201 * @return the kv 202 */ 203 public double getKv() { 204 return kv; 205 } 206 207 /** 208 * <code>optional double kv = 3;</code> 209 * @param value the kv to set 210 * @return this 211 */ 212 public ProtobufArmFeedforward setKv(final double value) { 213 bitField0_ |= 0x00000004; 214 kv = value; 215 return this; 216 } 217 218 /** 219 * <code>optional double ka = 4;</code> 220 * @return whether the ka field is set 221 */ 222 public boolean hasKa() { 223 return (bitField0_ & 0x00000008) != 0; 224 } 225 226 /** 227 * <code>optional double ka = 4;</code> 228 * @return this 229 */ 230 public ProtobufArmFeedforward clearKa() { 231 bitField0_ &= ~0x00000008; 232 ka = 0D; 233 return this; 234 } 235 236 /** 237 * <code>optional double ka = 4;</code> 238 * @return the ka 239 */ 240 public double getKa() { 241 return ka; 242 } 243 244 /** 245 * <code>optional double ka = 4;</code> 246 * @param value the ka to set 247 * @return this 248 */ 249 public ProtobufArmFeedforward setKa(final double value) { 250 bitField0_ |= 0x00000008; 251 ka = value; 252 return this; 253 } 254 255 @Override 256 public ProtobufArmFeedforward copyFrom(final ProtobufArmFeedforward other) { 257 cachedSize = other.cachedSize; 258 if ((bitField0_ | other.bitField0_) != 0) { 259 bitField0_ = other.bitField0_; 260 ks = other.ks; 261 kg = other.kg; 262 kv = other.kv; 263 ka = other.ka; 264 } 265 return this; 266 } 267 268 @Override 269 public ProtobufArmFeedforward mergeFrom(final ProtobufArmFeedforward other) { 270 if (other.isEmpty()) { 271 return this; 272 } 273 cachedSize = -1; 274 if (other.hasKs()) { 275 setKs(other.ks); 276 } 277 if (other.hasKg()) { 278 setKg(other.kg); 279 } 280 if (other.hasKv()) { 281 setKv(other.kv); 282 } 283 if (other.hasKa()) { 284 setKa(other.ka); 285 } 286 return this; 287 } 288 289 @Override 290 public ProtobufArmFeedforward clear() { 291 if (isEmpty()) { 292 return this; 293 } 294 cachedSize = -1; 295 bitField0_ = 0; 296 ks = 0D; 297 kg = 0D; 298 kv = 0D; 299 ka = 0D; 300 return this; 301 } 302 303 @Override 304 public ProtobufArmFeedforward clearQuick() { 305 if (isEmpty()) { 306 return this; 307 } 308 cachedSize = -1; 309 bitField0_ = 0; 310 return this; 311 } 312 313 @Override 314 public boolean equals(Object o) { 315 if (o == this) { 316 return true; 317 } 318 if (!(o instanceof ProtobufArmFeedforward)) { 319 return false; 320 } 321 ProtobufArmFeedforward other = (ProtobufArmFeedforward) o; 322 return bitField0_ == other.bitField0_ 323 && (!hasKs() || ProtoUtil.isEqual(ks, other.ks)) 324 && (!hasKg() || ProtoUtil.isEqual(kg, other.kg)) 325 && (!hasKv() || ProtoUtil.isEqual(kv, other.kv)) 326 && (!hasKa() || ProtoUtil.isEqual(ka, other.ka)); 327 } 328 329 @Override 330 public void writeTo(final ProtoSink output) throws IOException { 331 if ((bitField0_ & 0x00000001) != 0) { 332 output.writeRawByte((byte) 9); 333 output.writeDoubleNoTag(ks); 334 } 335 if ((bitField0_ & 0x00000002) != 0) { 336 output.writeRawByte((byte) 17); 337 output.writeDoubleNoTag(kg); 338 } 339 if ((bitField0_ & 0x00000004) != 0) { 340 output.writeRawByte((byte) 25); 341 output.writeDoubleNoTag(kv); 342 } 343 if ((bitField0_ & 0x00000008) != 0) { 344 output.writeRawByte((byte) 33); 345 output.writeDoubleNoTag(ka); 346 } 347 } 348 349 @Override 350 protected int computeSerializedSize() { 351 int size = 0; 352 if ((bitField0_ & 0x00000001) != 0) { 353 size += 9; 354 } 355 if ((bitField0_ & 0x00000002) != 0) { 356 size += 9; 357 } 358 if ((bitField0_ & 0x00000004) != 0) { 359 size += 9; 360 } 361 if ((bitField0_ & 0x00000008) != 0) { 362 size += 9; 363 } 364 return size; 365 } 366 367 @Override 368 @SuppressWarnings("fallthrough") 369 public ProtobufArmFeedforward mergeFrom(final ProtoSource input) throws IOException { 370 // Enabled Fall-Through Optimization (QuickBuffers) 371 int tag = input.readTag(); 372 while (true) { 373 switch (tag) { 374 case 9: { 375 // ks 376 ks = input.readDouble(); 377 bitField0_ |= 0x00000001; 378 tag = input.readTag(); 379 if (tag != 17) { 380 break; 381 } 382 } 383 case 17: { 384 // kg 385 kg = input.readDouble(); 386 bitField0_ |= 0x00000002; 387 tag = input.readTag(); 388 if (tag != 25) { 389 break; 390 } 391 } 392 case 25: { 393 // kv 394 kv = input.readDouble(); 395 bitField0_ |= 0x00000004; 396 tag = input.readTag(); 397 if (tag != 33) { 398 break; 399 } 400 } 401 case 33: { 402 // ka 403 ka = input.readDouble(); 404 bitField0_ |= 0x00000008; 405 tag = input.readTag(); 406 if (tag != 0) { 407 break; 408 } 409 } 410 case 0: { 411 return this; 412 } 413 default: { 414 if (!input.skipField(tag)) { 415 return this; 416 } 417 tag = input.readTag(); 418 break; 419 } 420 } 421 } 422 } 423 424 @Override 425 public void writeTo(final JsonSink output) throws IOException { 426 output.beginObject(); 427 if ((bitField0_ & 0x00000001) != 0) { 428 output.writeDouble(FieldNames.ks, ks); 429 } 430 if ((bitField0_ & 0x00000002) != 0) { 431 output.writeDouble(FieldNames.kg, kg); 432 } 433 if ((bitField0_ & 0x00000004) != 0) { 434 output.writeDouble(FieldNames.kv, kv); 435 } 436 if ((bitField0_ & 0x00000008) != 0) { 437 output.writeDouble(FieldNames.ka, ka); 438 } 439 output.endObject(); 440 } 441 442 @Override 443 public ProtobufArmFeedforward mergeFrom(final JsonSource input) throws IOException { 444 if (!input.beginObject()) { 445 return this; 446 } 447 while (!input.isAtEnd()) { 448 switch (input.readFieldHash()) { 449 case 3432: { 450 if (input.isAtField(FieldNames.ks)) { 451 if (!input.trySkipNullValue()) { 452 ks = input.readDouble(); 453 bitField0_ |= 0x00000001; 454 } 455 } else { 456 input.skipUnknownField(); 457 } 458 break; 459 } 460 case 3420: { 461 if (input.isAtField(FieldNames.kg)) { 462 if (!input.trySkipNullValue()) { 463 kg = input.readDouble(); 464 bitField0_ |= 0x00000002; 465 } 466 } else { 467 input.skipUnknownField(); 468 } 469 break; 470 } 471 case 3435: { 472 if (input.isAtField(FieldNames.kv)) { 473 if (!input.trySkipNullValue()) { 474 kv = input.readDouble(); 475 bitField0_ |= 0x00000004; 476 } 477 } else { 478 input.skipUnknownField(); 479 } 480 break; 481 } 482 case 3414: { 483 if (input.isAtField(FieldNames.ka)) { 484 if (!input.trySkipNullValue()) { 485 ka = input.readDouble(); 486 bitField0_ |= 0x00000008; 487 } 488 } else { 489 input.skipUnknownField(); 490 } 491 break; 492 } 493 default: { 494 input.skipUnknownField(); 495 break; 496 } 497 } 498 } 499 input.endObject(); 500 return this; 501 } 502 503 @Override 504 public ProtobufArmFeedforward clone() { 505 return new ProtobufArmFeedforward().copyFrom(this); 506 } 507 508 @Override 509 public boolean isEmpty() { 510 return ((bitField0_) == 0); 511 } 512 513 public static ProtobufArmFeedforward parseFrom(final byte[] data) throws 514 InvalidProtocolBufferException { 515 return ProtoMessage.mergeFrom(new ProtobufArmFeedforward(), data).checkInitialized(); 516 } 517 518 public static ProtobufArmFeedforward parseFrom(final ProtoSource input) throws IOException { 519 return ProtoMessage.mergeFrom(new ProtobufArmFeedforward(), input).checkInitialized(); 520 } 521 522 public static ProtobufArmFeedforward parseFrom(final JsonSource input) throws IOException { 523 return ProtoMessage.mergeFrom(new ProtobufArmFeedforward(), input).checkInitialized(); 524 } 525 526 /** 527 * @return factory for creating ProtobufArmFeedforward messages 528 */ 529 public static MessageFactory<ProtobufArmFeedforward> getFactory() { 530 return ProtobufArmFeedforwardFactory.INSTANCE; 531 } 532 533 /** 534 * @return this type's descriptor. 535 */ 536 public static Descriptors.Descriptor getDescriptor() { 537 return Controller.wpi_proto_ProtobufArmFeedforward_descriptor; 538 } 539 540 private enum ProtobufArmFeedforwardFactory implements MessageFactory<ProtobufArmFeedforward> { 541 INSTANCE; 542 543 @Override 544 public ProtobufArmFeedforward create() { 545 return ProtobufArmFeedforward.newInstance(); 546 } 547 } 548 549 /** 550 * Contains name constants used for serializing JSON 551 */ 552 static class FieldNames { 553 static final FieldName ks = FieldName.forField("ks"); 554 555 static final FieldName kg = FieldName.forField("kg"); 556 557 static final FieldName kv = FieldName.forField("kv"); 558 559 static final FieldName ka = FieldName.forField("ka"); 560 } 561 } 562 563 /** 564 * Protobuf type {@code ProtobufDifferentialDriveFeedforward} 565 */ 566 public static final class ProtobufDifferentialDriveFeedforward extends ProtoMessage<ProtobufDifferentialDriveFeedforward> implements Cloneable { 567 private static final long serialVersionUID = 0L; 568 569 /** 570 * <code>optional double kv_linear = 1;</code> 571 */ 572 private double kvLinear; 573 574 /** 575 * <code>optional double ka_linear = 2;</code> 576 */ 577 private double kaLinear; 578 579 /** 580 * <code>optional double kv_angular = 3;</code> 581 */ 582 private double kvAngular; 583 584 /** 585 * <code>optional double ka_angular = 4;</code> 586 */ 587 private double kaAngular; 588 589 private ProtobufDifferentialDriveFeedforward() { 590 } 591 592 /** 593 * @return a new empty instance of {@code ProtobufDifferentialDriveFeedforward} 594 */ 595 public static ProtobufDifferentialDriveFeedforward newInstance() { 596 return new ProtobufDifferentialDriveFeedforward(); 597 } 598 599 /** 600 * <code>optional double kv_linear = 1;</code> 601 * @return whether the kvLinear field is set 602 */ 603 public boolean hasKvLinear() { 604 return (bitField0_ & 0x00000001) != 0; 605 } 606 607 /** 608 * <code>optional double kv_linear = 1;</code> 609 * @return this 610 */ 611 public ProtobufDifferentialDriveFeedforward clearKvLinear() { 612 bitField0_ &= ~0x00000001; 613 kvLinear = 0D; 614 return this; 615 } 616 617 /** 618 * <code>optional double kv_linear = 1;</code> 619 * @return the kvLinear 620 */ 621 public double getKvLinear() { 622 return kvLinear; 623 } 624 625 /** 626 * <code>optional double kv_linear = 1;</code> 627 * @param value the kvLinear to set 628 * @return this 629 */ 630 public ProtobufDifferentialDriveFeedforward setKvLinear(final double value) { 631 bitField0_ |= 0x00000001; 632 kvLinear = value; 633 return this; 634 } 635 636 /** 637 * <code>optional double ka_linear = 2;</code> 638 * @return whether the kaLinear field is set 639 */ 640 public boolean hasKaLinear() { 641 return (bitField0_ & 0x00000002) != 0; 642 } 643 644 /** 645 * <code>optional double ka_linear = 2;</code> 646 * @return this 647 */ 648 public ProtobufDifferentialDriveFeedforward clearKaLinear() { 649 bitField0_ &= ~0x00000002; 650 kaLinear = 0D; 651 return this; 652 } 653 654 /** 655 * <code>optional double ka_linear = 2;</code> 656 * @return the kaLinear 657 */ 658 public double getKaLinear() { 659 return kaLinear; 660 } 661 662 /** 663 * <code>optional double ka_linear = 2;</code> 664 * @param value the kaLinear to set 665 * @return this 666 */ 667 public ProtobufDifferentialDriveFeedforward setKaLinear(final double value) { 668 bitField0_ |= 0x00000002; 669 kaLinear = value; 670 return this; 671 } 672 673 /** 674 * <code>optional double kv_angular = 3;</code> 675 * @return whether the kvAngular field is set 676 */ 677 public boolean hasKvAngular() { 678 return (bitField0_ & 0x00000004) != 0; 679 } 680 681 /** 682 * <code>optional double kv_angular = 3;</code> 683 * @return this 684 */ 685 public ProtobufDifferentialDriveFeedforward clearKvAngular() { 686 bitField0_ &= ~0x00000004; 687 kvAngular = 0D; 688 return this; 689 } 690 691 /** 692 * <code>optional double kv_angular = 3;</code> 693 * @return the kvAngular 694 */ 695 public double getKvAngular() { 696 return kvAngular; 697 } 698 699 /** 700 * <code>optional double kv_angular = 3;</code> 701 * @param value the kvAngular to set 702 * @return this 703 */ 704 public ProtobufDifferentialDriveFeedforward setKvAngular(final double value) { 705 bitField0_ |= 0x00000004; 706 kvAngular = value; 707 return this; 708 } 709 710 /** 711 * <code>optional double ka_angular = 4;</code> 712 * @return whether the kaAngular field is set 713 */ 714 public boolean hasKaAngular() { 715 return (bitField0_ & 0x00000008) != 0; 716 } 717 718 /** 719 * <code>optional double ka_angular = 4;</code> 720 * @return this 721 */ 722 public ProtobufDifferentialDriveFeedforward clearKaAngular() { 723 bitField0_ &= ~0x00000008; 724 kaAngular = 0D; 725 return this; 726 } 727 728 /** 729 * <code>optional double ka_angular = 4;</code> 730 * @return the kaAngular 731 */ 732 public double getKaAngular() { 733 return kaAngular; 734 } 735 736 /** 737 * <code>optional double ka_angular = 4;</code> 738 * @param value the kaAngular to set 739 * @return this 740 */ 741 public ProtobufDifferentialDriveFeedforward setKaAngular(final double value) { 742 bitField0_ |= 0x00000008; 743 kaAngular = value; 744 return this; 745 } 746 747 @Override 748 public ProtobufDifferentialDriveFeedforward copyFrom( 749 final ProtobufDifferentialDriveFeedforward other) { 750 cachedSize = other.cachedSize; 751 if ((bitField0_ | other.bitField0_) != 0) { 752 bitField0_ = other.bitField0_; 753 kvLinear = other.kvLinear; 754 kaLinear = other.kaLinear; 755 kvAngular = other.kvAngular; 756 kaAngular = other.kaAngular; 757 } 758 return this; 759 } 760 761 @Override 762 public ProtobufDifferentialDriveFeedforward mergeFrom( 763 final ProtobufDifferentialDriveFeedforward other) { 764 if (other.isEmpty()) { 765 return this; 766 } 767 cachedSize = -1; 768 if (other.hasKvLinear()) { 769 setKvLinear(other.kvLinear); 770 } 771 if (other.hasKaLinear()) { 772 setKaLinear(other.kaLinear); 773 } 774 if (other.hasKvAngular()) { 775 setKvAngular(other.kvAngular); 776 } 777 if (other.hasKaAngular()) { 778 setKaAngular(other.kaAngular); 779 } 780 return this; 781 } 782 783 @Override 784 public ProtobufDifferentialDriveFeedforward clear() { 785 if (isEmpty()) { 786 return this; 787 } 788 cachedSize = -1; 789 bitField0_ = 0; 790 kvLinear = 0D; 791 kaLinear = 0D; 792 kvAngular = 0D; 793 kaAngular = 0D; 794 return this; 795 } 796 797 @Override 798 public ProtobufDifferentialDriveFeedforward clearQuick() { 799 if (isEmpty()) { 800 return this; 801 } 802 cachedSize = -1; 803 bitField0_ = 0; 804 return this; 805 } 806 807 @Override 808 public boolean equals(Object o) { 809 if (o == this) { 810 return true; 811 } 812 if (!(o instanceof ProtobufDifferentialDriveFeedforward)) { 813 return false; 814 } 815 ProtobufDifferentialDriveFeedforward other = (ProtobufDifferentialDriveFeedforward) o; 816 return bitField0_ == other.bitField0_ 817 && (!hasKvLinear() || ProtoUtil.isEqual(kvLinear, other.kvLinear)) 818 && (!hasKaLinear() || ProtoUtil.isEqual(kaLinear, other.kaLinear)) 819 && (!hasKvAngular() || ProtoUtil.isEqual(kvAngular, other.kvAngular)) 820 && (!hasKaAngular() || ProtoUtil.isEqual(kaAngular, other.kaAngular)); 821 } 822 823 @Override 824 public void writeTo(final ProtoSink output) throws IOException { 825 if ((bitField0_ & 0x00000001) != 0) { 826 output.writeRawByte((byte) 9); 827 output.writeDoubleNoTag(kvLinear); 828 } 829 if ((bitField0_ & 0x00000002) != 0) { 830 output.writeRawByte((byte) 17); 831 output.writeDoubleNoTag(kaLinear); 832 } 833 if ((bitField0_ & 0x00000004) != 0) { 834 output.writeRawByte((byte) 25); 835 output.writeDoubleNoTag(kvAngular); 836 } 837 if ((bitField0_ & 0x00000008) != 0) { 838 output.writeRawByte((byte) 33); 839 output.writeDoubleNoTag(kaAngular); 840 } 841 } 842 843 @Override 844 protected int computeSerializedSize() { 845 int size = 0; 846 if ((bitField0_ & 0x00000001) != 0) { 847 size += 9; 848 } 849 if ((bitField0_ & 0x00000002) != 0) { 850 size += 9; 851 } 852 if ((bitField0_ & 0x00000004) != 0) { 853 size += 9; 854 } 855 if ((bitField0_ & 0x00000008) != 0) { 856 size += 9; 857 } 858 return size; 859 } 860 861 @Override 862 @SuppressWarnings("fallthrough") 863 public ProtobufDifferentialDriveFeedforward mergeFrom(final ProtoSource input) throws 864 IOException { 865 // Enabled Fall-Through Optimization (QuickBuffers) 866 int tag = input.readTag(); 867 while (true) { 868 switch (tag) { 869 case 9: { 870 // kvLinear 871 kvLinear = input.readDouble(); 872 bitField0_ |= 0x00000001; 873 tag = input.readTag(); 874 if (tag != 17) { 875 break; 876 } 877 } 878 case 17: { 879 // kaLinear 880 kaLinear = input.readDouble(); 881 bitField0_ |= 0x00000002; 882 tag = input.readTag(); 883 if (tag != 25) { 884 break; 885 } 886 } 887 case 25: { 888 // kvAngular 889 kvAngular = input.readDouble(); 890 bitField0_ |= 0x00000004; 891 tag = input.readTag(); 892 if (tag != 33) { 893 break; 894 } 895 } 896 case 33: { 897 // kaAngular 898 kaAngular = input.readDouble(); 899 bitField0_ |= 0x00000008; 900 tag = input.readTag(); 901 if (tag != 0) { 902 break; 903 } 904 } 905 case 0: { 906 return this; 907 } 908 default: { 909 if (!input.skipField(tag)) { 910 return this; 911 } 912 tag = input.readTag(); 913 break; 914 } 915 } 916 } 917 } 918 919 @Override 920 public void writeTo(final JsonSink output) throws IOException { 921 output.beginObject(); 922 if ((bitField0_ & 0x00000001) != 0) { 923 output.writeDouble(FieldNames.kvLinear, kvLinear); 924 } 925 if ((bitField0_ & 0x00000002) != 0) { 926 output.writeDouble(FieldNames.kaLinear, kaLinear); 927 } 928 if ((bitField0_ & 0x00000004) != 0) { 929 output.writeDouble(FieldNames.kvAngular, kvAngular); 930 } 931 if ((bitField0_ & 0x00000008) != 0) { 932 output.writeDouble(FieldNames.kaAngular, kaAngular); 933 } 934 output.endObject(); 935 } 936 937 @Override 938 public ProtobufDifferentialDriveFeedforward mergeFrom(final JsonSource input) throws 939 IOException { 940 if (!input.beginObject()) { 941 return this; 942 } 943 while (!input.isAtEnd()) { 944 switch (input.readFieldHash()) { 945 case 1424526448: 946 case 974889081: { 947 if (input.isAtField(FieldNames.kvLinear)) { 948 if (!input.trySkipNullValue()) { 949 kvLinear = input.readDouble(); 950 bitField0_ |= 0x00000001; 951 } 952 } else { 953 input.skipUnknownField(); 954 } 955 break; 956 } 957 case -33181669: 958 case -1264389586: { 959 if (input.isAtField(FieldNames.kaLinear)) { 960 if (!input.trySkipNullValue()) { 961 kaLinear = input.readDouble(); 962 bitField0_ |= 0x00000002; 963 } 964 } else { 965 input.skipUnknownField(); 966 } 967 break; 968 } 969 case 175208951: 970 case -878647538: { 971 if (input.isAtField(FieldNames.kvAngular)) { 972 if (!input.trySkipNullValue()) { 973 kvAngular = input.readDouble(); 974 bitField0_ |= 0x00000004; 975 } 976 } else { 977 input.skipUnknownField(); 978 } 979 break; 980 } 981 case -2064069716: 982 case -1576809479: { 983 if (input.isAtField(FieldNames.kaAngular)) { 984 if (!input.trySkipNullValue()) { 985 kaAngular = input.readDouble(); 986 bitField0_ |= 0x00000008; 987 } 988 } else { 989 input.skipUnknownField(); 990 } 991 break; 992 } 993 default: { 994 input.skipUnknownField(); 995 break; 996 } 997 } 998 } 999 input.endObject(); 1000 return this; 1001 } 1002 1003 @Override 1004 public ProtobufDifferentialDriveFeedforward clone() { 1005 return new ProtobufDifferentialDriveFeedforward().copyFrom(this); 1006 } 1007 1008 @Override 1009 public boolean isEmpty() { 1010 return ((bitField0_) == 0); 1011 } 1012 1013 public static ProtobufDifferentialDriveFeedforward parseFrom(final byte[] data) throws 1014 InvalidProtocolBufferException { 1015 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveFeedforward(), data).checkInitialized(); 1016 } 1017 1018 public static ProtobufDifferentialDriveFeedforward parseFrom(final ProtoSource input) throws 1019 IOException { 1020 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveFeedforward(), input).checkInitialized(); 1021 } 1022 1023 public static ProtobufDifferentialDriveFeedforward parseFrom(final JsonSource input) throws 1024 IOException { 1025 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveFeedforward(), input).checkInitialized(); 1026 } 1027 1028 /** 1029 * @return factory for creating ProtobufDifferentialDriveFeedforward messages 1030 */ 1031 public static MessageFactory<ProtobufDifferentialDriveFeedforward> getFactory() { 1032 return ProtobufDifferentialDriveFeedforwardFactory.INSTANCE; 1033 } 1034 1035 /** 1036 * @return this type's descriptor. 1037 */ 1038 public static Descriptors.Descriptor getDescriptor() { 1039 return Controller.wpi_proto_ProtobufDifferentialDriveFeedforward_descriptor; 1040 } 1041 1042 private enum ProtobufDifferentialDriveFeedforwardFactory implements MessageFactory<ProtobufDifferentialDriveFeedforward> { 1043 INSTANCE; 1044 1045 @Override 1046 public ProtobufDifferentialDriveFeedforward create() { 1047 return ProtobufDifferentialDriveFeedforward.newInstance(); 1048 } 1049 } 1050 1051 /** 1052 * Contains name constants used for serializing JSON 1053 */ 1054 static class FieldNames { 1055 static final FieldName kvLinear = FieldName.forField("kvLinear", "kv_linear"); 1056 1057 static final FieldName kaLinear = FieldName.forField("kaLinear", "ka_linear"); 1058 1059 static final FieldName kvAngular = FieldName.forField("kvAngular", "kv_angular"); 1060 1061 static final FieldName kaAngular = FieldName.forField("kaAngular", "ka_angular"); 1062 } 1063 } 1064 1065 /** 1066 * Protobuf type {@code ProtobufElevatorFeedforward} 1067 */ 1068 public static final class ProtobufElevatorFeedforward extends ProtoMessage<ProtobufElevatorFeedforward> implements Cloneable { 1069 private static final long serialVersionUID = 0L; 1070 1071 /** 1072 * <code>optional double ks = 1;</code> 1073 */ 1074 private double ks; 1075 1076 /** 1077 * <code>optional double kg = 2;</code> 1078 */ 1079 private double kg; 1080 1081 /** 1082 * <code>optional double kv = 3;</code> 1083 */ 1084 private double kv; 1085 1086 /** 1087 * <code>optional double ka = 4;</code> 1088 */ 1089 private double ka; 1090 1091 private ProtobufElevatorFeedforward() { 1092 } 1093 1094 /** 1095 * @return a new empty instance of {@code ProtobufElevatorFeedforward} 1096 */ 1097 public static ProtobufElevatorFeedforward newInstance() { 1098 return new ProtobufElevatorFeedforward(); 1099 } 1100 1101 /** 1102 * <code>optional double ks = 1;</code> 1103 * @return whether the ks field is set 1104 */ 1105 public boolean hasKs() { 1106 return (bitField0_ & 0x00000001) != 0; 1107 } 1108 1109 /** 1110 * <code>optional double ks = 1;</code> 1111 * @return this 1112 */ 1113 public ProtobufElevatorFeedforward clearKs() { 1114 bitField0_ &= ~0x00000001; 1115 ks = 0D; 1116 return this; 1117 } 1118 1119 /** 1120 * <code>optional double ks = 1;</code> 1121 * @return the ks 1122 */ 1123 public double getKs() { 1124 return ks; 1125 } 1126 1127 /** 1128 * <code>optional double ks = 1;</code> 1129 * @param value the ks to set 1130 * @return this 1131 */ 1132 public ProtobufElevatorFeedforward setKs(final double value) { 1133 bitField0_ |= 0x00000001; 1134 ks = value; 1135 return this; 1136 } 1137 1138 /** 1139 * <code>optional double kg = 2;</code> 1140 * @return whether the kg field is set 1141 */ 1142 public boolean hasKg() { 1143 return (bitField0_ & 0x00000002) != 0; 1144 } 1145 1146 /** 1147 * <code>optional double kg = 2;</code> 1148 * @return this 1149 */ 1150 public ProtobufElevatorFeedforward clearKg() { 1151 bitField0_ &= ~0x00000002; 1152 kg = 0D; 1153 return this; 1154 } 1155 1156 /** 1157 * <code>optional double kg = 2;</code> 1158 * @return the kg 1159 */ 1160 public double getKg() { 1161 return kg; 1162 } 1163 1164 /** 1165 * <code>optional double kg = 2;</code> 1166 * @param value the kg to set 1167 * @return this 1168 */ 1169 public ProtobufElevatorFeedforward setKg(final double value) { 1170 bitField0_ |= 0x00000002; 1171 kg = value; 1172 return this; 1173 } 1174 1175 /** 1176 * <code>optional double kv = 3;</code> 1177 * @return whether the kv field is set 1178 */ 1179 public boolean hasKv() { 1180 return (bitField0_ & 0x00000004) != 0; 1181 } 1182 1183 /** 1184 * <code>optional double kv = 3;</code> 1185 * @return this 1186 */ 1187 public ProtobufElevatorFeedforward clearKv() { 1188 bitField0_ &= ~0x00000004; 1189 kv = 0D; 1190 return this; 1191 } 1192 1193 /** 1194 * <code>optional double kv = 3;</code> 1195 * @return the kv 1196 */ 1197 public double getKv() { 1198 return kv; 1199 } 1200 1201 /** 1202 * <code>optional double kv = 3;</code> 1203 * @param value the kv to set 1204 * @return this 1205 */ 1206 public ProtobufElevatorFeedforward setKv(final double value) { 1207 bitField0_ |= 0x00000004; 1208 kv = value; 1209 return this; 1210 } 1211 1212 /** 1213 * <code>optional double ka = 4;</code> 1214 * @return whether the ka field is set 1215 */ 1216 public boolean hasKa() { 1217 return (bitField0_ & 0x00000008) != 0; 1218 } 1219 1220 /** 1221 * <code>optional double ka = 4;</code> 1222 * @return this 1223 */ 1224 public ProtobufElevatorFeedforward clearKa() { 1225 bitField0_ &= ~0x00000008; 1226 ka = 0D; 1227 return this; 1228 } 1229 1230 /** 1231 * <code>optional double ka = 4;</code> 1232 * @return the ka 1233 */ 1234 public double getKa() { 1235 return ka; 1236 } 1237 1238 /** 1239 * <code>optional double ka = 4;</code> 1240 * @param value the ka to set 1241 * @return this 1242 */ 1243 public ProtobufElevatorFeedforward setKa(final double value) { 1244 bitField0_ |= 0x00000008; 1245 ka = value; 1246 return this; 1247 } 1248 1249 @Override 1250 public ProtobufElevatorFeedforward copyFrom(final ProtobufElevatorFeedforward other) { 1251 cachedSize = other.cachedSize; 1252 if ((bitField0_ | other.bitField0_) != 0) { 1253 bitField0_ = other.bitField0_; 1254 ks = other.ks; 1255 kg = other.kg; 1256 kv = other.kv; 1257 ka = other.ka; 1258 } 1259 return this; 1260 } 1261 1262 @Override 1263 public ProtobufElevatorFeedforward mergeFrom(final ProtobufElevatorFeedforward other) { 1264 if (other.isEmpty()) { 1265 return this; 1266 } 1267 cachedSize = -1; 1268 if (other.hasKs()) { 1269 setKs(other.ks); 1270 } 1271 if (other.hasKg()) { 1272 setKg(other.kg); 1273 } 1274 if (other.hasKv()) { 1275 setKv(other.kv); 1276 } 1277 if (other.hasKa()) { 1278 setKa(other.ka); 1279 } 1280 return this; 1281 } 1282 1283 @Override 1284 public ProtobufElevatorFeedforward clear() { 1285 if (isEmpty()) { 1286 return this; 1287 } 1288 cachedSize = -1; 1289 bitField0_ = 0; 1290 ks = 0D; 1291 kg = 0D; 1292 kv = 0D; 1293 ka = 0D; 1294 return this; 1295 } 1296 1297 @Override 1298 public ProtobufElevatorFeedforward clearQuick() { 1299 if (isEmpty()) { 1300 return this; 1301 } 1302 cachedSize = -1; 1303 bitField0_ = 0; 1304 return this; 1305 } 1306 1307 @Override 1308 public boolean equals(Object o) { 1309 if (o == this) { 1310 return true; 1311 } 1312 if (!(o instanceof ProtobufElevatorFeedforward)) { 1313 return false; 1314 } 1315 ProtobufElevatorFeedforward other = (ProtobufElevatorFeedforward) o; 1316 return bitField0_ == other.bitField0_ 1317 && (!hasKs() || ProtoUtil.isEqual(ks, other.ks)) 1318 && (!hasKg() || ProtoUtil.isEqual(kg, other.kg)) 1319 && (!hasKv() || ProtoUtil.isEqual(kv, other.kv)) 1320 && (!hasKa() || ProtoUtil.isEqual(ka, other.ka)); 1321 } 1322 1323 @Override 1324 public void writeTo(final ProtoSink output) throws IOException { 1325 if ((bitField0_ & 0x00000001) != 0) { 1326 output.writeRawByte((byte) 9); 1327 output.writeDoubleNoTag(ks); 1328 } 1329 if ((bitField0_ & 0x00000002) != 0) { 1330 output.writeRawByte((byte) 17); 1331 output.writeDoubleNoTag(kg); 1332 } 1333 if ((bitField0_ & 0x00000004) != 0) { 1334 output.writeRawByte((byte) 25); 1335 output.writeDoubleNoTag(kv); 1336 } 1337 if ((bitField0_ & 0x00000008) != 0) { 1338 output.writeRawByte((byte) 33); 1339 output.writeDoubleNoTag(ka); 1340 } 1341 } 1342 1343 @Override 1344 protected int computeSerializedSize() { 1345 int size = 0; 1346 if ((bitField0_ & 0x00000001) != 0) { 1347 size += 9; 1348 } 1349 if ((bitField0_ & 0x00000002) != 0) { 1350 size += 9; 1351 } 1352 if ((bitField0_ & 0x00000004) != 0) { 1353 size += 9; 1354 } 1355 if ((bitField0_ & 0x00000008) != 0) { 1356 size += 9; 1357 } 1358 return size; 1359 } 1360 1361 @Override 1362 @SuppressWarnings("fallthrough") 1363 public ProtobufElevatorFeedforward mergeFrom(final ProtoSource input) throws IOException { 1364 // Enabled Fall-Through Optimization (QuickBuffers) 1365 int tag = input.readTag(); 1366 while (true) { 1367 switch (tag) { 1368 case 9: { 1369 // ks 1370 ks = input.readDouble(); 1371 bitField0_ |= 0x00000001; 1372 tag = input.readTag(); 1373 if (tag != 17) { 1374 break; 1375 } 1376 } 1377 case 17: { 1378 // kg 1379 kg = input.readDouble(); 1380 bitField0_ |= 0x00000002; 1381 tag = input.readTag(); 1382 if (tag != 25) { 1383 break; 1384 } 1385 } 1386 case 25: { 1387 // kv 1388 kv = input.readDouble(); 1389 bitField0_ |= 0x00000004; 1390 tag = input.readTag(); 1391 if (tag != 33) { 1392 break; 1393 } 1394 } 1395 case 33: { 1396 // ka 1397 ka = input.readDouble(); 1398 bitField0_ |= 0x00000008; 1399 tag = input.readTag(); 1400 if (tag != 0) { 1401 break; 1402 } 1403 } 1404 case 0: { 1405 return this; 1406 } 1407 default: { 1408 if (!input.skipField(tag)) { 1409 return this; 1410 } 1411 tag = input.readTag(); 1412 break; 1413 } 1414 } 1415 } 1416 } 1417 1418 @Override 1419 public void writeTo(final JsonSink output) throws IOException { 1420 output.beginObject(); 1421 if ((bitField0_ & 0x00000001) != 0) { 1422 output.writeDouble(FieldNames.ks, ks); 1423 } 1424 if ((bitField0_ & 0x00000002) != 0) { 1425 output.writeDouble(FieldNames.kg, kg); 1426 } 1427 if ((bitField0_ & 0x00000004) != 0) { 1428 output.writeDouble(FieldNames.kv, kv); 1429 } 1430 if ((bitField0_ & 0x00000008) != 0) { 1431 output.writeDouble(FieldNames.ka, ka); 1432 } 1433 output.endObject(); 1434 } 1435 1436 @Override 1437 public ProtobufElevatorFeedforward mergeFrom(final JsonSource input) throws IOException { 1438 if (!input.beginObject()) { 1439 return this; 1440 } 1441 while (!input.isAtEnd()) { 1442 switch (input.readFieldHash()) { 1443 case 3432: { 1444 if (input.isAtField(FieldNames.ks)) { 1445 if (!input.trySkipNullValue()) { 1446 ks = input.readDouble(); 1447 bitField0_ |= 0x00000001; 1448 } 1449 } else { 1450 input.skipUnknownField(); 1451 } 1452 break; 1453 } 1454 case 3420: { 1455 if (input.isAtField(FieldNames.kg)) { 1456 if (!input.trySkipNullValue()) { 1457 kg = input.readDouble(); 1458 bitField0_ |= 0x00000002; 1459 } 1460 } else { 1461 input.skipUnknownField(); 1462 } 1463 break; 1464 } 1465 case 3435: { 1466 if (input.isAtField(FieldNames.kv)) { 1467 if (!input.trySkipNullValue()) { 1468 kv = input.readDouble(); 1469 bitField0_ |= 0x00000004; 1470 } 1471 } else { 1472 input.skipUnknownField(); 1473 } 1474 break; 1475 } 1476 case 3414: { 1477 if (input.isAtField(FieldNames.ka)) { 1478 if (!input.trySkipNullValue()) { 1479 ka = input.readDouble(); 1480 bitField0_ |= 0x00000008; 1481 } 1482 } else { 1483 input.skipUnknownField(); 1484 } 1485 break; 1486 } 1487 default: { 1488 input.skipUnknownField(); 1489 break; 1490 } 1491 } 1492 } 1493 input.endObject(); 1494 return this; 1495 } 1496 1497 @Override 1498 public ProtobufElevatorFeedforward clone() { 1499 return new ProtobufElevatorFeedforward().copyFrom(this); 1500 } 1501 1502 @Override 1503 public boolean isEmpty() { 1504 return ((bitField0_) == 0); 1505 } 1506 1507 public static ProtobufElevatorFeedforward parseFrom(final byte[] data) throws 1508 InvalidProtocolBufferException { 1509 return ProtoMessage.mergeFrom(new ProtobufElevatorFeedforward(), data).checkInitialized(); 1510 } 1511 1512 public static ProtobufElevatorFeedforward parseFrom(final ProtoSource input) throws 1513 IOException { 1514 return ProtoMessage.mergeFrom(new ProtobufElevatorFeedforward(), input).checkInitialized(); 1515 } 1516 1517 public static ProtobufElevatorFeedforward parseFrom(final JsonSource input) throws IOException { 1518 return ProtoMessage.mergeFrom(new ProtobufElevatorFeedforward(), input).checkInitialized(); 1519 } 1520 1521 /** 1522 * @return factory for creating ProtobufElevatorFeedforward messages 1523 */ 1524 public static MessageFactory<ProtobufElevatorFeedforward> getFactory() { 1525 return ProtobufElevatorFeedforwardFactory.INSTANCE; 1526 } 1527 1528 /** 1529 * @return this type's descriptor. 1530 */ 1531 public static Descriptors.Descriptor getDescriptor() { 1532 return Controller.wpi_proto_ProtobufElevatorFeedforward_descriptor; 1533 } 1534 1535 private enum ProtobufElevatorFeedforwardFactory implements MessageFactory<ProtobufElevatorFeedforward> { 1536 INSTANCE; 1537 1538 @Override 1539 public ProtobufElevatorFeedforward create() { 1540 return ProtobufElevatorFeedforward.newInstance(); 1541 } 1542 } 1543 1544 /** 1545 * Contains name constants used for serializing JSON 1546 */ 1547 static class FieldNames { 1548 static final FieldName ks = FieldName.forField("ks"); 1549 1550 static final FieldName kg = FieldName.forField("kg"); 1551 1552 static final FieldName kv = FieldName.forField("kv"); 1553 1554 static final FieldName ka = FieldName.forField("ka"); 1555 } 1556 } 1557 1558 /** 1559 * Protobuf type {@code ProtobufSimpleMotorFeedforward} 1560 */ 1561 public static final class ProtobufSimpleMotorFeedforward extends ProtoMessage<ProtobufSimpleMotorFeedforward> implements Cloneable { 1562 private static final long serialVersionUID = 0L; 1563 1564 /** 1565 * <code>optional double ks = 1;</code> 1566 */ 1567 private double ks; 1568 1569 /** 1570 * <code>optional double kv = 2;</code> 1571 */ 1572 private double kv; 1573 1574 /** 1575 * <code>optional double ka = 3;</code> 1576 */ 1577 private double ka; 1578 1579 private ProtobufSimpleMotorFeedforward() { 1580 } 1581 1582 /** 1583 * @return a new empty instance of {@code ProtobufSimpleMotorFeedforward} 1584 */ 1585 public static ProtobufSimpleMotorFeedforward newInstance() { 1586 return new ProtobufSimpleMotorFeedforward(); 1587 } 1588 1589 /** 1590 * <code>optional double ks = 1;</code> 1591 * @return whether the ks field is set 1592 */ 1593 public boolean hasKs() { 1594 return (bitField0_ & 0x00000001) != 0; 1595 } 1596 1597 /** 1598 * <code>optional double ks = 1;</code> 1599 * @return this 1600 */ 1601 public ProtobufSimpleMotorFeedforward clearKs() { 1602 bitField0_ &= ~0x00000001; 1603 ks = 0D; 1604 return this; 1605 } 1606 1607 /** 1608 * <code>optional double ks = 1;</code> 1609 * @return the ks 1610 */ 1611 public double getKs() { 1612 return ks; 1613 } 1614 1615 /** 1616 * <code>optional double ks = 1;</code> 1617 * @param value the ks to set 1618 * @return this 1619 */ 1620 public ProtobufSimpleMotorFeedforward setKs(final double value) { 1621 bitField0_ |= 0x00000001; 1622 ks = value; 1623 return this; 1624 } 1625 1626 /** 1627 * <code>optional double kv = 2;</code> 1628 * @return whether the kv field is set 1629 */ 1630 public boolean hasKv() { 1631 return (bitField0_ & 0x00000002) != 0; 1632 } 1633 1634 /** 1635 * <code>optional double kv = 2;</code> 1636 * @return this 1637 */ 1638 public ProtobufSimpleMotorFeedforward clearKv() { 1639 bitField0_ &= ~0x00000002; 1640 kv = 0D; 1641 return this; 1642 } 1643 1644 /** 1645 * <code>optional double kv = 2;</code> 1646 * @return the kv 1647 */ 1648 public double getKv() { 1649 return kv; 1650 } 1651 1652 /** 1653 * <code>optional double kv = 2;</code> 1654 * @param value the kv to set 1655 * @return this 1656 */ 1657 public ProtobufSimpleMotorFeedforward setKv(final double value) { 1658 bitField0_ |= 0x00000002; 1659 kv = value; 1660 return this; 1661 } 1662 1663 /** 1664 * <code>optional double ka = 3;</code> 1665 * @return whether the ka field is set 1666 */ 1667 public boolean hasKa() { 1668 return (bitField0_ & 0x00000004) != 0; 1669 } 1670 1671 /** 1672 * <code>optional double ka = 3;</code> 1673 * @return this 1674 */ 1675 public ProtobufSimpleMotorFeedforward clearKa() { 1676 bitField0_ &= ~0x00000004; 1677 ka = 0D; 1678 return this; 1679 } 1680 1681 /** 1682 * <code>optional double ka = 3;</code> 1683 * @return the ka 1684 */ 1685 public double getKa() { 1686 return ka; 1687 } 1688 1689 /** 1690 * <code>optional double ka = 3;</code> 1691 * @param value the ka to set 1692 * @return this 1693 */ 1694 public ProtobufSimpleMotorFeedforward setKa(final double value) { 1695 bitField0_ |= 0x00000004; 1696 ka = value; 1697 return this; 1698 } 1699 1700 @Override 1701 public ProtobufSimpleMotorFeedforward copyFrom(final ProtobufSimpleMotorFeedforward other) { 1702 cachedSize = other.cachedSize; 1703 if ((bitField0_ | other.bitField0_) != 0) { 1704 bitField0_ = other.bitField0_; 1705 ks = other.ks; 1706 kv = other.kv; 1707 ka = other.ka; 1708 } 1709 return this; 1710 } 1711 1712 @Override 1713 public ProtobufSimpleMotorFeedforward mergeFrom(final ProtobufSimpleMotorFeedforward other) { 1714 if (other.isEmpty()) { 1715 return this; 1716 } 1717 cachedSize = -1; 1718 if (other.hasKs()) { 1719 setKs(other.ks); 1720 } 1721 if (other.hasKv()) { 1722 setKv(other.kv); 1723 } 1724 if (other.hasKa()) { 1725 setKa(other.ka); 1726 } 1727 return this; 1728 } 1729 1730 @Override 1731 public ProtobufSimpleMotorFeedforward clear() { 1732 if (isEmpty()) { 1733 return this; 1734 } 1735 cachedSize = -1; 1736 bitField0_ = 0; 1737 ks = 0D; 1738 kv = 0D; 1739 ka = 0D; 1740 return this; 1741 } 1742 1743 @Override 1744 public ProtobufSimpleMotorFeedforward clearQuick() { 1745 if (isEmpty()) { 1746 return this; 1747 } 1748 cachedSize = -1; 1749 bitField0_ = 0; 1750 return this; 1751 } 1752 1753 @Override 1754 public boolean equals(Object o) { 1755 if (o == this) { 1756 return true; 1757 } 1758 if (!(o instanceof ProtobufSimpleMotorFeedforward)) { 1759 return false; 1760 } 1761 ProtobufSimpleMotorFeedforward other = (ProtobufSimpleMotorFeedforward) o; 1762 return bitField0_ == other.bitField0_ 1763 && (!hasKs() || ProtoUtil.isEqual(ks, other.ks)) 1764 && (!hasKv() || ProtoUtil.isEqual(kv, other.kv)) 1765 && (!hasKa() || ProtoUtil.isEqual(ka, other.ka)); 1766 } 1767 1768 @Override 1769 public void writeTo(final ProtoSink output) throws IOException { 1770 if ((bitField0_ & 0x00000001) != 0) { 1771 output.writeRawByte((byte) 9); 1772 output.writeDoubleNoTag(ks); 1773 } 1774 if ((bitField0_ & 0x00000002) != 0) { 1775 output.writeRawByte((byte) 17); 1776 output.writeDoubleNoTag(kv); 1777 } 1778 if ((bitField0_ & 0x00000004) != 0) { 1779 output.writeRawByte((byte) 25); 1780 output.writeDoubleNoTag(ka); 1781 } 1782 } 1783 1784 @Override 1785 protected int computeSerializedSize() { 1786 int size = 0; 1787 if ((bitField0_ & 0x00000001) != 0) { 1788 size += 9; 1789 } 1790 if ((bitField0_ & 0x00000002) != 0) { 1791 size += 9; 1792 } 1793 if ((bitField0_ & 0x00000004) != 0) { 1794 size += 9; 1795 } 1796 return size; 1797 } 1798 1799 @Override 1800 @SuppressWarnings("fallthrough") 1801 public ProtobufSimpleMotorFeedforward mergeFrom(final ProtoSource input) throws IOException { 1802 // Enabled Fall-Through Optimization (QuickBuffers) 1803 int tag = input.readTag(); 1804 while (true) { 1805 switch (tag) { 1806 case 9: { 1807 // ks 1808 ks = input.readDouble(); 1809 bitField0_ |= 0x00000001; 1810 tag = input.readTag(); 1811 if (tag != 17) { 1812 break; 1813 } 1814 } 1815 case 17: { 1816 // kv 1817 kv = input.readDouble(); 1818 bitField0_ |= 0x00000002; 1819 tag = input.readTag(); 1820 if (tag != 25) { 1821 break; 1822 } 1823 } 1824 case 25: { 1825 // ka 1826 ka = input.readDouble(); 1827 bitField0_ |= 0x00000004; 1828 tag = input.readTag(); 1829 if (tag != 0) { 1830 break; 1831 } 1832 } 1833 case 0: { 1834 return this; 1835 } 1836 default: { 1837 if (!input.skipField(tag)) { 1838 return this; 1839 } 1840 tag = input.readTag(); 1841 break; 1842 } 1843 } 1844 } 1845 } 1846 1847 @Override 1848 public void writeTo(final JsonSink output) throws IOException { 1849 output.beginObject(); 1850 if ((bitField0_ & 0x00000001) != 0) { 1851 output.writeDouble(FieldNames.ks, ks); 1852 } 1853 if ((bitField0_ & 0x00000002) != 0) { 1854 output.writeDouble(FieldNames.kv, kv); 1855 } 1856 if ((bitField0_ & 0x00000004) != 0) { 1857 output.writeDouble(FieldNames.ka, ka); 1858 } 1859 output.endObject(); 1860 } 1861 1862 @Override 1863 public ProtobufSimpleMotorFeedforward mergeFrom(final JsonSource input) throws IOException { 1864 if (!input.beginObject()) { 1865 return this; 1866 } 1867 while (!input.isAtEnd()) { 1868 switch (input.readFieldHash()) { 1869 case 3432: { 1870 if (input.isAtField(FieldNames.ks)) { 1871 if (!input.trySkipNullValue()) { 1872 ks = input.readDouble(); 1873 bitField0_ |= 0x00000001; 1874 } 1875 } else { 1876 input.skipUnknownField(); 1877 } 1878 break; 1879 } 1880 case 3435: { 1881 if (input.isAtField(FieldNames.kv)) { 1882 if (!input.trySkipNullValue()) { 1883 kv = input.readDouble(); 1884 bitField0_ |= 0x00000002; 1885 } 1886 } else { 1887 input.skipUnknownField(); 1888 } 1889 break; 1890 } 1891 case 3414: { 1892 if (input.isAtField(FieldNames.ka)) { 1893 if (!input.trySkipNullValue()) { 1894 ka = input.readDouble(); 1895 bitField0_ |= 0x00000004; 1896 } 1897 } else { 1898 input.skipUnknownField(); 1899 } 1900 break; 1901 } 1902 default: { 1903 input.skipUnknownField(); 1904 break; 1905 } 1906 } 1907 } 1908 input.endObject(); 1909 return this; 1910 } 1911 1912 @Override 1913 public ProtobufSimpleMotorFeedforward clone() { 1914 return new ProtobufSimpleMotorFeedforward().copyFrom(this); 1915 } 1916 1917 @Override 1918 public boolean isEmpty() { 1919 return ((bitField0_) == 0); 1920 } 1921 1922 public static ProtobufSimpleMotorFeedforward parseFrom(final byte[] data) throws 1923 InvalidProtocolBufferException { 1924 return ProtoMessage.mergeFrom(new ProtobufSimpleMotorFeedforward(), data).checkInitialized(); 1925 } 1926 1927 public static ProtobufSimpleMotorFeedforward parseFrom(final ProtoSource input) throws 1928 IOException { 1929 return ProtoMessage.mergeFrom(new ProtobufSimpleMotorFeedforward(), input).checkInitialized(); 1930 } 1931 1932 public static ProtobufSimpleMotorFeedforward parseFrom(final JsonSource input) throws 1933 IOException { 1934 return ProtoMessage.mergeFrom(new ProtobufSimpleMotorFeedforward(), input).checkInitialized(); 1935 } 1936 1937 /** 1938 * @return factory for creating ProtobufSimpleMotorFeedforward messages 1939 */ 1940 public static MessageFactory<ProtobufSimpleMotorFeedforward> getFactory() { 1941 return ProtobufSimpleMotorFeedforwardFactory.INSTANCE; 1942 } 1943 1944 /** 1945 * @return this type's descriptor. 1946 */ 1947 public static Descriptors.Descriptor getDescriptor() { 1948 return Controller.wpi_proto_ProtobufSimpleMotorFeedforward_descriptor; 1949 } 1950 1951 private enum ProtobufSimpleMotorFeedforwardFactory implements MessageFactory<ProtobufSimpleMotorFeedforward> { 1952 INSTANCE; 1953 1954 @Override 1955 public ProtobufSimpleMotorFeedforward create() { 1956 return ProtobufSimpleMotorFeedforward.newInstance(); 1957 } 1958 } 1959 1960 /** 1961 * Contains name constants used for serializing JSON 1962 */ 1963 static class FieldNames { 1964 static final FieldName ks = FieldName.forField("ks"); 1965 1966 static final FieldName kv = FieldName.forField("kv"); 1967 1968 static final FieldName ka = FieldName.forField("ka"); 1969 } 1970 } 1971 1972 /** 1973 * Protobuf type {@code ProtobufDifferentialDriveWheelVoltages} 1974 */ 1975 public static final class ProtobufDifferentialDriveWheelVoltages extends ProtoMessage<ProtobufDifferentialDriveWheelVoltages> implements Cloneable { 1976 private static final long serialVersionUID = 0L; 1977 1978 /** 1979 * <code>optional double left = 1;</code> 1980 */ 1981 private double left; 1982 1983 /** 1984 * <code>optional double right = 2;</code> 1985 */ 1986 private double right; 1987 1988 private ProtobufDifferentialDriveWheelVoltages() { 1989 } 1990 1991 /** 1992 * @return a new empty instance of {@code ProtobufDifferentialDriveWheelVoltages} 1993 */ 1994 public static ProtobufDifferentialDriveWheelVoltages newInstance() { 1995 return new ProtobufDifferentialDriveWheelVoltages(); 1996 } 1997 1998 /** 1999 * <code>optional double left = 1;</code> 2000 * @return whether the left field is set 2001 */ 2002 public boolean hasLeft() { 2003 return (bitField0_ & 0x00000001) != 0; 2004 } 2005 2006 /** 2007 * <code>optional double left = 1;</code> 2008 * @return this 2009 */ 2010 public ProtobufDifferentialDriveWheelVoltages clearLeft() { 2011 bitField0_ &= ~0x00000001; 2012 left = 0D; 2013 return this; 2014 } 2015 2016 /** 2017 * <code>optional double left = 1;</code> 2018 * @return the left 2019 */ 2020 public double getLeft() { 2021 return left; 2022 } 2023 2024 /** 2025 * <code>optional double left = 1;</code> 2026 * @param value the left to set 2027 * @return this 2028 */ 2029 public ProtobufDifferentialDriveWheelVoltages setLeft(final double value) { 2030 bitField0_ |= 0x00000001; 2031 left = value; 2032 return this; 2033 } 2034 2035 /** 2036 * <code>optional double right = 2;</code> 2037 * @return whether the right field is set 2038 */ 2039 public boolean hasRight() { 2040 return (bitField0_ & 0x00000002) != 0; 2041 } 2042 2043 /** 2044 * <code>optional double right = 2;</code> 2045 * @return this 2046 */ 2047 public ProtobufDifferentialDriveWheelVoltages clearRight() { 2048 bitField0_ &= ~0x00000002; 2049 right = 0D; 2050 return this; 2051 } 2052 2053 /** 2054 * <code>optional double right = 2;</code> 2055 * @return the right 2056 */ 2057 public double getRight() { 2058 return right; 2059 } 2060 2061 /** 2062 * <code>optional double right = 2;</code> 2063 * @param value the right to set 2064 * @return this 2065 */ 2066 public ProtobufDifferentialDriveWheelVoltages setRight(final double value) { 2067 bitField0_ |= 0x00000002; 2068 right = value; 2069 return this; 2070 } 2071 2072 @Override 2073 public ProtobufDifferentialDriveWheelVoltages copyFrom( 2074 final ProtobufDifferentialDriveWheelVoltages other) { 2075 cachedSize = other.cachedSize; 2076 if ((bitField0_ | other.bitField0_) != 0) { 2077 bitField0_ = other.bitField0_; 2078 left = other.left; 2079 right = other.right; 2080 } 2081 return this; 2082 } 2083 2084 @Override 2085 public ProtobufDifferentialDriveWheelVoltages mergeFrom( 2086 final ProtobufDifferentialDriveWheelVoltages other) { 2087 if (other.isEmpty()) { 2088 return this; 2089 } 2090 cachedSize = -1; 2091 if (other.hasLeft()) { 2092 setLeft(other.left); 2093 } 2094 if (other.hasRight()) { 2095 setRight(other.right); 2096 } 2097 return this; 2098 } 2099 2100 @Override 2101 public ProtobufDifferentialDriveWheelVoltages clear() { 2102 if (isEmpty()) { 2103 return this; 2104 } 2105 cachedSize = -1; 2106 bitField0_ = 0; 2107 left = 0D; 2108 right = 0D; 2109 return this; 2110 } 2111 2112 @Override 2113 public ProtobufDifferentialDriveWheelVoltages clearQuick() { 2114 if (isEmpty()) { 2115 return this; 2116 } 2117 cachedSize = -1; 2118 bitField0_ = 0; 2119 return this; 2120 } 2121 2122 @Override 2123 public boolean equals(Object o) { 2124 if (o == this) { 2125 return true; 2126 } 2127 if (!(o instanceof ProtobufDifferentialDriveWheelVoltages)) { 2128 return false; 2129 } 2130 ProtobufDifferentialDriveWheelVoltages other = (ProtobufDifferentialDriveWheelVoltages) o; 2131 return bitField0_ == other.bitField0_ 2132 && (!hasLeft() || ProtoUtil.isEqual(left, other.left)) 2133 && (!hasRight() || ProtoUtil.isEqual(right, other.right)); 2134 } 2135 2136 @Override 2137 public void writeTo(final ProtoSink output) throws IOException { 2138 if ((bitField0_ & 0x00000001) != 0) { 2139 output.writeRawByte((byte) 9); 2140 output.writeDoubleNoTag(left); 2141 } 2142 if ((bitField0_ & 0x00000002) != 0) { 2143 output.writeRawByte((byte) 17); 2144 output.writeDoubleNoTag(right); 2145 } 2146 } 2147 2148 @Override 2149 protected int computeSerializedSize() { 2150 int size = 0; 2151 if ((bitField0_ & 0x00000001) != 0) { 2152 size += 9; 2153 } 2154 if ((bitField0_ & 0x00000002) != 0) { 2155 size += 9; 2156 } 2157 return size; 2158 } 2159 2160 @Override 2161 @SuppressWarnings("fallthrough") 2162 public ProtobufDifferentialDriveWheelVoltages mergeFrom(final ProtoSource input) throws 2163 IOException { 2164 // Enabled Fall-Through Optimization (QuickBuffers) 2165 int tag = input.readTag(); 2166 while (true) { 2167 switch (tag) { 2168 case 9: { 2169 // left 2170 left = input.readDouble(); 2171 bitField0_ |= 0x00000001; 2172 tag = input.readTag(); 2173 if (tag != 17) { 2174 break; 2175 } 2176 } 2177 case 17: { 2178 // right 2179 right = input.readDouble(); 2180 bitField0_ |= 0x00000002; 2181 tag = input.readTag(); 2182 if (tag != 0) { 2183 break; 2184 } 2185 } 2186 case 0: { 2187 return this; 2188 } 2189 default: { 2190 if (!input.skipField(tag)) { 2191 return this; 2192 } 2193 tag = input.readTag(); 2194 break; 2195 } 2196 } 2197 } 2198 } 2199 2200 @Override 2201 public void writeTo(final JsonSink output) throws IOException { 2202 output.beginObject(); 2203 if ((bitField0_ & 0x00000001) != 0) { 2204 output.writeDouble(FieldNames.left, left); 2205 } 2206 if ((bitField0_ & 0x00000002) != 0) { 2207 output.writeDouble(FieldNames.right, right); 2208 } 2209 output.endObject(); 2210 } 2211 2212 @Override 2213 public ProtobufDifferentialDriveWheelVoltages mergeFrom(final JsonSource input) throws 2214 IOException { 2215 if (!input.beginObject()) { 2216 return this; 2217 } 2218 while (!input.isAtEnd()) { 2219 switch (input.readFieldHash()) { 2220 case 3317767: { 2221 if (input.isAtField(FieldNames.left)) { 2222 if (!input.trySkipNullValue()) { 2223 left = input.readDouble(); 2224 bitField0_ |= 0x00000001; 2225 } 2226 } else { 2227 input.skipUnknownField(); 2228 } 2229 break; 2230 } 2231 case 108511772: { 2232 if (input.isAtField(FieldNames.right)) { 2233 if (!input.trySkipNullValue()) { 2234 right = input.readDouble(); 2235 bitField0_ |= 0x00000002; 2236 } 2237 } else { 2238 input.skipUnknownField(); 2239 } 2240 break; 2241 } 2242 default: { 2243 input.skipUnknownField(); 2244 break; 2245 } 2246 } 2247 } 2248 input.endObject(); 2249 return this; 2250 } 2251 2252 @Override 2253 public ProtobufDifferentialDriveWheelVoltages clone() { 2254 return new ProtobufDifferentialDriveWheelVoltages().copyFrom(this); 2255 } 2256 2257 @Override 2258 public boolean isEmpty() { 2259 return ((bitField0_) == 0); 2260 } 2261 2262 public static ProtobufDifferentialDriveWheelVoltages parseFrom(final byte[] data) throws 2263 InvalidProtocolBufferException { 2264 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelVoltages(), data).checkInitialized(); 2265 } 2266 2267 public static ProtobufDifferentialDriveWheelVoltages parseFrom(final ProtoSource input) throws 2268 IOException { 2269 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelVoltages(), input).checkInitialized(); 2270 } 2271 2272 public static ProtobufDifferentialDriveWheelVoltages parseFrom(final JsonSource input) throws 2273 IOException { 2274 return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelVoltages(), input).checkInitialized(); 2275 } 2276 2277 /** 2278 * @return factory for creating ProtobufDifferentialDriveWheelVoltages messages 2279 */ 2280 public static MessageFactory<ProtobufDifferentialDriveWheelVoltages> getFactory() { 2281 return ProtobufDifferentialDriveWheelVoltagesFactory.INSTANCE; 2282 } 2283 2284 /** 2285 * @return this type's descriptor. 2286 */ 2287 public static Descriptors.Descriptor getDescriptor() { 2288 return Controller.wpi_proto_ProtobufDifferentialDriveWheelVoltages_descriptor; 2289 } 2290 2291 private enum ProtobufDifferentialDriveWheelVoltagesFactory implements MessageFactory<ProtobufDifferentialDriveWheelVoltages> { 2292 INSTANCE; 2293 2294 @Override 2295 public ProtobufDifferentialDriveWheelVoltages create() { 2296 return ProtobufDifferentialDriveWheelVoltages.newInstance(); 2297 } 2298 } 2299 2300 /** 2301 * Contains name constants used for serializing JSON 2302 */ 2303 static class FieldNames { 2304 static final FieldName left = FieldName.forField("left"); 2305 2306 static final FieldName right = FieldName.forField("right"); 2307 } 2308 } 2309}