diff --git a/.github/workflows/pregenerate.yml b/.github/workflows/pregenerate.yml
index f7c9648986..b730264c4c 100644
--- a/.github/workflows/pregenerate.yml
+++ b/.github/workflows/pregenerate.yml
@@ -1,47 +1,49 @@
-name: Check Pregenerated Files
-
-on:
- pull_request:
- push:
- branches-ignore:
- - main
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
- cancel-in-progress: true
-
-jobs:
- update:
- name: "Update"
- runs-on: ubuntu-22.04
- steps:
- - uses: actions/checkout@v3
- - name: Fetch all history and metadata
- run: |
- git fetch --prune --unshallow
- git checkout -b pr
- git branch -f main origin/main
- - name: Set up Python 3.9
- uses: actions/setup-python@v4
- with:
- python-version: 3.9
- - name: Install jinja
- run: python -m pip install jinja2
- - name: Run hal
- run: ./hal/generate_usage_reporting.py
- - name: Run ntcore
- run: ./ntcore/generate_topics.py
- - name: Run wpimath
- run: ./wpimath/generate_numbers.py
- - name: Add untracked files to index so they count as changes
- run: git add -A
- - name: Check output
- run: git --no-pager diff --exit-code HEAD
- - name: Generate diff
- run: git diff HEAD > pregenerated-files-fixes.patch
- if: ${{ failure() }}
- - uses: actions/upload-artifact@v3
- with:
- name: pregenerated-files-fixes
- path: pregenerated-files-fixes.patch
- if: ${{ failure() }}
+name: Check Pregenerated Files
+
+on:
+ pull_request:
+ push:
+ branches-ignore:
+ - main
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ update:
+ name: "Update"
+ runs-on: ubuntu-22.04
+ steps:
+ - uses: actions/checkout@v3
+ - name: Fetch all history and metadata
+ run: |
+ git fetch --prune --unshallow
+ git checkout -b pr
+ git branch -f main origin/main
+ - name: Set up Python 3.9
+ uses: actions/setup-python@v4
+ with:
+ python-version: 3.9
+ - name: Install jinja
+ run: python -m pip install jinja2
+ - name: Install protobuf dependencies
+ run: sudo apt-get update && sudo apt-get install -y protobuf-compiler && wget https://github.com/HebiRobotics/QuickBuffers/releases/download/1.3.2/protoc-gen-quickbuf-1.3.2-linux-x86_64.exe && chmod +x protoc-gen-quickbuf-1.3.2-linux-x86_64.exe
+ - name: Run hal
+ run: ./hal/generate_usage_reporting.py
+ - name: Run ntcore
+ run: ./ntcore/generate_topics.py
+ - name: Run wpimath
+ run: ./wpimath/generate_numbers.py && ./wpimath/generate_quickbuf.py protoc protoc-gen-quickbuf-1.3.2-linux-x86_64.exe
+ - name: Add untracked files to index so they count as changes
+ run: git add -A
+ - name: Check output
+ run: git --no-pager diff --exit-code HEAD
+ - name: Generate diff
+ run: git diff HEAD > pregenerated-files-fixes.patch
+ if: ${{ failure() }}
+ - uses: actions/upload-artifact@v3
+ with:
+ name: pregenerated-files-fixes
+ path: pregenerated-files-fixes.patch
+ if: ${{ failure() }}
diff --git a/shared/java/javacommon.gradle b/shared/java/javacommon.gradle
index f5813328cd..48a506293b 100644
--- a/shared/java/javacommon.gradle
+++ b/shared/java/javacommon.gradle
@@ -146,22 +146,12 @@ protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.21.12'
}
- plugins {
- quickbuf {
- artifact = 'us.hebi.quickbuf:protoc-gen-quickbuf:1.3.2'
- }
- }
generateProtoTasks {
all().configureEach { task ->
task.builtins {
cpp {}
remove java
}
- task.plugins {
- quickbuf {
- option "gen_descriptors=true"
- }
- }
}
}
}
diff --git a/styleguide/checkstyle-suppressions.xml b/styleguide/checkstyle-suppressions.xml
index 2197fe27ba..f42b176a63 100644
--- a/styleguide/checkstyle-suppressions.xml
+++ b/styleguide/checkstyle-suppressions.xml
@@ -10,6 +10,6 @@ suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN"
checks="(LocalVariableName|MemberName|MethodName|MethodTypeParameterName|ParameterName)" />
-
diff --git a/styleguide/pmd-ruleset.xml b/styleguide/pmd-ruleset.xml
index f2ef2bc8db..1f6577e6f1 100644
--- a/styleguide/pmd-ruleset.xml
+++ b/styleguide/pmd-ruleset.xml
@@ -8,7 +8,7 @@
.*/*JNI.*
.*/*IntegrationTests.*
- .*/quickbuf/.*
+ .*/math/proto.*
diff --git a/wpimath/.styleguide b/wpimath/.styleguide
index 257b50bcae..00437ce869 100644
--- a/wpimath/.styleguide
+++ b/wpimath/.styleguide
@@ -21,6 +21,7 @@ generatedFileExclude {
src/test/native/cpp/UnitsTest\.cpp$
src/test/native/cpp/drake/
src/test/native/include/drake/
+ src/generated/main/java/edu/wpi/first/math/proto
}
repoRootNameOverride {
diff --git a/wpimath/CMakeLists.txt b/wpimath/CMakeLists.txt
index dbae16e65e..f938c4df7e 100644
--- a/wpimath/CMakeLists.txt
+++ b/wpimath/CMakeLists.txt
@@ -17,52 +17,6 @@ protobuf_generate_cpp(
${wpimath_proto_src}
)
-function(quickbuf_generate SRCS JAVA_PACKAGE)
- if(NOT ARGN)
- message(SEND_ERROR "Error: PROTOBUF_GENERATE_QUICKBUF() called without any proto files")
- return()
- endif()
-
- set(_generated_srcs_all)
- foreach(_proto ${ARGN})
- get_filename_component(_abs_file ${_proto} ABSOLUTE)
- get_filename_component(_abs_dir ${_abs_file} DIRECTORY)
- get_filename_component(_basename ${_proto} NAME_WLE)
- file(RELATIVE_PATH _rel_dir ${CMAKE_CURRENT_SOURCE_DIR} ${_abs_dir})
-
- # convert to QuickBuffers Java case (geometry2d -> Geometry2D)
- string(REGEX MATCHALL "[A-Za-z_]+|[0-9]+" _name_components ${_basename})
- set(_name_components_out)
- foreach(_part ${_name_components})
- string(SUBSTRING ${_part} 0 1 _first_letter)
- string(TOUPPER ${_first_letter} _first_letter)
- string(REGEX REPLACE "^.(.*)" "${_first_letter}\\1" _part_out "${_part}")
- list(APPEND _name_components_out ${_part_out})
- endforeach()
- list(JOIN _name_components_out "" _basename_title)
-
- set(_generated_src
- "${CMAKE_CURRENT_BINARY_DIR}/quickbuf/${JAVA_PACKAGE}/${_basename_title}.java"
- )
-
- list(APPEND _generated_srcs_all ${_generated_src})
-
- add_custom_command(
- OUTPUT ${_generated_src}
- COMMAND protobuf::protoc
- ARGS
- --plugin=protoc-gen-quickbuf=${Quickbuf_EXECUTABLE}
- --quickbuf_out=gen_descriptors=true:${CMAKE_CURRENT_BINARY_DIR}/quickbuf
- -I${_abs_dir} ${_abs_file}
- DEPENDS ${_abs_file} protobuf::protoc
- COMMENT "Running quickbuf protocol buffer compiler on ${_proto}"
- VERBATIM
- )
- endforeach()
-
- set(${SRCS} ${_generated_srcs_all} PARENT_SCOPE)
-endfunction()
-
file(
GLOB wpimath_jni_src
src/main/native/cpp/jni/WPIMathJNI_DARE.cpp
@@ -80,8 +34,6 @@ if(WITH_JAVA)
include(UseJava)
set(CMAKE_JAVA_COMPILE_FLAGS "-encoding" "UTF8" "-Xlint:unchecked")
- quickbuf_generate(WPIMATH_QUICKBUF_SRCS "edu/wpi/first/math/proto" ${wpimath_proto_src})
-
if(NOT EXISTS "${WPILIB_BINARY_DIR}/wpimath/thirdparty/ejml/ejml-simple-0.43.1.jar")
set(BASE_URL "https://search.maven.org/remotecontent?filepath=")
set(JAR_ROOT "${WPILIB_BINARY_DIR}/wpimath/thirdparty/ejml")
@@ -126,7 +78,6 @@ if(WITH_JAVA)
add_jar(
wpimath_jar
${JAVA_SOURCES}
- ${WPIMATH_QUICKBUF_SRCS}
INCLUDE_JARS ${EJML_JARS} wpiutil_jar wpiunits_jar
OUTPUT_NAME wpimath
GENERATE_NATIVE_HEADERS wpimath_jni_headers
diff --git a/wpimath/generate_quickbuf.py b/wpimath/generate_quickbuf.py
new file mode 100755
index 0000000000..506c5bc92d
--- /dev/null
+++ b/wpimath/generate_quickbuf.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python3
+
+# Copyright (c) FIRST and other WPILib contributors.
+# Open Source Software; you can modify and/or share it under the terms of
+# the WPILib BSD license file in the root directory of this project.
+import os.path
+import subprocess
+import sys
+from glob import glob
+
+if __name__ == "__main__":
+ proto_files = glob("wpimath/src/main/proto/*.proto")
+ for path in proto_files:
+ absolute_filename = os.path.abspath(path)
+ absolute_dir, filename = os.path.split(absolute_filename)
+ subprocess.run(
+ [
+ sys.argv[1],
+ f"--plugin=protoc-gen-quickbuf={sys.argv[2]}",
+ f"--quickbuf_out=gen_descriptors=true:{os.path.abspath('./wpimath/src/generated/main/java')}",
+ f"-I{absolute_dir}",
+ absolute_filename,
+ ]
+ )
+ java_files = glob("wpimath/src/generated/main/java/edu/wpi/first/math/proto/*.java")
+ for java_file in java_files:
+ with open(java_file) as file:
+ content = file.read()
+ with open(java_file, "tw") as file:
+ file.write(
+ "// Copyright (c) FIRST and other WPILib contributors.\n// Open Source Software; you can modify and/or share it under the terms of\n// the WPILib BSD license file in the root directory of this project.\n"
+ + content
+ )
diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Controller.java b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Controller.java
new file mode 100644
index 0000000000..ed423da583
--- /dev/null
+++ b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Controller.java
@@ -0,0 +1,2309 @@
+// Copyright (c) FIRST and other WPILib contributors.
+// Open Source Software; you can modify and/or share it under the terms of
+// the WPILib BSD license file in the root directory of this project.
+// Code generated by protocol buffer compiler. Do not edit!
+package edu.wpi.first.math.proto;
+
+import java.io.IOException;
+import us.hebi.quickbuf.Descriptors;
+import us.hebi.quickbuf.FieldName;
+import us.hebi.quickbuf.InvalidProtocolBufferException;
+import us.hebi.quickbuf.JsonSink;
+import us.hebi.quickbuf.JsonSource;
+import us.hebi.quickbuf.MessageFactory;
+import us.hebi.quickbuf.ProtoMessage;
+import us.hebi.quickbuf.ProtoSink;
+import us.hebi.quickbuf.ProtoSource;
+import us.hebi.quickbuf.ProtoUtil;
+import us.hebi.quickbuf.RepeatedByte;
+
+public final class Controller {
+ private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(1684,
+ "ChBjb250cm9sbGVyLnByb3RvEgl3cGkucHJvdG8iWAoWUHJvdG9idWZBcm1GZWVkZm9yd2FyZBIOCgJr" +
+ "cxgBIAEoAVICa3MSDgoCa2cYAiABKAFSAmtnEg4KAmt2GAMgASgBUgJrdhIOCgJrYRgEIAEoAVICa2Ei" +
+ "ngEKJFByb3RvYnVmRGlmZmVyZW50aWFsRHJpdmVGZWVkZm9yd2FyZBIbCglrdl9saW5lYXIYASABKAFS" +
+ "CGt2TGluZWFyEhsKCWthX2xpbmVhchgCIAEoAVIIa2FMaW5lYXISHQoKa3ZfYW5ndWxhchgDIAEoAVIJ" +
+ "a3ZBbmd1bGFyEh0KCmthX2FuZ3VsYXIYBCABKAFSCWthQW5ndWxhciJdChtQcm90b2J1ZkVsZXZhdG9y" +
+ "RmVlZGZvcndhcmQSDgoCa3MYASABKAFSAmtzEg4KAmtnGAIgASgBUgJrZxIOCgJrdhgDIAEoAVICa3YS" +
+ "DgoCa2EYBCABKAFSAmthIlAKHlByb3RvYnVmU2ltcGxlTW90b3JGZWVkZm9yd2FyZBIOCgJrcxgBIAEo" +
+ "AVICa3MSDgoCa3YYAiABKAFSAmt2Eg4KAmthGAMgASgBUgJrYSJSCiZQcm90b2J1ZkRpZmZlcmVudGlh" +
+ "bERyaXZlV2hlZWxWb2x0YWdlcxISCgRsZWZ0GAEgASgBUgRsZWZ0EhQKBXJpZ2h0GAIgASgBUgVyaWdo" +
+ "dEIaChhlZHUud3BpLmZpcnN0Lm1hdGgucHJvdG9K0AgKBhIEAAAkAQoICgEMEgMAABIKCAoBAhIDAgAS" +
+ "CggKAQgSAwQAMQoJCgIIARIDBAAxCgoKAgQAEgQGAAsBCgoKAwQAARIDBggeCgsKBAQAAgASAwcCEAoM" +
+ "CgUEAAIABRIDBwIICgwKBQQAAgABEgMHCQsKDAoFBAACAAMSAwcODwoLCgQEAAIBEgMIAhAKDAoFBAAC" +
+ "AQUSAwgCCAoMCgUEAAIBARIDCAkLCgwKBQQAAgEDEgMIDg8KCwoEBAACAhIDCQIQCgwKBQQAAgIFEgMJ" +
+ "AggKDAoFBAACAgESAwkJCwoMCgUEAAICAxIDCQ4PCgsKBAQAAgMSAwoCEAoMCgUEAAIDBRIDCgIICgwK" +
+ "BQQAAgMBEgMKCQsKDAoFBAACAwMSAwoODwoKCgIEARIEDQASAQoKCgMEAQESAw0ILAoLCgQEAQIAEgMO" +
+ "AhcKDAoFBAECAAUSAw4CCAoMCgUEAQIAARIDDgkSCgwKBQQBAgADEgMOFRYKCwoEBAECARIDDwIXCgwK" +
+ "BQQBAgEFEgMPAggKDAoFBAECAQESAw8JEgoMCgUEAQIBAxIDDxUWCgsKBAQBAgISAxACGAoMCgUEAQIC" +
+ "BRIDEAIICgwKBQQBAgIBEgMQCRMKDAoFBAECAgMSAxAWFwoLCgQEAQIDEgMRAhgKDAoFBAECAwUSAxEC" +
+ "CAoMCgUEAQIDARIDEQkTCgwKBQQBAgMDEgMRFhcKCgoCBAISBBQAGQEKCgoDBAIBEgMUCCMKCwoEBAIC" +
+ "ABIDFQIQCgwKBQQCAgAFEgMVAggKDAoFBAICAAESAxUJCwoMCgUEAgIAAxIDFQ4PCgsKBAQCAgESAxYC",
+ "EAoMCgUEAgIBBRIDFgIICgwKBQQCAgEBEgMWCQsKDAoFBAICAQMSAxYODwoLCgQEAgICEgMXAhAKDAoF" +
+ "BAICAgUSAxcCCAoMCgUEAgICARIDFwkLCgwKBQQCAgIDEgMXDg8KCwoEBAICAxIDGAIQCgwKBQQCAgMF" +
+ "EgMYAggKDAoFBAICAwESAxgJCwoMCgUEAgIDAxIDGA4PCgoKAgQDEgQbAB8BCgoKAwQDARIDGwgmCgsK" +
+ "BAQDAgASAxwCEAoMCgUEAwIABRIDHAIICgwKBQQDAgABEgMcCQsKDAoFBAMCAAMSAxwODwoLCgQEAwIB" +
+ "EgMdAhAKDAoFBAMCAQUSAx0CCAoMCgUEAwIBARIDHQkLCgwKBQQDAgEDEgMdDg8KCwoEBAMCAhIDHgIQ" +
+ "CgwKBQQDAgIFEgMeAggKDAoFBAMCAgESAx4JCwoMCgUEAwICAxIDHg4PCgoKAgQEEgQhACQBCgoKAwQE" +
+ "ARIDIQguCgsKBAQEAgASAyICEgoMCgUEBAIABRIDIgIICgwKBQQEAgABEgMiCQ0KDAoFBAQCAAMSAyIQ" +
+ "EQoLCgQEBAIBEgMjAhMKDAoFBAQCAQUSAyMCCAoMCgUEBAIBARIDIwkOCgwKBQQEAgEDEgMjERJiBnBy" +
+ "b3RvMw==");
+
+ static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("controller.proto", "wpi.proto", descriptorData);
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufArmFeedforward_descriptor = descriptor.internalContainedType(31, 88, "ProtobufArmFeedforward", "wpi.proto.ProtobufArmFeedforward");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufDifferentialDriveFeedforward_descriptor = descriptor.internalContainedType(122, 158, "ProtobufDifferentialDriveFeedforward", "wpi.proto.ProtobufDifferentialDriveFeedforward");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufElevatorFeedforward_descriptor = descriptor.internalContainedType(282, 93, "ProtobufElevatorFeedforward", "wpi.proto.ProtobufElevatorFeedforward");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufSimpleMotorFeedforward_descriptor = descriptor.internalContainedType(377, 80, "ProtobufSimpleMotorFeedforward", "wpi.proto.ProtobufSimpleMotorFeedforward");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufDifferentialDriveWheelVoltages_descriptor = descriptor.internalContainedType(459, 82, "ProtobufDifferentialDriveWheelVoltages", "wpi.proto.ProtobufDifferentialDriveWheelVoltages");
+
+ /**
+ * @return this proto file's descriptor.
+ */
+ public static Descriptors.FileDescriptor getDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Protobuf type {@code ProtobufArmFeedforward}
+ */
+ public static final class ProtobufArmFeedforward extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double ks = 1;
+ */
+ private double ks;
+
+ /**
+ * optional double kg = 2;
+ */
+ private double kg;
+
+ /**
+ * optional double kv = 3;
+ */
+ private double kv;
+
+ /**
+ * optional double ka = 4;
+ */
+ private double ka;
+
+ private ProtobufArmFeedforward() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufArmFeedforward}
+ */
+ public static ProtobufArmFeedforward newInstance() {
+ return new ProtobufArmFeedforward();
+ }
+
+ /**
+ * optional double ks = 1;
+ * @return whether the ks field is set
+ */
+ public boolean hasKs() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double ks = 1;
+ * @return this
+ */
+ public ProtobufArmFeedforward clearKs() {
+ bitField0_ &= ~0x00000001;
+ ks = 0D;
+ return this;
+ }
+
+ /**
+ * optional double ks = 1;
+ * @return the ks
+ */
+ public double getKs() {
+ return ks;
+ }
+
+ /**
+ * optional double ks = 1;
+ * @param value the ks to set
+ * @return this
+ */
+ public ProtobufArmFeedforward setKs(final double value) {
+ bitField0_ |= 0x00000001;
+ ks = value;
+ return this;
+ }
+
+ /**
+ * optional double kg = 2;
+ * @return whether the kg field is set
+ */
+ public boolean hasKg() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double kg = 2;
+ * @return this
+ */
+ public ProtobufArmFeedforward clearKg() {
+ bitField0_ &= ~0x00000002;
+ kg = 0D;
+ return this;
+ }
+
+ /**
+ * optional double kg = 2;
+ * @return the kg
+ */
+ public double getKg() {
+ return kg;
+ }
+
+ /**
+ * optional double kg = 2;
+ * @param value the kg to set
+ * @return this
+ */
+ public ProtobufArmFeedforward setKg(final double value) {
+ bitField0_ |= 0x00000002;
+ kg = value;
+ return this;
+ }
+
+ /**
+ * optional double kv = 3;
+ * @return whether the kv field is set
+ */
+ public boolean hasKv() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double kv = 3;
+ * @return this
+ */
+ public ProtobufArmFeedforward clearKv() {
+ bitField0_ &= ~0x00000004;
+ kv = 0D;
+ return this;
+ }
+
+ /**
+ * optional double kv = 3;
+ * @return the kv
+ */
+ public double getKv() {
+ return kv;
+ }
+
+ /**
+ * optional double kv = 3;
+ * @param value the kv to set
+ * @return this
+ */
+ public ProtobufArmFeedforward setKv(final double value) {
+ bitField0_ |= 0x00000004;
+ kv = value;
+ return this;
+ }
+
+ /**
+ * optional double ka = 4;
+ * @return whether the ka field is set
+ */
+ public boolean hasKa() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional double ka = 4;
+ * @return this
+ */
+ public ProtobufArmFeedforward clearKa() {
+ bitField0_ &= ~0x00000008;
+ ka = 0D;
+ return this;
+ }
+
+ /**
+ * optional double ka = 4;
+ * @return the ka
+ */
+ public double getKa() {
+ return ka;
+ }
+
+ /**
+ * optional double ka = 4;
+ * @param value the ka to set
+ * @return this
+ */
+ public ProtobufArmFeedforward setKa(final double value) {
+ bitField0_ |= 0x00000008;
+ ka = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufArmFeedforward copyFrom(final ProtobufArmFeedforward other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ ks = other.ks;
+ kg = other.kg;
+ kv = other.kv;
+ ka = other.ka;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufArmFeedforward mergeFrom(final ProtobufArmFeedforward other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasKs()) {
+ setKs(other.ks);
+ }
+ if (other.hasKg()) {
+ setKg(other.kg);
+ }
+ if (other.hasKv()) {
+ setKv(other.kv);
+ }
+ if (other.hasKa()) {
+ setKa(other.ka);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufArmFeedforward clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ ks = 0D;
+ kg = 0D;
+ kv = 0D;
+ ka = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufArmFeedforward clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufArmFeedforward)) {
+ return false;
+ }
+ ProtobufArmFeedforward other = (ProtobufArmFeedforward) o;
+ return bitField0_ == other.bitField0_
+ && (!hasKs() || ProtoUtil.isEqual(ks, other.ks))
+ && (!hasKg() || ProtoUtil.isEqual(kg, other.kg))
+ && (!hasKv() || ProtoUtil.isEqual(kv, other.kv))
+ && (!hasKa() || ProtoUtil.isEqual(ka, other.ka));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(ks);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(kg);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(kv);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 33);
+ output.writeDoubleNoTag(ka);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufArmFeedforward mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // ks
+ ks = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // kg
+ kg = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // kv
+ kv = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 33) {
+ break;
+ }
+ }
+ case 33: {
+ // ka
+ ka = input.readDouble();
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.ks, ks);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.kg, kg);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.kv, kv);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeDouble(FieldNames.ka, ka);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufArmFeedforward mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 3432: {
+ if (input.isAtField(FieldNames.ks)) {
+ if (!input.trySkipNullValue()) {
+ ks = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3420: {
+ if (input.isAtField(FieldNames.kg)) {
+ if (!input.trySkipNullValue()) {
+ kg = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3435: {
+ if (input.isAtField(FieldNames.kv)) {
+ if (!input.trySkipNullValue()) {
+ kv = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3414: {
+ if (input.isAtField(FieldNames.ka)) {
+ if (!input.trySkipNullValue()) {
+ ka = input.readDouble();
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufArmFeedforward clone() {
+ return new ProtobufArmFeedforward().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufArmFeedforward parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufArmFeedforward(), data).checkInitialized();
+ }
+
+ public static ProtobufArmFeedforward parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufArmFeedforward(), input).checkInitialized();
+ }
+
+ public static ProtobufArmFeedforward parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufArmFeedforward(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufArmFeedforward messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufArmFeedforwardFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Controller.wpi_proto_ProtobufArmFeedforward_descriptor;
+ }
+
+ private enum ProtobufArmFeedforwardFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufArmFeedforward create() {
+ return ProtobufArmFeedforward.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName ks = FieldName.forField("ks");
+
+ static final FieldName kg = FieldName.forField("kg");
+
+ static final FieldName kv = FieldName.forField("kv");
+
+ static final FieldName ka = FieldName.forField("ka");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufDifferentialDriveFeedforward}
+ */
+ public static final class ProtobufDifferentialDriveFeedforward extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double kv_linear = 1;
+ */
+ private double kvLinear;
+
+ /**
+ * optional double ka_linear = 2;
+ */
+ private double kaLinear;
+
+ /**
+ * optional double kv_angular = 3;
+ */
+ private double kvAngular;
+
+ /**
+ * optional double ka_angular = 4;
+ */
+ private double kaAngular;
+
+ private ProtobufDifferentialDriveFeedforward() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufDifferentialDriveFeedforward}
+ */
+ public static ProtobufDifferentialDriveFeedforward newInstance() {
+ return new ProtobufDifferentialDriveFeedforward();
+ }
+
+ /**
+ * optional double kv_linear = 1;
+ * @return whether the kvLinear field is set
+ */
+ public boolean hasKvLinear() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double kv_linear = 1;
+ * @return this
+ */
+ public ProtobufDifferentialDriveFeedforward clearKvLinear() {
+ bitField0_ &= ~0x00000001;
+ kvLinear = 0D;
+ return this;
+ }
+
+ /**
+ * optional double kv_linear = 1;
+ * @return the kvLinear
+ */
+ public double getKvLinear() {
+ return kvLinear;
+ }
+
+ /**
+ * optional double kv_linear = 1;
+ * @param value the kvLinear to set
+ * @return this
+ */
+ public ProtobufDifferentialDriveFeedforward setKvLinear(final double value) {
+ bitField0_ |= 0x00000001;
+ kvLinear = value;
+ return this;
+ }
+
+ /**
+ * optional double ka_linear = 2;
+ * @return whether the kaLinear field is set
+ */
+ public boolean hasKaLinear() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double ka_linear = 2;
+ * @return this
+ */
+ public ProtobufDifferentialDriveFeedforward clearKaLinear() {
+ bitField0_ &= ~0x00000002;
+ kaLinear = 0D;
+ return this;
+ }
+
+ /**
+ * optional double ka_linear = 2;
+ * @return the kaLinear
+ */
+ public double getKaLinear() {
+ return kaLinear;
+ }
+
+ /**
+ * optional double ka_linear = 2;
+ * @param value the kaLinear to set
+ * @return this
+ */
+ public ProtobufDifferentialDriveFeedforward setKaLinear(final double value) {
+ bitField0_ |= 0x00000002;
+ kaLinear = value;
+ return this;
+ }
+
+ /**
+ * optional double kv_angular = 3;
+ * @return whether the kvAngular field is set
+ */
+ public boolean hasKvAngular() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double kv_angular = 3;
+ * @return this
+ */
+ public ProtobufDifferentialDriveFeedforward clearKvAngular() {
+ bitField0_ &= ~0x00000004;
+ kvAngular = 0D;
+ return this;
+ }
+
+ /**
+ * optional double kv_angular = 3;
+ * @return the kvAngular
+ */
+ public double getKvAngular() {
+ return kvAngular;
+ }
+
+ /**
+ * optional double kv_angular = 3;
+ * @param value the kvAngular to set
+ * @return this
+ */
+ public ProtobufDifferentialDriveFeedforward setKvAngular(final double value) {
+ bitField0_ |= 0x00000004;
+ kvAngular = value;
+ return this;
+ }
+
+ /**
+ * optional double ka_angular = 4;
+ * @return whether the kaAngular field is set
+ */
+ public boolean hasKaAngular() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional double ka_angular = 4;
+ * @return this
+ */
+ public ProtobufDifferentialDriveFeedforward clearKaAngular() {
+ bitField0_ &= ~0x00000008;
+ kaAngular = 0D;
+ return this;
+ }
+
+ /**
+ * optional double ka_angular = 4;
+ * @return the kaAngular
+ */
+ public double getKaAngular() {
+ return kaAngular;
+ }
+
+ /**
+ * optional double ka_angular = 4;
+ * @param value the kaAngular to set
+ * @return this
+ */
+ public ProtobufDifferentialDriveFeedforward setKaAngular(final double value) {
+ bitField0_ |= 0x00000008;
+ kaAngular = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveFeedforward copyFrom(
+ final ProtobufDifferentialDriveFeedforward other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ kvLinear = other.kvLinear;
+ kaLinear = other.kaLinear;
+ kvAngular = other.kvAngular;
+ kaAngular = other.kaAngular;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveFeedforward mergeFrom(
+ final ProtobufDifferentialDriveFeedforward other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasKvLinear()) {
+ setKvLinear(other.kvLinear);
+ }
+ if (other.hasKaLinear()) {
+ setKaLinear(other.kaLinear);
+ }
+ if (other.hasKvAngular()) {
+ setKvAngular(other.kvAngular);
+ }
+ if (other.hasKaAngular()) {
+ setKaAngular(other.kaAngular);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveFeedforward clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ kvLinear = 0D;
+ kaLinear = 0D;
+ kvAngular = 0D;
+ kaAngular = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveFeedforward clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufDifferentialDriveFeedforward)) {
+ return false;
+ }
+ ProtobufDifferentialDriveFeedforward other = (ProtobufDifferentialDriveFeedforward) o;
+ return bitField0_ == other.bitField0_
+ && (!hasKvLinear() || ProtoUtil.isEqual(kvLinear, other.kvLinear))
+ && (!hasKaLinear() || ProtoUtil.isEqual(kaLinear, other.kaLinear))
+ && (!hasKvAngular() || ProtoUtil.isEqual(kvAngular, other.kvAngular))
+ && (!hasKaAngular() || ProtoUtil.isEqual(kaAngular, other.kaAngular));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(kvLinear);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(kaLinear);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(kvAngular);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 33);
+ output.writeDoubleNoTag(kaAngular);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufDifferentialDriveFeedforward mergeFrom(final ProtoSource input) throws
+ IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // kvLinear
+ kvLinear = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // kaLinear
+ kaLinear = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // kvAngular
+ kvAngular = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 33) {
+ break;
+ }
+ }
+ case 33: {
+ // kaAngular
+ kaAngular = input.readDouble();
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.kvLinear, kvLinear);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.kaLinear, kaLinear);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.kvAngular, kvAngular);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeDouble(FieldNames.kaAngular, kaAngular);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufDifferentialDriveFeedforward mergeFrom(final JsonSource input) throws
+ IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 1424526448:
+ case 974889081: {
+ if (input.isAtField(FieldNames.kvLinear)) {
+ if (!input.trySkipNullValue()) {
+ kvLinear = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -33181669:
+ case -1264389586: {
+ if (input.isAtField(FieldNames.kaLinear)) {
+ if (!input.trySkipNullValue()) {
+ kaLinear = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 175208951:
+ case -878647538: {
+ if (input.isAtField(FieldNames.kvAngular)) {
+ if (!input.trySkipNullValue()) {
+ kvAngular = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -2064069716:
+ case -1576809479: {
+ if (input.isAtField(FieldNames.kaAngular)) {
+ if (!input.trySkipNullValue()) {
+ kaAngular = input.readDouble();
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveFeedforward clone() {
+ return new ProtobufDifferentialDriveFeedforward().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufDifferentialDriveFeedforward parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveFeedforward(), data).checkInitialized();
+ }
+
+ public static ProtobufDifferentialDriveFeedforward parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveFeedforward(), input).checkInitialized();
+ }
+
+ public static ProtobufDifferentialDriveFeedforward parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveFeedforward(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufDifferentialDriveFeedforward messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufDifferentialDriveFeedforwardFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Controller.wpi_proto_ProtobufDifferentialDriveFeedforward_descriptor;
+ }
+
+ private enum ProtobufDifferentialDriveFeedforwardFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufDifferentialDriveFeedforward create() {
+ return ProtobufDifferentialDriveFeedforward.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName kvLinear = FieldName.forField("kvLinear", "kv_linear");
+
+ static final FieldName kaLinear = FieldName.forField("kaLinear", "ka_linear");
+
+ static final FieldName kvAngular = FieldName.forField("kvAngular", "kv_angular");
+
+ static final FieldName kaAngular = FieldName.forField("kaAngular", "ka_angular");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufElevatorFeedforward}
+ */
+ public static final class ProtobufElevatorFeedforward extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double ks = 1;
+ */
+ private double ks;
+
+ /**
+ * optional double kg = 2;
+ */
+ private double kg;
+
+ /**
+ * optional double kv = 3;
+ */
+ private double kv;
+
+ /**
+ * optional double ka = 4;
+ */
+ private double ka;
+
+ private ProtobufElevatorFeedforward() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufElevatorFeedforward}
+ */
+ public static ProtobufElevatorFeedforward newInstance() {
+ return new ProtobufElevatorFeedforward();
+ }
+
+ /**
+ * optional double ks = 1;
+ * @return whether the ks field is set
+ */
+ public boolean hasKs() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double ks = 1;
+ * @return this
+ */
+ public ProtobufElevatorFeedforward clearKs() {
+ bitField0_ &= ~0x00000001;
+ ks = 0D;
+ return this;
+ }
+
+ /**
+ * optional double ks = 1;
+ * @return the ks
+ */
+ public double getKs() {
+ return ks;
+ }
+
+ /**
+ * optional double ks = 1;
+ * @param value the ks to set
+ * @return this
+ */
+ public ProtobufElevatorFeedforward setKs(final double value) {
+ bitField0_ |= 0x00000001;
+ ks = value;
+ return this;
+ }
+
+ /**
+ * optional double kg = 2;
+ * @return whether the kg field is set
+ */
+ public boolean hasKg() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double kg = 2;
+ * @return this
+ */
+ public ProtobufElevatorFeedforward clearKg() {
+ bitField0_ &= ~0x00000002;
+ kg = 0D;
+ return this;
+ }
+
+ /**
+ * optional double kg = 2;
+ * @return the kg
+ */
+ public double getKg() {
+ return kg;
+ }
+
+ /**
+ * optional double kg = 2;
+ * @param value the kg to set
+ * @return this
+ */
+ public ProtobufElevatorFeedforward setKg(final double value) {
+ bitField0_ |= 0x00000002;
+ kg = value;
+ return this;
+ }
+
+ /**
+ * optional double kv = 3;
+ * @return whether the kv field is set
+ */
+ public boolean hasKv() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double kv = 3;
+ * @return this
+ */
+ public ProtobufElevatorFeedforward clearKv() {
+ bitField0_ &= ~0x00000004;
+ kv = 0D;
+ return this;
+ }
+
+ /**
+ * optional double kv = 3;
+ * @return the kv
+ */
+ public double getKv() {
+ return kv;
+ }
+
+ /**
+ * optional double kv = 3;
+ * @param value the kv to set
+ * @return this
+ */
+ public ProtobufElevatorFeedforward setKv(final double value) {
+ bitField0_ |= 0x00000004;
+ kv = value;
+ return this;
+ }
+
+ /**
+ * optional double ka = 4;
+ * @return whether the ka field is set
+ */
+ public boolean hasKa() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional double ka = 4;
+ * @return this
+ */
+ public ProtobufElevatorFeedforward clearKa() {
+ bitField0_ &= ~0x00000008;
+ ka = 0D;
+ return this;
+ }
+
+ /**
+ * optional double ka = 4;
+ * @return the ka
+ */
+ public double getKa() {
+ return ka;
+ }
+
+ /**
+ * optional double ka = 4;
+ * @param value the ka to set
+ * @return this
+ */
+ public ProtobufElevatorFeedforward setKa(final double value) {
+ bitField0_ |= 0x00000008;
+ ka = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufElevatorFeedforward copyFrom(final ProtobufElevatorFeedforward other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ ks = other.ks;
+ kg = other.kg;
+ kv = other.kv;
+ ka = other.ka;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufElevatorFeedforward mergeFrom(final ProtobufElevatorFeedforward other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasKs()) {
+ setKs(other.ks);
+ }
+ if (other.hasKg()) {
+ setKg(other.kg);
+ }
+ if (other.hasKv()) {
+ setKv(other.kv);
+ }
+ if (other.hasKa()) {
+ setKa(other.ka);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufElevatorFeedforward clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ ks = 0D;
+ kg = 0D;
+ kv = 0D;
+ ka = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufElevatorFeedforward clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufElevatorFeedforward)) {
+ return false;
+ }
+ ProtobufElevatorFeedforward other = (ProtobufElevatorFeedforward) o;
+ return bitField0_ == other.bitField0_
+ && (!hasKs() || ProtoUtil.isEqual(ks, other.ks))
+ && (!hasKg() || ProtoUtil.isEqual(kg, other.kg))
+ && (!hasKv() || ProtoUtil.isEqual(kv, other.kv))
+ && (!hasKa() || ProtoUtil.isEqual(ka, other.ka));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(ks);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(kg);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(kv);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 33);
+ output.writeDoubleNoTag(ka);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufElevatorFeedforward mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // ks
+ ks = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // kg
+ kg = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // kv
+ kv = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 33) {
+ break;
+ }
+ }
+ case 33: {
+ // ka
+ ka = input.readDouble();
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.ks, ks);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.kg, kg);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.kv, kv);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeDouble(FieldNames.ka, ka);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufElevatorFeedforward mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 3432: {
+ if (input.isAtField(FieldNames.ks)) {
+ if (!input.trySkipNullValue()) {
+ ks = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3420: {
+ if (input.isAtField(FieldNames.kg)) {
+ if (!input.trySkipNullValue()) {
+ kg = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3435: {
+ if (input.isAtField(FieldNames.kv)) {
+ if (!input.trySkipNullValue()) {
+ kv = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3414: {
+ if (input.isAtField(FieldNames.ka)) {
+ if (!input.trySkipNullValue()) {
+ ka = input.readDouble();
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufElevatorFeedforward clone() {
+ return new ProtobufElevatorFeedforward().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufElevatorFeedforward parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufElevatorFeedforward(), data).checkInitialized();
+ }
+
+ public static ProtobufElevatorFeedforward parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufElevatorFeedforward(), input).checkInitialized();
+ }
+
+ public static ProtobufElevatorFeedforward parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufElevatorFeedforward(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufElevatorFeedforward messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufElevatorFeedforwardFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Controller.wpi_proto_ProtobufElevatorFeedforward_descriptor;
+ }
+
+ private enum ProtobufElevatorFeedforwardFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufElevatorFeedforward create() {
+ return ProtobufElevatorFeedforward.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName ks = FieldName.forField("ks");
+
+ static final FieldName kg = FieldName.forField("kg");
+
+ static final FieldName kv = FieldName.forField("kv");
+
+ static final FieldName ka = FieldName.forField("ka");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufSimpleMotorFeedforward}
+ */
+ public static final class ProtobufSimpleMotorFeedforward extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double ks = 1;
+ */
+ private double ks;
+
+ /**
+ * optional double kv = 2;
+ */
+ private double kv;
+
+ /**
+ * optional double ka = 3;
+ */
+ private double ka;
+
+ private ProtobufSimpleMotorFeedforward() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufSimpleMotorFeedforward}
+ */
+ public static ProtobufSimpleMotorFeedforward newInstance() {
+ return new ProtobufSimpleMotorFeedforward();
+ }
+
+ /**
+ * optional double ks = 1;
+ * @return whether the ks field is set
+ */
+ public boolean hasKs() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double ks = 1;
+ * @return this
+ */
+ public ProtobufSimpleMotorFeedforward clearKs() {
+ bitField0_ &= ~0x00000001;
+ ks = 0D;
+ return this;
+ }
+
+ /**
+ * optional double ks = 1;
+ * @return the ks
+ */
+ public double getKs() {
+ return ks;
+ }
+
+ /**
+ * optional double ks = 1;
+ * @param value the ks to set
+ * @return this
+ */
+ public ProtobufSimpleMotorFeedforward setKs(final double value) {
+ bitField0_ |= 0x00000001;
+ ks = value;
+ return this;
+ }
+
+ /**
+ * optional double kv = 2;
+ * @return whether the kv field is set
+ */
+ public boolean hasKv() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double kv = 2;
+ * @return this
+ */
+ public ProtobufSimpleMotorFeedforward clearKv() {
+ bitField0_ &= ~0x00000002;
+ kv = 0D;
+ return this;
+ }
+
+ /**
+ * optional double kv = 2;
+ * @return the kv
+ */
+ public double getKv() {
+ return kv;
+ }
+
+ /**
+ * optional double kv = 2;
+ * @param value the kv to set
+ * @return this
+ */
+ public ProtobufSimpleMotorFeedforward setKv(final double value) {
+ bitField0_ |= 0x00000002;
+ kv = value;
+ return this;
+ }
+
+ /**
+ * optional double ka = 3;
+ * @return whether the ka field is set
+ */
+ public boolean hasKa() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double ka = 3;
+ * @return this
+ */
+ public ProtobufSimpleMotorFeedforward clearKa() {
+ bitField0_ &= ~0x00000004;
+ ka = 0D;
+ return this;
+ }
+
+ /**
+ * optional double ka = 3;
+ * @return the ka
+ */
+ public double getKa() {
+ return ka;
+ }
+
+ /**
+ * optional double ka = 3;
+ * @param value the ka to set
+ * @return this
+ */
+ public ProtobufSimpleMotorFeedforward setKa(final double value) {
+ bitField0_ |= 0x00000004;
+ ka = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufSimpleMotorFeedforward copyFrom(final ProtobufSimpleMotorFeedforward other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ ks = other.ks;
+ kv = other.kv;
+ ka = other.ka;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufSimpleMotorFeedforward mergeFrom(final ProtobufSimpleMotorFeedforward other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasKs()) {
+ setKs(other.ks);
+ }
+ if (other.hasKv()) {
+ setKv(other.kv);
+ }
+ if (other.hasKa()) {
+ setKa(other.ka);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufSimpleMotorFeedforward clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ ks = 0D;
+ kv = 0D;
+ ka = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufSimpleMotorFeedforward clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufSimpleMotorFeedforward)) {
+ return false;
+ }
+ ProtobufSimpleMotorFeedforward other = (ProtobufSimpleMotorFeedforward) o;
+ return bitField0_ == other.bitField0_
+ && (!hasKs() || ProtoUtil.isEqual(ks, other.ks))
+ && (!hasKv() || ProtoUtil.isEqual(kv, other.kv))
+ && (!hasKa() || ProtoUtil.isEqual(ka, other.ka));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(ks);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(kv);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(ka);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufSimpleMotorFeedforward mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // ks
+ ks = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // kv
+ kv = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // ka
+ ka = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.ks, ks);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.kv, kv);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.ka, ka);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufSimpleMotorFeedforward mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 3432: {
+ if (input.isAtField(FieldNames.ks)) {
+ if (!input.trySkipNullValue()) {
+ ks = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3435: {
+ if (input.isAtField(FieldNames.kv)) {
+ if (!input.trySkipNullValue()) {
+ kv = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3414: {
+ if (input.isAtField(FieldNames.ka)) {
+ if (!input.trySkipNullValue()) {
+ ka = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufSimpleMotorFeedforward clone() {
+ return new ProtobufSimpleMotorFeedforward().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufSimpleMotorFeedforward parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufSimpleMotorFeedforward(), data).checkInitialized();
+ }
+
+ public static ProtobufSimpleMotorFeedforward parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufSimpleMotorFeedforward(), input).checkInitialized();
+ }
+
+ public static ProtobufSimpleMotorFeedforward parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufSimpleMotorFeedforward(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufSimpleMotorFeedforward messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufSimpleMotorFeedforwardFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Controller.wpi_proto_ProtobufSimpleMotorFeedforward_descriptor;
+ }
+
+ private enum ProtobufSimpleMotorFeedforwardFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufSimpleMotorFeedforward create() {
+ return ProtobufSimpleMotorFeedforward.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName ks = FieldName.forField("ks");
+
+ static final FieldName kv = FieldName.forField("kv");
+
+ static final FieldName ka = FieldName.forField("ka");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufDifferentialDriveWheelVoltages}
+ */
+ public static final class ProtobufDifferentialDriveWheelVoltages extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double left = 1;
+ */
+ private double left;
+
+ /**
+ * optional double right = 2;
+ */
+ private double right;
+
+ private ProtobufDifferentialDriveWheelVoltages() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufDifferentialDriveWheelVoltages}
+ */
+ public static ProtobufDifferentialDriveWheelVoltages newInstance() {
+ return new ProtobufDifferentialDriveWheelVoltages();
+ }
+
+ /**
+ * optional double left = 1;
+ * @return whether the left field is set
+ */
+ public boolean hasLeft() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double left = 1;
+ * @return this
+ */
+ public ProtobufDifferentialDriveWheelVoltages clearLeft() {
+ bitField0_ &= ~0x00000001;
+ left = 0D;
+ return this;
+ }
+
+ /**
+ * optional double left = 1;
+ * @return the left
+ */
+ public double getLeft() {
+ return left;
+ }
+
+ /**
+ * optional double left = 1;
+ * @param value the left to set
+ * @return this
+ */
+ public ProtobufDifferentialDriveWheelVoltages setLeft(final double value) {
+ bitField0_ |= 0x00000001;
+ left = value;
+ return this;
+ }
+
+ /**
+ * optional double right = 2;
+ * @return whether the right field is set
+ */
+ public boolean hasRight() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double right = 2;
+ * @return this
+ */
+ public ProtobufDifferentialDriveWheelVoltages clearRight() {
+ bitField0_ &= ~0x00000002;
+ right = 0D;
+ return this;
+ }
+
+ /**
+ * optional double right = 2;
+ * @return the right
+ */
+ public double getRight() {
+ return right;
+ }
+
+ /**
+ * optional double right = 2;
+ * @param value the right to set
+ * @return this
+ */
+ public ProtobufDifferentialDriveWheelVoltages setRight(final double value) {
+ bitField0_ |= 0x00000002;
+ right = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelVoltages copyFrom(
+ final ProtobufDifferentialDriveWheelVoltages other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ left = other.left;
+ right = other.right;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelVoltages mergeFrom(
+ final ProtobufDifferentialDriveWheelVoltages other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasLeft()) {
+ setLeft(other.left);
+ }
+ if (other.hasRight()) {
+ setRight(other.right);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelVoltages clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ left = 0D;
+ right = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelVoltages clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufDifferentialDriveWheelVoltages)) {
+ return false;
+ }
+ ProtobufDifferentialDriveWheelVoltages other = (ProtobufDifferentialDriveWheelVoltages) o;
+ return bitField0_ == other.bitField0_
+ && (!hasLeft() || ProtoUtil.isEqual(left, other.left))
+ && (!hasRight() || ProtoUtil.isEqual(right, other.right));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(left);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(right);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufDifferentialDriveWheelVoltages mergeFrom(final ProtoSource input) throws
+ IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // left
+ left = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // right
+ right = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.left, left);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.right, right);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelVoltages mergeFrom(final JsonSource input) throws
+ IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 3317767: {
+ if (input.isAtField(FieldNames.left)) {
+ if (!input.trySkipNullValue()) {
+ left = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 108511772: {
+ if (input.isAtField(FieldNames.right)) {
+ if (!input.trySkipNullValue()) {
+ right = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelVoltages clone() {
+ return new ProtobufDifferentialDriveWheelVoltages().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufDifferentialDriveWheelVoltages parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelVoltages(), data).checkInitialized();
+ }
+
+ public static ProtobufDifferentialDriveWheelVoltages parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelVoltages(), input).checkInitialized();
+ }
+
+ public static ProtobufDifferentialDriveWheelVoltages parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelVoltages(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufDifferentialDriveWheelVoltages messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufDifferentialDriveWheelVoltagesFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Controller.wpi_proto_ProtobufDifferentialDriveWheelVoltages_descriptor;
+ }
+
+ private enum ProtobufDifferentialDriveWheelVoltagesFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufDifferentialDriveWheelVoltages create() {
+ return ProtobufDifferentialDriveWheelVoltages.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName left = FieldName.forField("left");
+
+ static final FieldName right = FieldName.forField("right");
+ }
+ }
+}
diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Geometry2D.java b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Geometry2D.java
new file mode 100644
index 0000000000..331ccd1c8a
--- /dev/null
+++ b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Geometry2D.java
@@ -0,0 +1,1806 @@
+// Copyright (c) FIRST and other WPILib contributors.
+// Open Source Software; you can modify and/or share it under the terms of
+// the WPILib BSD license file in the root directory of this project.
+// Code generated by protocol buffer compiler. Do not edit!
+package edu.wpi.first.math.proto;
+
+import java.io.IOException;
+import us.hebi.quickbuf.Descriptors;
+import us.hebi.quickbuf.FieldName;
+import us.hebi.quickbuf.InvalidProtocolBufferException;
+import us.hebi.quickbuf.JsonSink;
+import us.hebi.quickbuf.JsonSource;
+import us.hebi.quickbuf.MessageFactory;
+import us.hebi.quickbuf.ProtoMessage;
+import us.hebi.quickbuf.ProtoSink;
+import us.hebi.quickbuf.ProtoSource;
+import us.hebi.quickbuf.ProtoUtil;
+import us.hebi.quickbuf.RepeatedByte;
+
+public final class Geometry2D {
+ private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(1256,
+ "ChBnZW9tZXRyeTJkLnByb3RvEgl3cGkucHJvdG8iMwoVUHJvdG9idWZUcmFuc2xhdGlvbjJkEgwKAXgY" +
+ "ASABKAFSAXgSDAoBeRgCIAEoAVIBeSIqChJQcm90b2J1ZlJvdGF0aW9uMmQSFAoFdmFsdWUYASABKAFS" +
+ "BXZhbHVlIo8BCg5Qcm90b2J1ZlBvc2UyZBJCCgt0cmFuc2xhdGlvbhgBIAEoCzIgLndwaS5wcm90by5Q" +
+ "cm90b2J1ZlRyYW5zbGF0aW9uMmRSC3RyYW5zbGF0aW9uEjkKCHJvdGF0aW9uGAIgASgLMh0ud3BpLnBy" +
+ "b3RvLlByb3RvYnVmUm90YXRpb24yZFIIcm90YXRpb24ilAEKE1Byb3RvYnVmVHJhbnNmb3JtMmQSQgoL" +
+ "dHJhbnNsYXRpb24YASABKAsyIC53cGkucHJvdG8uUHJvdG9idWZUcmFuc2xhdGlvbjJkUgt0cmFuc2xh" +
+ "dGlvbhI5Cghyb3RhdGlvbhgCIAEoCzIdLndwaS5wcm90by5Qcm90b2J1ZlJvdGF0aW9uMmRSCHJvdGF0" +
+ "aW9uIkkKD1Byb3RvYnVmVHdpc3QyZBIOCgJkeBgBIAEoAVICZHgSDgoCZHkYAiABKAFSAmR5EhYKBmR0" +
+ "aGV0YRgDIAEoAVIGZHRoZXRhQhoKGGVkdS53cGkuZmlyc3QubWF0aC5wcm90b0rPBQoGEgQAAB0BCggK" +
+ "AQwSAwAAEgoICgECEgMCABIKCAoBCBIDBAAxCgkKAggBEgMEADEKCgoCBAASBAYACQEKCgoDBAABEgMG" +
+ "CB0KCwoEBAACABIDBwIPCgwKBQQAAgAFEgMHAggKDAoFBAACAAESAwcJCgoMCgUEAAIAAxIDBw0OCgsK" +
+ "BAQAAgESAwgCDwoMCgUEAAIBBRIDCAIICgwKBQQAAgEBEgMICQoKDAoFBAACAQMSAwgNDgoKCgIEARIE" +
+ "CwANAQoKCgMEAQESAwsIGgoLCgQEAQIAEgMMAhMKDAoFBAECAAUSAwwCCAoMCgUEAQIAARIDDAkOCgwK" +
+ "BQQBAgADEgMMERIKCgoCBAISBA8AEgEKCgoDBAIBEgMPCBYKCwoEBAICABIDEAIoCgwKBQQCAgAGEgMQ" +
+ "AhcKDAoFBAICAAESAxAYIwoMCgUEAgIAAxIDECYnCgsKBAQCAgESAxECIgoMCgUEAgIBBhIDEQIUCgwK" +
+ "BQQCAgEBEgMRFR0KDAoFBAICAQMSAxEgIQoKCgIEAxIEFAAXAQoKCgMEAwESAxQIGwoLCgQEAwIAEgMV" +
+ "AigKDAoFBAMCAAYSAxUCFwoMCgUEAwIAARIDFRgjCgwKBQQDAgADEgMVJicKCwoEBAMCARIDFgIiCgwK" +
+ "BQQDAgEGEgMWAhQKDAoFBAMCAQESAxYVHQoMCgUEAwIBAxIDFiAhCgoKAgQEEgQZAB0BCgoKAwQEARID" +
+ "GQgXCgsKBAQEAgASAxoCEAoMCgUEBAIABRIDGgIICgwKBQQEAgABEgMaCQsKDAoFBAQCAAMSAxoODwoL" +
+ "CgQEBAIBEgMbAhAKDAoFBAQCAQUSAxsCCAoMCgUEBAIBARIDGwkLCgwKBQQEAgEDEgMbDg8KCwoEBAQC",
+ "AhIDHAIUCgwKBQQEAgIFEgMcAggKDAoFBAQCAgESAxwJDwoMCgUEBAICAxIDHBITYgZwcm90bzM=");
+
+ static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("geometry2d.proto", "wpi.proto", descriptorData);
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufTranslation2d_descriptor = descriptor.internalContainedType(31, 51, "ProtobufTranslation2d", "wpi.proto.ProtobufTranslation2d");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufRotation2d_descriptor = descriptor.internalContainedType(84, 42, "ProtobufRotation2d", "wpi.proto.ProtobufRotation2d");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufPose2d_descriptor = descriptor.internalContainedType(129, 143, "ProtobufPose2d", "wpi.proto.ProtobufPose2d");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufTransform2d_descriptor = descriptor.internalContainedType(275, 148, "ProtobufTransform2d", "wpi.proto.ProtobufTransform2d");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufTwist2d_descriptor = descriptor.internalContainedType(425, 73, "ProtobufTwist2d", "wpi.proto.ProtobufTwist2d");
+
+ /**
+ * @return this proto file's descriptor.
+ */
+ public static Descriptors.FileDescriptor getDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Protobuf type {@code ProtobufTranslation2d}
+ */
+ public static final class ProtobufTranslation2d extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double x = 1;
+ */
+ private double x;
+
+ /**
+ * optional double y = 2;
+ */
+ private double y;
+
+ private ProtobufTranslation2d() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufTranslation2d}
+ */
+ public static ProtobufTranslation2d newInstance() {
+ return new ProtobufTranslation2d();
+ }
+
+ /**
+ * optional double x = 1;
+ * @return whether the x field is set
+ */
+ public boolean hasX() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double x = 1;
+ * @return this
+ */
+ public ProtobufTranslation2d clearX() {
+ bitField0_ &= ~0x00000001;
+ x = 0D;
+ return this;
+ }
+
+ /**
+ * optional double x = 1;
+ * @return the x
+ */
+ public double getX() {
+ return x;
+ }
+
+ /**
+ * optional double x = 1;
+ * @param value the x to set
+ * @return this
+ */
+ public ProtobufTranslation2d setX(final double value) {
+ bitField0_ |= 0x00000001;
+ x = value;
+ return this;
+ }
+
+ /**
+ * optional double y = 2;
+ * @return whether the y field is set
+ */
+ public boolean hasY() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double y = 2;
+ * @return this
+ */
+ public ProtobufTranslation2d clearY() {
+ bitField0_ &= ~0x00000002;
+ y = 0D;
+ return this;
+ }
+
+ /**
+ * optional double y = 2;
+ * @return the y
+ */
+ public double getY() {
+ return y;
+ }
+
+ /**
+ * optional double y = 2;
+ * @param value the y to set
+ * @return this
+ */
+ public ProtobufTranslation2d setY(final double value) {
+ bitField0_ |= 0x00000002;
+ y = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufTranslation2d copyFrom(final ProtobufTranslation2d other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ x = other.x;
+ y = other.y;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTranslation2d mergeFrom(final ProtobufTranslation2d other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasX()) {
+ setX(other.x);
+ }
+ if (other.hasY()) {
+ setY(other.y);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTranslation2d clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ x = 0D;
+ y = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufTranslation2d clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufTranslation2d)) {
+ return false;
+ }
+ ProtobufTranslation2d other = (ProtobufTranslation2d) o;
+ return bitField0_ == other.bitField0_
+ && (!hasX() || ProtoUtil.isEqual(x, other.x))
+ && (!hasY() || ProtoUtil.isEqual(y, other.y));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(x);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(y);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufTranslation2d mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // x
+ x = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // y
+ y = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.x, x);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.y, y);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufTranslation2d mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 120: {
+ if (input.isAtField(FieldNames.x)) {
+ if (!input.trySkipNullValue()) {
+ x = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 121: {
+ if (input.isAtField(FieldNames.y)) {
+ if (!input.trySkipNullValue()) {
+ y = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufTranslation2d clone() {
+ return new ProtobufTranslation2d().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufTranslation2d parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufTranslation2d(), data).checkInitialized();
+ }
+
+ public static ProtobufTranslation2d parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTranslation2d(), input).checkInitialized();
+ }
+
+ public static ProtobufTranslation2d parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTranslation2d(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufTranslation2d messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufTranslation2dFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Geometry2D.wpi_proto_ProtobufTranslation2d_descriptor;
+ }
+
+ private enum ProtobufTranslation2dFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufTranslation2d create() {
+ return ProtobufTranslation2d.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName x = FieldName.forField("x");
+
+ static final FieldName y = FieldName.forField("y");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufRotation2d}
+ */
+ public static final class ProtobufRotation2d extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double value = 1;
+ */
+ private double value_;
+
+ private ProtobufRotation2d() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufRotation2d}
+ */
+ public static ProtobufRotation2d newInstance() {
+ return new ProtobufRotation2d();
+ }
+
+ /**
+ * optional double value = 1;
+ * @return whether the value_ field is set
+ */
+ public boolean hasValue() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double value = 1;
+ * @return this
+ */
+ public ProtobufRotation2d clearValue() {
+ bitField0_ &= ~0x00000001;
+ value_ = 0D;
+ return this;
+ }
+
+ /**
+ * optional double value = 1;
+ * @return the value_
+ */
+ public double getValue() {
+ return value_;
+ }
+
+ /**
+ * optional double value = 1;
+ * @param value the value_ to set
+ * @return this
+ */
+ public ProtobufRotation2d setValue(final double value) {
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufRotation2d copyFrom(final ProtobufRotation2d other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ value_ = other.value_;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufRotation2d mergeFrom(final ProtobufRotation2d other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasValue()) {
+ setValue(other.value_);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufRotation2d clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ value_ = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufRotation2d clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufRotation2d)) {
+ return false;
+ }
+ ProtobufRotation2d other = (ProtobufRotation2d) o;
+ return bitField0_ == other.bitField0_
+ && (!hasValue() || ProtoUtil.isEqual(value_, other.value_));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(value_);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufRotation2d mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // value_
+ value_ = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.value_, value_);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufRotation2d mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 111972721: {
+ if (input.isAtField(FieldNames.value_)) {
+ if (!input.trySkipNullValue()) {
+ value_ = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufRotation2d clone() {
+ return new ProtobufRotation2d().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufRotation2d parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufRotation2d(), data).checkInitialized();
+ }
+
+ public static ProtobufRotation2d parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufRotation2d(), input).checkInitialized();
+ }
+
+ public static ProtobufRotation2d parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufRotation2d(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufRotation2d messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufRotation2dFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Geometry2D.wpi_proto_ProtobufRotation2d_descriptor;
+ }
+
+ private enum ProtobufRotation2dFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufRotation2d create() {
+ return ProtobufRotation2d.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName value_ = FieldName.forField("value");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufPose2d}
+ */
+ public static final class ProtobufPose2d extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ */
+ private final ProtobufTranslation2d translation = ProtobufTranslation2d.newInstance();
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ */
+ private final ProtobufRotation2d rotation = ProtobufRotation2d.newInstance();
+
+ private ProtobufPose2d() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufPose2d}
+ */
+ public static ProtobufPose2d newInstance() {
+ return new ProtobufPose2d();
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ * @return whether the translation field is set
+ */
+ public boolean hasTranslation() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ * @return this
+ */
+ public ProtobufPose2d clearTranslation() {
+ bitField0_ &= ~0x00000001;
+ translation.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableTranslation()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public ProtobufTranslation2d getTranslation() {
+ return translation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public ProtobufTranslation2d getMutableTranslation() {
+ bitField0_ |= 0x00000001;
+ return translation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ * @param value the translation to set
+ * @return this
+ */
+ public ProtobufPose2d setTranslation(final ProtobufTranslation2d value) {
+ bitField0_ |= 0x00000001;
+ translation.copyFrom(value);
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ * @return whether the rotation field is set
+ */
+ public boolean hasRotation() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ * @return this
+ */
+ public ProtobufPose2d clearRotation() {
+ bitField0_ &= ~0x00000002;
+ rotation.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableRotation()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public ProtobufRotation2d getRotation() {
+ return rotation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public ProtobufRotation2d getMutableRotation() {
+ bitField0_ |= 0x00000002;
+ return rotation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ * @param value the rotation to set
+ * @return this
+ */
+ public ProtobufPose2d setRotation(final ProtobufRotation2d value) {
+ bitField0_ |= 0x00000002;
+ rotation.copyFrom(value);
+ return this;
+ }
+
+ @Override
+ public ProtobufPose2d copyFrom(final ProtobufPose2d other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ translation.copyFrom(other.translation);
+ rotation.copyFrom(other.rotation);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufPose2d mergeFrom(final ProtobufPose2d other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasTranslation()) {
+ getMutableTranslation().mergeFrom(other.translation);
+ }
+ if (other.hasRotation()) {
+ getMutableRotation().mergeFrom(other.rotation);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufPose2d clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ translation.clear();
+ rotation.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufPose2d clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ translation.clearQuick();
+ rotation.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufPose2d)) {
+ return false;
+ }
+ ProtobufPose2d other = (ProtobufPose2d) o;
+ return bitField0_ == other.bitField0_
+ && (!hasTranslation() || translation.equals(other.translation))
+ && (!hasRotation() || rotation.equals(other.rotation));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 10);
+ output.writeMessageNoTag(translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 18);
+ output.writeMessageNoTag(rotation);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(rotation);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufPose2d mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 10: {
+ // translation
+ input.readMessage(translation);
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 18) {
+ break;
+ }
+ }
+ case 18: {
+ // rotation
+ input.readMessage(rotation);
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeMessage(FieldNames.translation, translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeMessage(FieldNames.rotation, rotation);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufPose2d mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case -1840647503: {
+ if (input.isAtField(FieldNames.translation)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(translation);
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -40300674: {
+ if (input.isAtField(FieldNames.rotation)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(rotation);
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufPose2d clone() {
+ return new ProtobufPose2d().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufPose2d parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufPose2d(), data).checkInitialized();
+ }
+
+ public static ProtobufPose2d parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufPose2d(), input).checkInitialized();
+ }
+
+ public static ProtobufPose2d parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufPose2d(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufPose2d messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufPose2dFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Geometry2D.wpi_proto_ProtobufPose2d_descriptor;
+ }
+
+ private enum ProtobufPose2dFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufPose2d create() {
+ return ProtobufPose2d.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName translation = FieldName.forField("translation");
+
+ static final FieldName rotation = FieldName.forField("rotation");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufTransform2d}
+ */
+ public static final class ProtobufTransform2d extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ */
+ private final ProtobufTranslation2d translation = ProtobufTranslation2d.newInstance();
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ */
+ private final ProtobufRotation2d rotation = ProtobufRotation2d.newInstance();
+
+ private ProtobufTransform2d() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufTransform2d}
+ */
+ public static ProtobufTransform2d newInstance() {
+ return new ProtobufTransform2d();
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ * @return whether the translation field is set
+ */
+ public boolean hasTranslation() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ * @return this
+ */
+ public ProtobufTransform2d clearTranslation() {
+ bitField0_ &= ~0x00000001;
+ translation.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableTranslation()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public ProtobufTranslation2d getTranslation() {
+ return translation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public ProtobufTranslation2d getMutableTranslation() {
+ bitField0_ |= 0x00000001;
+ return translation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d translation = 1;
+ * @param value the translation to set
+ * @return this
+ */
+ public ProtobufTransform2d setTranslation(final ProtobufTranslation2d value) {
+ bitField0_ |= 0x00000001;
+ translation.copyFrom(value);
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ * @return whether the rotation field is set
+ */
+ public boolean hasRotation() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ * @return this
+ */
+ public ProtobufTransform2d clearRotation() {
+ bitField0_ &= ~0x00000002;
+ rotation.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableRotation()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public ProtobufRotation2d getRotation() {
+ return rotation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public ProtobufRotation2d getMutableRotation() {
+ bitField0_ |= 0x00000002;
+ return rotation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d rotation = 2;
+ * @param value the rotation to set
+ * @return this
+ */
+ public ProtobufTransform2d setRotation(final ProtobufRotation2d value) {
+ bitField0_ |= 0x00000002;
+ rotation.copyFrom(value);
+ return this;
+ }
+
+ @Override
+ public ProtobufTransform2d copyFrom(final ProtobufTransform2d other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ translation.copyFrom(other.translation);
+ rotation.copyFrom(other.rotation);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTransform2d mergeFrom(final ProtobufTransform2d other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasTranslation()) {
+ getMutableTranslation().mergeFrom(other.translation);
+ }
+ if (other.hasRotation()) {
+ getMutableRotation().mergeFrom(other.rotation);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTransform2d clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ translation.clear();
+ rotation.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufTransform2d clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ translation.clearQuick();
+ rotation.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufTransform2d)) {
+ return false;
+ }
+ ProtobufTransform2d other = (ProtobufTransform2d) o;
+ return bitField0_ == other.bitField0_
+ && (!hasTranslation() || translation.equals(other.translation))
+ && (!hasRotation() || rotation.equals(other.rotation));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 10);
+ output.writeMessageNoTag(translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 18);
+ output.writeMessageNoTag(rotation);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(rotation);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufTransform2d mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 10: {
+ // translation
+ input.readMessage(translation);
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 18) {
+ break;
+ }
+ }
+ case 18: {
+ // rotation
+ input.readMessage(rotation);
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeMessage(FieldNames.translation, translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeMessage(FieldNames.rotation, rotation);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufTransform2d mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case -1840647503: {
+ if (input.isAtField(FieldNames.translation)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(translation);
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -40300674: {
+ if (input.isAtField(FieldNames.rotation)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(rotation);
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufTransform2d clone() {
+ return new ProtobufTransform2d().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufTransform2d parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufTransform2d(), data).checkInitialized();
+ }
+
+ public static ProtobufTransform2d parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTransform2d(), input).checkInitialized();
+ }
+
+ public static ProtobufTransform2d parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTransform2d(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufTransform2d messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufTransform2dFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Geometry2D.wpi_proto_ProtobufTransform2d_descriptor;
+ }
+
+ private enum ProtobufTransform2dFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufTransform2d create() {
+ return ProtobufTransform2d.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName translation = FieldName.forField("translation");
+
+ static final FieldName rotation = FieldName.forField("rotation");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufTwist2d}
+ */
+ public static final class ProtobufTwist2d extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double dx = 1;
+ */
+ private double dx;
+
+ /**
+ * optional double dy = 2;
+ */
+ private double dy;
+
+ /**
+ * optional double dtheta = 3;
+ */
+ private double dtheta;
+
+ private ProtobufTwist2d() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufTwist2d}
+ */
+ public static ProtobufTwist2d newInstance() {
+ return new ProtobufTwist2d();
+ }
+
+ /**
+ * optional double dx = 1;
+ * @return whether the dx field is set
+ */
+ public boolean hasDx() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double dx = 1;
+ * @return this
+ */
+ public ProtobufTwist2d clearDx() {
+ bitField0_ &= ~0x00000001;
+ dx = 0D;
+ return this;
+ }
+
+ /**
+ * optional double dx = 1;
+ * @return the dx
+ */
+ public double getDx() {
+ return dx;
+ }
+
+ /**
+ * optional double dx = 1;
+ * @param value the dx to set
+ * @return this
+ */
+ public ProtobufTwist2d setDx(final double value) {
+ bitField0_ |= 0x00000001;
+ dx = value;
+ return this;
+ }
+
+ /**
+ * optional double dy = 2;
+ * @return whether the dy field is set
+ */
+ public boolean hasDy() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double dy = 2;
+ * @return this
+ */
+ public ProtobufTwist2d clearDy() {
+ bitField0_ &= ~0x00000002;
+ dy = 0D;
+ return this;
+ }
+
+ /**
+ * optional double dy = 2;
+ * @return the dy
+ */
+ public double getDy() {
+ return dy;
+ }
+
+ /**
+ * optional double dy = 2;
+ * @param value the dy to set
+ * @return this
+ */
+ public ProtobufTwist2d setDy(final double value) {
+ bitField0_ |= 0x00000002;
+ dy = value;
+ return this;
+ }
+
+ /**
+ * optional double dtheta = 3;
+ * @return whether the dtheta field is set
+ */
+ public boolean hasDtheta() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double dtheta = 3;
+ * @return this
+ */
+ public ProtobufTwist2d clearDtheta() {
+ bitField0_ &= ~0x00000004;
+ dtheta = 0D;
+ return this;
+ }
+
+ /**
+ * optional double dtheta = 3;
+ * @return the dtheta
+ */
+ public double getDtheta() {
+ return dtheta;
+ }
+
+ /**
+ * optional double dtheta = 3;
+ * @param value the dtheta to set
+ * @return this
+ */
+ public ProtobufTwist2d setDtheta(final double value) {
+ bitField0_ |= 0x00000004;
+ dtheta = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufTwist2d copyFrom(final ProtobufTwist2d other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ dx = other.dx;
+ dy = other.dy;
+ dtheta = other.dtheta;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTwist2d mergeFrom(final ProtobufTwist2d other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasDx()) {
+ setDx(other.dx);
+ }
+ if (other.hasDy()) {
+ setDy(other.dy);
+ }
+ if (other.hasDtheta()) {
+ setDtheta(other.dtheta);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTwist2d clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ dx = 0D;
+ dy = 0D;
+ dtheta = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufTwist2d clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufTwist2d)) {
+ return false;
+ }
+ ProtobufTwist2d other = (ProtobufTwist2d) o;
+ return bitField0_ == other.bitField0_
+ && (!hasDx() || ProtoUtil.isEqual(dx, other.dx))
+ && (!hasDy() || ProtoUtil.isEqual(dy, other.dy))
+ && (!hasDtheta() || ProtoUtil.isEqual(dtheta, other.dtheta));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(dx);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(dy);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(dtheta);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufTwist2d mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // dx
+ dx = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // dy
+ dy = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // dtheta
+ dtheta = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.dx, dx);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.dy, dy);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.dtheta, dtheta);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufTwist2d mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 3220: {
+ if (input.isAtField(FieldNames.dx)) {
+ if (!input.trySkipNullValue()) {
+ dx = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3221: {
+ if (input.isAtField(FieldNames.dy)) {
+ if (!input.trySkipNullValue()) {
+ dy = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -1321724742: {
+ if (input.isAtField(FieldNames.dtheta)) {
+ if (!input.trySkipNullValue()) {
+ dtheta = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufTwist2d clone() {
+ return new ProtobufTwist2d().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufTwist2d parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufTwist2d(), data).checkInitialized();
+ }
+
+ public static ProtobufTwist2d parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTwist2d(), input).checkInitialized();
+ }
+
+ public static ProtobufTwist2d parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTwist2d(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufTwist2d messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufTwist2dFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Geometry2D.wpi_proto_ProtobufTwist2d_descriptor;
+ }
+
+ private enum ProtobufTwist2dFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufTwist2d create() {
+ return ProtobufTwist2d.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName dx = FieldName.forField("dx");
+
+ static final FieldName dy = FieldName.forField("dy");
+
+ static final FieldName dtheta = FieldName.forField("dtheta");
+ }
+ }
+}
diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Geometry3D.java b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Geometry3D.java
new file mode 100644
index 0000000000..404d7b0719
--- /dev/null
+++ b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Geometry3D.java
@@ -0,0 +1,2652 @@
+// Copyright (c) FIRST and other WPILib contributors.
+// Open Source Software; you can modify and/or share it under the terms of
+// the WPILib BSD license file in the root directory of this project.
+// Code generated by protocol buffer compiler. Do not edit!
+package edu.wpi.first.math.proto;
+
+import java.io.IOException;
+import us.hebi.quickbuf.Descriptors;
+import us.hebi.quickbuf.FieldName;
+import us.hebi.quickbuf.InvalidProtocolBufferException;
+import us.hebi.quickbuf.JsonSink;
+import us.hebi.quickbuf.JsonSource;
+import us.hebi.quickbuf.MessageFactory;
+import us.hebi.quickbuf.ProtoMessage;
+import us.hebi.quickbuf.ProtoSink;
+import us.hebi.quickbuf.ProtoSource;
+import us.hebi.quickbuf.ProtoUtil;
+import us.hebi.quickbuf.RepeatedByte;
+
+public final class Geometry3D {
+ private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(1875,
+ "ChBnZW9tZXRyeTNkLnByb3RvEgl3cGkucHJvdG8iQQoVUHJvdG9idWZUcmFuc2xhdGlvbjNkEgwKAXgY" +
+ "ASABKAFSAXgSDAoBeRgCIAEoAVIBeRIMCgF6GAMgASgBUgF6IkwKElByb3RvYnVmUXVhdGVybmlvbhIM" +
+ "CgF3GAEgASgBUgF3EgwKAXgYAiABKAFSAXgSDAoBeRgDIAEoAVIBeRIMCgF6GAQgASgBUgF6IkEKElBy" +
+ "b3RvYnVmUm90YXRpb24zZBIrCgFxGAEgASgLMh0ud3BpLnByb3RvLlByb3RvYnVmUXVhdGVybmlvblIB" +
+ "cSKPAQoOUHJvdG9idWZQb3NlM2QSQgoLdHJhbnNsYXRpb24YASABKAsyIC53cGkucHJvdG8uUHJvdG9i" +
+ "dWZUcmFuc2xhdGlvbjNkUgt0cmFuc2xhdGlvbhI5Cghyb3RhdGlvbhgCIAEoCzIdLndwaS5wcm90by5Q" +
+ "cm90b2J1ZlJvdGF0aW9uM2RSCHJvdGF0aW9uIpQBChNQcm90b2J1ZlRyYW5zZm9ybTNkEkIKC3RyYW5z" +
+ "bGF0aW9uGAEgASgLMiAud3BpLnByb3RvLlByb3RvYnVmVHJhbnNsYXRpb24zZFILdHJhbnNsYXRpb24S" +
+ "OQoIcm90YXRpb24YAiABKAsyHS53cGkucHJvdG8uUHJvdG9idWZSb3RhdGlvbjNkUghyb3RhdGlvbiJx" +
+ "Cg9Qcm90b2J1ZlR3aXN0M2QSDgoCZHgYASABKAFSAmR4Eg4KAmR5GAIgASgBUgJkeRIOCgJkehgDIAEo" +
+ "AVICZHoSDgoCcngYBCABKAFSAnJ4Eg4KAnJ5GAUgASgBUgJyeRIOCgJyehgGIAEoAVICcnpCGgoYZWR1" +
+ "LndwaS5maXJzdC5tYXRoLnByb3RvSp8JCgYSBAAAKAEKCAoBDBIDAAASCggKAQISAwIAEgoICgEIEgME" +
+ "ADEKCQoCCAESAwQAMQoKCgIEABIEBgAKAQoKCgMEAAESAwYIHQoLCgQEAAIAEgMHAg8KDAoFBAACAAUS" +
+ "AwcCCAoMCgUEAAIAARIDBwkKCgwKBQQAAgADEgMHDQ4KCwoEBAACARIDCAIPCgwKBQQAAgEFEgMIAggK" +
+ "DAoFBAACAQESAwgJCgoMCgUEAAIBAxIDCA0OCgsKBAQAAgISAwkCDwoMCgUEAAICBRIDCQIICgwKBQQA" +
+ "AgIBEgMJCQoKDAoFBAACAgMSAwkNDgoKCgIEARIEDAARAQoKCgMEAQESAwwIGgoLCgQEAQIAEgMNAg8K" +
+ "DAoFBAECAAUSAw0CCAoMCgUEAQIAARIDDQkKCgwKBQQBAgADEgMNDQ4KCwoEBAECARIDDgIPCgwKBQQB" +
+ "AgEFEgMOAggKDAoFBAECAQESAw4JCgoMCgUEAQIBAxIDDg0OCgsKBAQBAgISAw8CDwoMCgUEAQICBRID" +
+ "DwIICgwKBQQBAgIBEgMPCQoKDAoFBAECAgMSAw8NDgoLCgQEAQIDEgMQAg8KDAoFBAECAwUSAxACCAoM" +
+ "CgUEAQIDARIDEAkKCgwKBQQBAgMDEgMQDQ4KCgoCBAISBBMAFQEKCgoDBAIBEgMTCBoKCwoEBAICABID",
+ "FAIbCgwKBQQCAgAGEgMUAhQKDAoFBAICAAESAxQVFgoMCgUEAgIAAxIDFBkaCgoKAgQDEgQXABoBCgoK" +
+ "AwQDARIDFwgWCgsKBAQDAgASAxgCKAoMCgUEAwIABhIDGAIXCgwKBQQDAgABEgMYGCMKDAoFBAMCAAMS" +
+ "AxgmJwoLCgQEAwIBEgMZAiIKDAoFBAMCAQYSAxkCFAoMCgUEAwIBARIDGRUdCgwKBQQDAgEDEgMZICEK" +
+ "CgoCBAQSBBwAHwEKCgoDBAQBEgMcCBsKCwoEBAQCABIDHQIoCgwKBQQEAgAGEgMdAhcKDAoFBAQCAAES" +
+ "Ax0YIwoMCgUEBAIAAxIDHSYnCgsKBAQEAgESAx4CIgoMCgUEBAIBBhIDHgIUCgwKBQQEAgEBEgMeFR0K" +
+ "DAoFBAQCAQMSAx4gIQoKCgIEBRIEIQAoAQoKCgMEBQESAyEIFwoLCgQEBQIAEgMiAhAKDAoFBAUCAAUS" +
+ "AyICCAoMCgUEBQIAARIDIgkLCgwKBQQFAgADEgMiDg8KCwoEBAUCARIDIwIQCgwKBQQFAgEFEgMjAggK" +
+ "DAoFBAUCAQESAyMJCwoMCgUEBQIBAxIDIw4PCgsKBAQFAgISAyQCEAoMCgUEBQICBRIDJAIICgwKBQQF" +
+ "AgIBEgMkCQsKDAoFBAUCAgMSAyQODwoLCgQEBQIDEgMlAhAKDAoFBAUCAwUSAyUCCAoMCgUEBQIDARID" +
+ "JQkLCgwKBQQFAgMDEgMlDg8KCwoEBAUCBBIDJgIQCgwKBQQFAgQFEgMmAggKDAoFBAUCBAESAyYJCwoM" +
+ "CgUEBQIEAxIDJg4PCgsKBAQFAgUSAycCEAoMCgUEBQIFBRIDJwIICgwKBQQFAgUBEgMnCQsKDAoFBAUC" +
+ "BQMSAycOD2IGcHJvdG8z");
+
+ static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("geometry3d.proto", "wpi.proto", descriptorData);
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufTranslation3d_descriptor = descriptor.internalContainedType(31, 65, "ProtobufTranslation3d", "wpi.proto.ProtobufTranslation3d");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufQuaternion_descriptor = descriptor.internalContainedType(98, 76, "ProtobufQuaternion", "wpi.proto.ProtobufQuaternion");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufRotation3d_descriptor = descriptor.internalContainedType(176, 65, "ProtobufRotation3d", "wpi.proto.ProtobufRotation3d");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufPose3d_descriptor = descriptor.internalContainedType(244, 143, "ProtobufPose3d", "wpi.proto.ProtobufPose3d");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufTransform3d_descriptor = descriptor.internalContainedType(390, 148, "ProtobufTransform3d", "wpi.proto.ProtobufTransform3d");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufTwist3d_descriptor = descriptor.internalContainedType(540, 113, "ProtobufTwist3d", "wpi.proto.ProtobufTwist3d");
+
+ /**
+ * @return this proto file's descriptor.
+ */
+ public static Descriptors.FileDescriptor getDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Protobuf type {@code ProtobufTranslation3d}
+ */
+ public static final class ProtobufTranslation3d extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double x = 1;
+ */
+ private double x;
+
+ /**
+ * optional double y = 2;
+ */
+ private double y;
+
+ /**
+ * optional double z = 3;
+ */
+ private double z;
+
+ private ProtobufTranslation3d() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufTranslation3d}
+ */
+ public static ProtobufTranslation3d newInstance() {
+ return new ProtobufTranslation3d();
+ }
+
+ /**
+ * optional double x = 1;
+ * @return whether the x field is set
+ */
+ public boolean hasX() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double x = 1;
+ * @return this
+ */
+ public ProtobufTranslation3d clearX() {
+ bitField0_ &= ~0x00000001;
+ x = 0D;
+ return this;
+ }
+
+ /**
+ * optional double x = 1;
+ * @return the x
+ */
+ public double getX() {
+ return x;
+ }
+
+ /**
+ * optional double x = 1;
+ * @param value the x to set
+ * @return this
+ */
+ public ProtobufTranslation3d setX(final double value) {
+ bitField0_ |= 0x00000001;
+ x = value;
+ return this;
+ }
+
+ /**
+ * optional double y = 2;
+ * @return whether the y field is set
+ */
+ public boolean hasY() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double y = 2;
+ * @return this
+ */
+ public ProtobufTranslation3d clearY() {
+ bitField0_ &= ~0x00000002;
+ y = 0D;
+ return this;
+ }
+
+ /**
+ * optional double y = 2;
+ * @return the y
+ */
+ public double getY() {
+ return y;
+ }
+
+ /**
+ * optional double y = 2;
+ * @param value the y to set
+ * @return this
+ */
+ public ProtobufTranslation3d setY(final double value) {
+ bitField0_ |= 0x00000002;
+ y = value;
+ return this;
+ }
+
+ /**
+ * optional double z = 3;
+ * @return whether the z field is set
+ */
+ public boolean hasZ() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double z = 3;
+ * @return this
+ */
+ public ProtobufTranslation3d clearZ() {
+ bitField0_ &= ~0x00000004;
+ z = 0D;
+ return this;
+ }
+
+ /**
+ * optional double z = 3;
+ * @return the z
+ */
+ public double getZ() {
+ return z;
+ }
+
+ /**
+ * optional double z = 3;
+ * @param value the z to set
+ * @return this
+ */
+ public ProtobufTranslation3d setZ(final double value) {
+ bitField0_ |= 0x00000004;
+ z = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufTranslation3d copyFrom(final ProtobufTranslation3d other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ x = other.x;
+ y = other.y;
+ z = other.z;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTranslation3d mergeFrom(final ProtobufTranslation3d other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasX()) {
+ setX(other.x);
+ }
+ if (other.hasY()) {
+ setY(other.y);
+ }
+ if (other.hasZ()) {
+ setZ(other.z);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTranslation3d clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ x = 0D;
+ y = 0D;
+ z = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufTranslation3d clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufTranslation3d)) {
+ return false;
+ }
+ ProtobufTranslation3d other = (ProtobufTranslation3d) o;
+ return bitField0_ == other.bitField0_
+ && (!hasX() || ProtoUtil.isEqual(x, other.x))
+ && (!hasY() || ProtoUtil.isEqual(y, other.y))
+ && (!hasZ() || ProtoUtil.isEqual(z, other.z));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(x);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(y);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(z);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufTranslation3d mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // x
+ x = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // y
+ y = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // z
+ z = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.x, x);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.y, y);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.z, z);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufTranslation3d mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 120: {
+ if (input.isAtField(FieldNames.x)) {
+ if (!input.trySkipNullValue()) {
+ x = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 121: {
+ if (input.isAtField(FieldNames.y)) {
+ if (!input.trySkipNullValue()) {
+ y = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 122: {
+ if (input.isAtField(FieldNames.z)) {
+ if (!input.trySkipNullValue()) {
+ z = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufTranslation3d clone() {
+ return new ProtobufTranslation3d().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufTranslation3d parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufTranslation3d(), data).checkInitialized();
+ }
+
+ public static ProtobufTranslation3d parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTranslation3d(), input).checkInitialized();
+ }
+
+ public static ProtobufTranslation3d parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTranslation3d(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufTranslation3d messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufTranslation3dFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Geometry3D.wpi_proto_ProtobufTranslation3d_descriptor;
+ }
+
+ private enum ProtobufTranslation3dFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufTranslation3d create() {
+ return ProtobufTranslation3d.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName x = FieldName.forField("x");
+
+ static final FieldName y = FieldName.forField("y");
+
+ static final FieldName z = FieldName.forField("z");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufQuaternion}
+ */
+ public static final class ProtobufQuaternion extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double w = 1;
+ */
+ private double w;
+
+ /**
+ * optional double x = 2;
+ */
+ private double x;
+
+ /**
+ * optional double y = 3;
+ */
+ private double y;
+
+ /**
+ * optional double z = 4;
+ */
+ private double z;
+
+ private ProtobufQuaternion() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufQuaternion}
+ */
+ public static ProtobufQuaternion newInstance() {
+ return new ProtobufQuaternion();
+ }
+
+ /**
+ * optional double w = 1;
+ * @return whether the w field is set
+ */
+ public boolean hasW() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double w = 1;
+ * @return this
+ */
+ public ProtobufQuaternion clearW() {
+ bitField0_ &= ~0x00000001;
+ w = 0D;
+ return this;
+ }
+
+ /**
+ * optional double w = 1;
+ * @return the w
+ */
+ public double getW() {
+ return w;
+ }
+
+ /**
+ * optional double w = 1;
+ * @param value the w to set
+ * @return this
+ */
+ public ProtobufQuaternion setW(final double value) {
+ bitField0_ |= 0x00000001;
+ w = value;
+ return this;
+ }
+
+ /**
+ * optional double x = 2;
+ * @return whether the x field is set
+ */
+ public boolean hasX() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double x = 2;
+ * @return this
+ */
+ public ProtobufQuaternion clearX() {
+ bitField0_ &= ~0x00000002;
+ x = 0D;
+ return this;
+ }
+
+ /**
+ * optional double x = 2;
+ * @return the x
+ */
+ public double getX() {
+ return x;
+ }
+
+ /**
+ * optional double x = 2;
+ * @param value the x to set
+ * @return this
+ */
+ public ProtobufQuaternion setX(final double value) {
+ bitField0_ |= 0x00000002;
+ x = value;
+ return this;
+ }
+
+ /**
+ * optional double y = 3;
+ * @return whether the y field is set
+ */
+ public boolean hasY() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double y = 3;
+ * @return this
+ */
+ public ProtobufQuaternion clearY() {
+ bitField0_ &= ~0x00000004;
+ y = 0D;
+ return this;
+ }
+
+ /**
+ * optional double y = 3;
+ * @return the y
+ */
+ public double getY() {
+ return y;
+ }
+
+ /**
+ * optional double y = 3;
+ * @param value the y to set
+ * @return this
+ */
+ public ProtobufQuaternion setY(final double value) {
+ bitField0_ |= 0x00000004;
+ y = value;
+ return this;
+ }
+
+ /**
+ * optional double z = 4;
+ * @return whether the z field is set
+ */
+ public boolean hasZ() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional double z = 4;
+ * @return this
+ */
+ public ProtobufQuaternion clearZ() {
+ bitField0_ &= ~0x00000008;
+ z = 0D;
+ return this;
+ }
+
+ /**
+ * optional double z = 4;
+ * @return the z
+ */
+ public double getZ() {
+ return z;
+ }
+
+ /**
+ * optional double z = 4;
+ * @param value the z to set
+ * @return this
+ */
+ public ProtobufQuaternion setZ(final double value) {
+ bitField0_ |= 0x00000008;
+ z = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufQuaternion copyFrom(final ProtobufQuaternion other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ w = other.w;
+ x = other.x;
+ y = other.y;
+ z = other.z;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufQuaternion mergeFrom(final ProtobufQuaternion other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasW()) {
+ setW(other.w);
+ }
+ if (other.hasX()) {
+ setX(other.x);
+ }
+ if (other.hasY()) {
+ setY(other.y);
+ }
+ if (other.hasZ()) {
+ setZ(other.z);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufQuaternion clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ w = 0D;
+ x = 0D;
+ y = 0D;
+ z = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufQuaternion clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufQuaternion)) {
+ return false;
+ }
+ ProtobufQuaternion other = (ProtobufQuaternion) o;
+ return bitField0_ == other.bitField0_
+ && (!hasW() || ProtoUtil.isEqual(w, other.w))
+ && (!hasX() || ProtoUtil.isEqual(x, other.x))
+ && (!hasY() || ProtoUtil.isEqual(y, other.y))
+ && (!hasZ() || ProtoUtil.isEqual(z, other.z));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(w);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(x);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(y);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 33);
+ output.writeDoubleNoTag(z);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufQuaternion mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // w
+ w = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // x
+ x = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // y
+ y = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 33) {
+ break;
+ }
+ }
+ case 33: {
+ // z
+ z = input.readDouble();
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.w, w);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.x, x);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.y, y);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeDouble(FieldNames.z, z);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufQuaternion mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 119: {
+ if (input.isAtField(FieldNames.w)) {
+ if (!input.trySkipNullValue()) {
+ w = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 120: {
+ if (input.isAtField(FieldNames.x)) {
+ if (!input.trySkipNullValue()) {
+ x = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 121: {
+ if (input.isAtField(FieldNames.y)) {
+ if (!input.trySkipNullValue()) {
+ y = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 122: {
+ if (input.isAtField(FieldNames.z)) {
+ if (!input.trySkipNullValue()) {
+ z = input.readDouble();
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufQuaternion clone() {
+ return new ProtobufQuaternion().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufQuaternion parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufQuaternion(), data).checkInitialized();
+ }
+
+ public static ProtobufQuaternion parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufQuaternion(), input).checkInitialized();
+ }
+
+ public static ProtobufQuaternion parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufQuaternion(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufQuaternion messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufQuaternionFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Geometry3D.wpi_proto_ProtobufQuaternion_descriptor;
+ }
+
+ private enum ProtobufQuaternionFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufQuaternion create() {
+ return ProtobufQuaternion.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName w = FieldName.forField("w");
+
+ static final FieldName x = FieldName.forField("x");
+
+ static final FieldName y = FieldName.forField("y");
+
+ static final FieldName z = FieldName.forField("z");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufRotation3d}
+ */
+ public static final class ProtobufRotation3d extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional .wpi.proto.ProtobufQuaternion q = 1;
+ */
+ private final ProtobufQuaternion q = ProtobufQuaternion.newInstance();
+
+ private ProtobufRotation3d() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufRotation3d}
+ */
+ public static ProtobufRotation3d newInstance() {
+ return new ProtobufRotation3d();
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufQuaternion q = 1;
+ * @return whether the q field is set
+ */
+ public boolean hasQ() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufQuaternion q = 1;
+ * @return this
+ */
+ public ProtobufRotation3d clearQ() {
+ bitField0_ &= ~0x00000001;
+ q.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufQuaternion q = 1;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableQ()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public ProtobufQuaternion getQ() {
+ return q;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufQuaternion q = 1;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public ProtobufQuaternion getMutableQ() {
+ bitField0_ |= 0x00000001;
+ return q;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufQuaternion q = 1;
+ * @param value the q to set
+ * @return this
+ */
+ public ProtobufRotation3d setQ(final ProtobufQuaternion value) {
+ bitField0_ |= 0x00000001;
+ q.copyFrom(value);
+ return this;
+ }
+
+ @Override
+ public ProtobufRotation3d copyFrom(final ProtobufRotation3d other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ q.copyFrom(other.q);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufRotation3d mergeFrom(final ProtobufRotation3d other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasQ()) {
+ getMutableQ().mergeFrom(other.q);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufRotation3d clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ q.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufRotation3d clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ q.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufRotation3d)) {
+ return false;
+ }
+ ProtobufRotation3d other = (ProtobufRotation3d) o;
+ return bitField0_ == other.bitField0_
+ && (!hasQ() || q.equals(other.q));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 10);
+ output.writeMessageNoTag(q);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(q);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufRotation3d mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 10: {
+ // q
+ input.readMessage(q);
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeMessage(FieldNames.q, q);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufRotation3d mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 113: {
+ if (input.isAtField(FieldNames.q)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(q);
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufRotation3d clone() {
+ return new ProtobufRotation3d().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufRotation3d parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufRotation3d(), data).checkInitialized();
+ }
+
+ public static ProtobufRotation3d parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufRotation3d(), input).checkInitialized();
+ }
+
+ public static ProtobufRotation3d parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufRotation3d(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufRotation3d messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufRotation3dFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Geometry3D.wpi_proto_ProtobufRotation3d_descriptor;
+ }
+
+ private enum ProtobufRotation3dFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufRotation3d create() {
+ return ProtobufRotation3d.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName q = FieldName.forField("q");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufPose3d}
+ */
+ public static final class ProtobufPose3d extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ */
+ private final ProtobufTranslation3d translation = ProtobufTranslation3d.newInstance();
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ */
+ private final ProtobufRotation3d rotation = ProtobufRotation3d.newInstance();
+
+ private ProtobufPose3d() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufPose3d}
+ */
+ public static ProtobufPose3d newInstance() {
+ return new ProtobufPose3d();
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ * @return whether the translation field is set
+ */
+ public boolean hasTranslation() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ * @return this
+ */
+ public ProtobufPose3d clearTranslation() {
+ bitField0_ &= ~0x00000001;
+ translation.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableTranslation()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public ProtobufTranslation3d getTranslation() {
+ return translation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public ProtobufTranslation3d getMutableTranslation() {
+ bitField0_ |= 0x00000001;
+ return translation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ * @param value the translation to set
+ * @return this
+ */
+ public ProtobufPose3d setTranslation(final ProtobufTranslation3d value) {
+ bitField0_ |= 0x00000001;
+ translation.copyFrom(value);
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ * @return whether the rotation field is set
+ */
+ public boolean hasRotation() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ * @return this
+ */
+ public ProtobufPose3d clearRotation() {
+ bitField0_ &= ~0x00000002;
+ rotation.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableRotation()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public ProtobufRotation3d getRotation() {
+ return rotation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public ProtobufRotation3d getMutableRotation() {
+ bitField0_ |= 0x00000002;
+ return rotation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ * @param value the rotation to set
+ * @return this
+ */
+ public ProtobufPose3d setRotation(final ProtobufRotation3d value) {
+ bitField0_ |= 0x00000002;
+ rotation.copyFrom(value);
+ return this;
+ }
+
+ @Override
+ public ProtobufPose3d copyFrom(final ProtobufPose3d other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ translation.copyFrom(other.translation);
+ rotation.copyFrom(other.rotation);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufPose3d mergeFrom(final ProtobufPose3d other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasTranslation()) {
+ getMutableTranslation().mergeFrom(other.translation);
+ }
+ if (other.hasRotation()) {
+ getMutableRotation().mergeFrom(other.rotation);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufPose3d clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ translation.clear();
+ rotation.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufPose3d clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ translation.clearQuick();
+ rotation.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufPose3d)) {
+ return false;
+ }
+ ProtobufPose3d other = (ProtobufPose3d) o;
+ return bitField0_ == other.bitField0_
+ && (!hasTranslation() || translation.equals(other.translation))
+ && (!hasRotation() || rotation.equals(other.rotation));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 10);
+ output.writeMessageNoTag(translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 18);
+ output.writeMessageNoTag(rotation);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(rotation);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufPose3d mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 10: {
+ // translation
+ input.readMessage(translation);
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 18) {
+ break;
+ }
+ }
+ case 18: {
+ // rotation
+ input.readMessage(rotation);
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeMessage(FieldNames.translation, translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeMessage(FieldNames.rotation, rotation);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufPose3d mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case -1840647503: {
+ if (input.isAtField(FieldNames.translation)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(translation);
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -40300674: {
+ if (input.isAtField(FieldNames.rotation)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(rotation);
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufPose3d clone() {
+ return new ProtobufPose3d().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufPose3d parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufPose3d(), data).checkInitialized();
+ }
+
+ public static ProtobufPose3d parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufPose3d(), input).checkInitialized();
+ }
+
+ public static ProtobufPose3d parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufPose3d(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufPose3d messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufPose3dFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Geometry3D.wpi_proto_ProtobufPose3d_descriptor;
+ }
+
+ private enum ProtobufPose3dFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufPose3d create() {
+ return ProtobufPose3d.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName translation = FieldName.forField("translation");
+
+ static final FieldName rotation = FieldName.forField("rotation");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufTransform3d}
+ */
+ public static final class ProtobufTransform3d extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ */
+ private final ProtobufTranslation3d translation = ProtobufTranslation3d.newInstance();
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ */
+ private final ProtobufRotation3d rotation = ProtobufRotation3d.newInstance();
+
+ private ProtobufTransform3d() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufTransform3d}
+ */
+ public static ProtobufTransform3d newInstance() {
+ return new ProtobufTransform3d();
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ * @return whether the translation field is set
+ */
+ public boolean hasTranslation() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ * @return this
+ */
+ public ProtobufTransform3d clearTranslation() {
+ bitField0_ &= ~0x00000001;
+ translation.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableTranslation()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public ProtobufTranslation3d getTranslation() {
+ return translation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public ProtobufTranslation3d getMutableTranslation() {
+ bitField0_ |= 0x00000001;
+ return translation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation3d translation = 1;
+ * @param value the translation to set
+ * @return this
+ */
+ public ProtobufTransform3d setTranslation(final ProtobufTranslation3d value) {
+ bitField0_ |= 0x00000001;
+ translation.copyFrom(value);
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ * @return whether the rotation field is set
+ */
+ public boolean hasRotation() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ * @return this
+ */
+ public ProtobufTransform3d clearRotation() {
+ bitField0_ &= ~0x00000002;
+ rotation.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableRotation()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public ProtobufRotation3d getRotation() {
+ return rotation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public ProtobufRotation3d getMutableRotation() {
+ bitField0_ |= 0x00000002;
+ return rotation;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation3d rotation = 2;
+ * @param value the rotation to set
+ * @return this
+ */
+ public ProtobufTransform3d setRotation(final ProtobufRotation3d value) {
+ bitField0_ |= 0x00000002;
+ rotation.copyFrom(value);
+ return this;
+ }
+
+ @Override
+ public ProtobufTransform3d copyFrom(final ProtobufTransform3d other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ translation.copyFrom(other.translation);
+ rotation.copyFrom(other.rotation);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTransform3d mergeFrom(final ProtobufTransform3d other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasTranslation()) {
+ getMutableTranslation().mergeFrom(other.translation);
+ }
+ if (other.hasRotation()) {
+ getMutableRotation().mergeFrom(other.rotation);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTransform3d clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ translation.clear();
+ rotation.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufTransform3d clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ translation.clearQuick();
+ rotation.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufTransform3d)) {
+ return false;
+ }
+ ProtobufTransform3d other = (ProtobufTransform3d) o;
+ return bitField0_ == other.bitField0_
+ && (!hasTranslation() || translation.equals(other.translation))
+ && (!hasRotation() || rotation.equals(other.rotation));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 10);
+ output.writeMessageNoTag(translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 18);
+ output.writeMessageNoTag(rotation);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(rotation);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufTransform3d mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 10: {
+ // translation
+ input.readMessage(translation);
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 18) {
+ break;
+ }
+ }
+ case 18: {
+ // rotation
+ input.readMessage(rotation);
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeMessage(FieldNames.translation, translation);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeMessage(FieldNames.rotation, rotation);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufTransform3d mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case -1840647503: {
+ if (input.isAtField(FieldNames.translation)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(translation);
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -40300674: {
+ if (input.isAtField(FieldNames.rotation)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(rotation);
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufTransform3d clone() {
+ return new ProtobufTransform3d().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufTransform3d parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufTransform3d(), data).checkInitialized();
+ }
+
+ public static ProtobufTransform3d parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTransform3d(), input).checkInitialized();
+ }
+
+ public static ProtobufTransform3d parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTransform3d(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufTransform3d messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufTransform3dFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Geometry3D.wpi_proto_ProtobufTransform3d_descriptor;
+ }
+
+ private enum ProtobufTransform3dFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufTransform3d create() {
+ return ProtobufTransform3d.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName translation = FieldName.forField("translation");
+
+ static final FieldName rotation = FieldName.forField("rotation");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufTwist3d}
+ */
+ public static final class ProtobufTwist3d extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double dx = 1;
+ */
+ private double dx;
+
+ /**
+ * optional double dy = 2;
+ */
+ private double dy;
+
+ /**
+ * optional double dz = 3;
+ */
+ private double dz;
+
+ /**
+ * optional double rx = 4;
+ */
+ private double rx;
+
+ /**
+ * optional double ry = 5;
+ */
+ private double ry;
+
+ /**
+ * optional double rz = 6;
+ */
+ private double rz;
+
+ private ProtobufTwist3d() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufTwist3d}
+ */
+ public static ProtobufTwist3d newInstance() {
+ return new ProtobufTwist3d();
+ }
+
+ /**
+ * optional double dx = 1;
+ * @return whether the dx field is set
+ */
+ public boolean hasDx() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double dx = 1;
+ * @return this
+ */
+ public ProtobufTwist3d clearDx() {
+ bitField0_ &= ~0x00000001;
+ dx = 0D;
+ return this;
+ }
+
+ /**
+ * optional double dx = 1;
+ * @return the dx
+ */
+ public double getDx() {
+ return dx;
+ }
+
+ /**
+ * optional double dx = 1;
+ * @param value the dx to set
+ * @return this
+ */
+ public ProtobufTwist3d setDx(final double value) {
+ bitField0_ |= 0x00000001;
+ dx = value;
+ return this;
+ }
+
+ /**
+ * optional double dy = 2;
+ * @return whether the dy field is set
+ */
+ public boolean hasDy() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double dy = 2;
+ * @return this
+ */
+ public ProtobufTwist3d clearDy() {
+ bitField0_ &= ~0x00000002;
+ dy = 0D;
+ return this;
+ }
+
+ /**
+ * optional double dy = 2;
+ * @return the dy
+ */
+ public double getDy() {
+ return dy;
+ }
+
+ /**
+ * optional double dy = 2;
+ * @param value the dy to set
+ * @return this
+ */
+ public ProtobufTwist3d setDy(final double value) {
+ bitField0_ |= 0x00000002;
+ dy = value;
+ return this;
+ }
+
+ /**
+ * optional double dz = 3;
+ * @return whether the dz field is set
+ */
+ public boolean hasDz() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double dz = 3;
+ * @return this
+ */
+ public ProtobufTwist3d clearDz() {
+ bitField0_ &= ~0x00000004;
+ dz = 0D;
+ return this;
+ }
+
+ /**
+ * optional double dz = 3;
+ * @return the dz
+ */
+ public double getDz() {
+ return dz;
+ }
+
+ /**
+ * optional double dz = 3;
+ * @param value the dz to set
+ * @return this
+ */
+ public ProtobufTwist3d setDz(final double value) {
+ bitField0_ |= 0x00000004;
+ dz = value;
+ return this;
+ }
+
+ /**
+ * optional double rx = 4;
+ * @return whether the rx field is set
+ */
+ public boolean hasRx() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional double rx = 4;
+ * @return this
+ */
+ public ProtobufTwist3d clearRx() {
+ bitField0_ &= ~0x00000008;
+ rx = 0D;
+ return this;
+ }
+
+ /**
+ * optional double rx = 4;
+ * @return the rx
+ */
+ public double getRx() {
+ return rx;
+ }
+
+ /**
+ * optional double rx = 4;
+ * @param value the rx to set
+ * @return this
+ */
+ public ProtobufTwist3d setRx(final double value) {
+ bitField0_ |= 0x00000008;
+ rx = value;
+ return this;
+ }
+
+ /**
+ * optional double ry = 5;
+ * @return whether the ry field is set
+ */
+ public boolean hasRy() {
+ return (bitField0_ & 0x00000010) != 0;
+ }
+
+ /**
+ * optional double ry = 5;
+ * @return this
+ */
+ public ProtobufTwist3d clearRy() {
+ bitField0_ &= ~0x00000010;
+ ry = 0D;
+ return this;
+ }
+
+ /**
+ * optional double ry = 5;
+ * @return the ry
+ */
+ public double getRy() {
+ return ry;
+ }
+
+ /**
+ * optional double ry = 5;
+ * @param value the ry to set
+ * @return this
+ */
+ public ProtobufTwist3d setRy(final double value) {
+ bitField0_ |= 0x00000010;
+ ry = value;
+ return this;
+ }
+
+ /**
+ * optional double rz = 6;
+ * @return whether the rz field is set
+ */
+ public boolean hasRz() {
+ return (bitField0_ & 0x00000020) != 0;
+ }
+
+ /**
+ * optional double rz = 6;
+ * @return this
+ */
+ public ProtobufTwist3d clearRz() {
+ bitField0_ &= ~0x00000020;
+ rz = 0D;
+ return this;
+ }
+
+ /**
+ * optional double rz = 6;
+ * @return the rz
+ */
+ public double getRz() {
+ return rz;
+ }
+
+ /**
+ * optional double rz = 6;
+ * @param value the rz to set
+ * @return this
+ */
+ public ProtobufTwist3d setRz(final double value) {
+ bitField0_ |= 0x00000020;
+ rz = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufTwist3d copyFrom(final ProtobufTwist3d other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ dx = other.dx;
+ dy = other.dy;
+ dz = other.dz;
+ rx = other.rx;
+ ry = other.ry;
+ rz = other.rz;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTwist3d mergeFrom(final ProtobufTwist3d other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasDx()) {
+ setDx(other.dx);
+ }
+ if (other.hasDy()) {
+ setDy(other.dy);
+ }
+ if (other.hasDz()) {
+ setDz(other.dz);
+ }
+ if (other.hasRx()) {
+ setRx(other.rx);
+ }
+ if (other.hasRy()) {
+ setRy(other.ry);
+ }
+ if (other.hasRz()) {
+ setRz(other.rz);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTwist3d clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ dx = 0D;
+ dy = 0D;
+ dz = 0D;
+ rx = 0D;
+ ry = 0D;
+ rz = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufTwist3d clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufTwist3d)) {
+ return false;
+ }
+ ProtobufTwist3d other = (ProtobufTwist3d) o;
+ return bitField0_ == other.bitField0_
+ && (!hasDx() || ProtoUtil.isEqual(dx, other.dx))
+ && (!hasDy() || ProtoUtil.isEqual(dy, other.dy))
+ && (!hasDz() || ProtoUtil.isEqual(dz, other.dz))
+ && (!hasRx() || ProtoUtil.isEqual(rx, other.rx))
+ && (!hasRy() || ProtoUtil.isEqual(ry, other.ry))
+ && (!hasRz() || ProtoUtil.isEqual(rz, other.rz));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(dx);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(dy);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(dz);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 33);
+ output.writeDoubleNoTag(rx);
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ output.writeRawByte((byte) 41);
+ output.writeDoubleNoTag(ry);
+ }
+ if ((bitField0_ & 0x00000020) != 0) {
+ output.writeRawByte((byte) 49);
+ output.writeDoubleNoTag(rz);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000020) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufTwist3d mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // dx
+ dx = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // dy
+ dy = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // dz
+ dz = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 33) {
+ break;
+ }
+ }
+ case 33: {
+ // rx
+ rx = input.readDouble();
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 41) {
+ break;
+ }
+ }
+ case 41: {
+ // ry
+ ry = input.readDouble();
+ bitField0_ |= 0x00000010;
+ tag = input.readTag();
+ if (tag != 49) {
+ break;
+ }
+ }
+ case 49: {
+ // rz
+ rz = input.readDouble();
+ bitField0_ |= 0x00000020;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.dx, dx);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.dy, dy);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.dz, dz);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeDouble(FieldNames.rx, rx);
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ output.writeDouble(FieldNames.ry, ry);
+ }
+ if ((bitField0_ & 0x00000020) != 0) {
+ output.writeDouble(FieldNames.rz, rz);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufTwist3d mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 3220: {
+ if (input.isAtField(FieldNames.dx)) {
+ if (!input.trySkipNullValue()) {
+ dx = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3221: {
+ if (input.isAtField(FieldNames.dy)) {
+ if (!input.trySkipNullValue()) {
+ dy = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3222: {
+ if (input.isAtField(FieldNames.dz)) {
+ if (!input.trySkipNullValue()) {
+ dz = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3654: {
+ if (input.isAtField(FieldNames.rx)) {
+ if (!input.trySkipNullValue()) {
+ rx = input.readDouble();
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3655: {
+ if (input.isAtField(FieldNames.ry)) {
+ if (!input.trySkipNullValue()) {
+ ry = input.readDouble();
+ bitField0_ |= 0x00000010;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3656: {
+ if (input.isAtField(FieldNames.rz)) {
+ if (!input.trySkipNullValue()) {
+ rz = input.readDouble();
+ bitField0_ |= 0x00000020;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufTwist3d clone() {
+ return new ProtobufTwist3d().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufTwist3d parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufTwist3d(), data).checkInitialized();
+ }
+
+ public static ProtobufTwist3d parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTwist3d(), input).checkInitialized();
+ }
+
+ public static ProtobufTwist3d parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTwist3d(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufTwist3d messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufTwist3dFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Geometry3D.wpi_proto_ProtobufTwist3d_descriptor;
+ }
+
+ private enum ProtobufTwist3dFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufTwist3d create() {
+ return ProtobufTwist3d.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName dx = FieldName.forField("dx");
+
+ static final FieldName dy = FieldName.forField("dy");
+
+ static final FieldName dz = FieldName.forField("dz");
+
+ static final FieldName rx = FieldName.forField("rx");
+
+ static final FieldName ry = FieldName.forField("ry");
+
+ static final FieldName rz = FieldName.forField("rz");
+ }
+ }
+}
diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Kinematics.java b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Kinematics.java
new file mode 100644
index 0000000000..bd0c4450cb
--- /dev/null
+++ b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Kinematics.java
@@ -0,0 +1,4196 @@
+// Copyright (c) FIRST and other WPILib contributors.
+// Open Source Software; you can modify and/or share it under the terms of
+// the WPILib BSD license file in the root directory of this project.
+// Code generated by protocol buffer compiler. Do not edit!
+package edu.wpi.first.math.proto;
+
+import java.io.IOException;
+import us.hebi.quickbuf.Descriptors;
+import us.hebi.quickbuf.FieldName;
+import us.hebi.quickbuf.InvalidProtocolBufferException;
+import us.hebi.quickbuf.JsonSink;
+import us.hebi.quickbuf.JsonSource;
+import us.hebi.quickbuf.MessageFactory;
+import us.hebi.quickbuf.ProtoMessage;
+import us.hebi.quickbuf.ProtoSink;
+import us.hebi.quickbuf.ProtoSource;
+import us.hebi.quickbuf.ProtoUtil;
+import us.hebi.quickbuf.RepeatedByte;
+import us.hebi.quickbuf.RepeatedMessage;
+
+public final class Kinematics {
+ private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(3208,
+ "ChBraW5lbWF0aWNzLnByb3RvEgl3cGkucHJvdG8aEGdlb21ldHJ5MmQucHJvdG8iTQoVUHJvdG9idWZD" +
+ "aGFzc2lzU3BlZWRzEg4KAnZ4GAEgASgBUgJ2eBIOCgJ2eRgCIAEoAVICdnkSFAoFb21lZ2EYAyABKAFS" +
+ "BW9tZWdhIkYKI1Byb3RvYnVmRGlmZmVyZW50aWFsRHJpdmVLaW5lbWF0aWNzEh8KC3RyYWNrX3dpZHRo" +
+ "GAEgASgBUgp0cmFja1dpZHRoIlAKJFByb3RvYnVmRGlmZmVyZW50aWFsRHJpdmVXaGVlbFNwZWVkcxIS" +
+ "CgRsZWZ0GAEgASgBUgRsZWZ0EhQKBXJpZ2h0GAIgASgBUgVyaWdodCKkAgoeUHJvdG9idWZNZWNhbnVt" +
+ "RHJpdmVLaW5lbWF0aWNzEj8KCmZyb250X2xlZnQYASABKAsyIC53cGkucHJvdG8uUHJvdG9idWZUcmFu" +
+ "c2xhdGlvbjJkUglmcm9udExlZnQSQQoLZnJvbnRfcmlnaHQYAiABKAsyIC53cGkucHJvdG8uUHJvdG9i" +
+ "dWZUcmFuc2xhdGlvbjJkUgpmcm9udFJpZ2h0Ej0KCXJlYXJfbGVmdBgDIAEoCzIgLndwaS5wcm90by5Q" +
+ "cm90b2J1ZlRyYW5zbGF0aW9uMmRSCHJlYXJMZWZ0Ej8KCnJlYXJfcmlnaHQYBCABKAsyIC53cGkucHJv" +
+ "dG8uUHJvdG9idWZUcmFuc2xhdGlvbjJkUglyZWFyUmlnaHQinwEKIVByb3RvYnVmTWVjYW51bURyaXZl" +
+ "TW90b3JWb2x0YWdlcxIdCgpmcm9udF9sZWZ0GAEgASgBUglmcm9udExlZnQSHwoLZnJvbnRfcmlnaHQY" +
+ "AiABKAFSCmZyb250UmlnaHQSGwoJcmVhcl9sZWZ0GAMgASgBUghyZWFyTGVmdBIdCgpyZWFyX3JpZ2h0" +
+ "GAQgASgBUglyZWFyUmlnaHQioAEKIlByb3RvYnVmTWVjYW51bURyaXZlV2hlZWxQb3NpdGlvbnMSHQoK" +
+ "ZnJvbnRfbGVmdBgBIAEoAVIJZnJvbnRMZWZ0Eh8KC2Zyb250X3JpZ2h0GAIgASgBUgpmcm9udFJpZ2h0" +
+ "EhsKCXJlYXJfbGVmdBgDIAEoAVIIcmVhckxlZnQSHQoKcmVhcl9yaWdodBgEIAEoAVIJcmVhclJpZ2h0" +
+ "Ip0BCh9Qcm90b2J1Zk1lY2FudW1Ecml2ZVdoZWVsU3BlZWRzEh0KCmZyb250X2xlZnQYASABKAFSCWZy" +
+ "b250TGVmdBIfCgtmcm9udF9yaWdodBgCIAEoAVIKZnJvbnRSaWdodBIbCglyZWFyX2xlZnQYAyABKAFS" +
+ "CHJlYXJMZWZ0Eh0KCnJlYXJfcmlnaHQYBCABKAFSCXJlYXJSaWdodCJbCh1Qcm90b2J1ZlN3ZXJ2ZURy" +
+ "aXZlS2luZW1hdGljcxI6Cgdtb2R1bGVzGAEgAygLMiAud3BpLnByb3RvLlByb3RvYnVmVHJhbnNsYXRp" +
+ "b24yZFIHbW9kdWxlcyJvChxQcm90b2J1ZlN3ZXJ2ZU1vZHVsZVBvc2l0aW9uEhoKCGRpc3RhbmNlGAEg",
+ "ASgBUghkaXN0YW5jZRIzCgVhbmdsZRgCIAEoCzIdLndwaS5wcm90by5Qcm90b2J1ZlJvdGF0aW9uMmRS" +
+ "BWFuZ2xlImYKGVByb3RvYnVmU3dlcnZlTW9kdWxlU3RhdGUSFAoFc3BlZWQYASABKAFSBXNwZWVkEjMK" +
+ "BWFuZ2xlGAIgASgLMh0ud3BpLnByb3RvLlByb3RvYnVmUm90YXRpb24yZFIFYW5nbGVCGgoYZWR1Lndw" +
+ "aS5maXJzdC5tYXRoLnByb3RvSocOCgYSBAAAPwEKCAoBDBIDAAASCggKAQISAwIAEgoJCgIDABIDBAAa" +
+ "CggKAQgSAwYAMQoJCgIIARIDBgAxCgoKAgQAEgQIAAwBCgoKAwQAARIDCAgdCgsKBAQAAgASAwkCEAoM" +
+ "CgUEAAIABRIDCQIICgwKBQQAAgABEgMJCQsKDAoFBAACAAMSAwkODwoLCgQEAAIBEgMKAhAKDAoFBAAC" +
+ "AQUSAwoCCAoMCgUEAAIBARIDCgkLCgwKBQQAAgEDEgMKDg8KCwoEBAACAhIDCwITCgwKBQQAAgIFEgML" +
+ "AggKDAoFBAACAgESAwsJDgoMCgUEAAICAxIDCxESCgoKAgQBEgQOABABCgoKAwQBARIDDggrCgsKBAQB" +
+ "AgASAw8CGQoMCgUEAQIABRIDDwIICgwKBQQBAgABEgMPCRQKDAoFBAECAAMSAw8XGAoKCgIEAhIEEgAV" +
+ "AQoKCgMEAgESAxIILAoLCgQEAgIAEgMTAhIKDAoFBAICAAUSAxMCCAoMCgUEAgIAARIDEwkNCgwKBQQC" +
+ "AgADEgMTEBEKCwoEBAICARIDFAITCgwKBQQCAgEFEgMUAggKDAoFBAICAQESAxQJDgoMCgUEAgIBAxID" +
+ "FBESCgoKAgQDEgQXABwBCgoKAwQDARIDFwgmCgsKBAQDAgASAxgCJwoMCgUEAwIABhIDGAIXCgwKBQQD" +
+ "AgABEgMYGCIKDAoFBAMCAAMSAxglJgoLCgQEAwIBEgMZAigKDAoFBAMCAQYSAxkCFwoMCgUEAwIBARID" +
+ "GRgjCgwKBQQDAgEDEgMZJicKCwoEBAMCAhIDGgImCgwKBQQDAgIGEgMaAhcKDAoFBAMCAgESAxoYIQoM" +
+ "CgUEAwICAxIDGiQlCgsKBAQDAgMSAxsCJwoMCgUEAwIDBhIDGwIXCgwKBQQDAgMBEgMbGCIKDAoFBAMC" +
+ "AwMSAxslJgoKCgIEBBIEHgAjAQoKCgMEBAESAx4IKQoLCgQEBAIAEgMfAhgKDAoFBAQCAAUSAx8CCAoM" +
+ "CgUEBAIAARIDHwkTCgwKBQQEAgADEgMfFhcKCwoEBAQCARIDIAIZCgwKBQQEAgEFEgMgAggKDAoFBAQC" +
+ "AQESAyAJFAoMCgUEBAIBAxIDIBcYCgsKBAQEAgISAyECFwoMCgUEBAICBRIDIQIICgwKBQQEAgIBEgMh" +
+ "CRIKDAoFBAQCAgMSAyEVFgoLCgQEBAIDEgMiAhgKDAoFBAQCAwUSAyICCAoMCgUEBAIDARIDIgkTCgwK" +
+ "BQQEAgMDEgMiFhcKCgoCBAUSBCUAKgEKCgoDBAUBEgMlCCoKCwoEBAUCABIDJgIYCgwKBQQFAgAFEgMm",
+ "AggKDAoFBAUCAAESAyYJEwoMCgUEBQIAAxIDJhYXCgsKBAQFAgESAycCGQoMCgUEBQIBBRIDJwIICgwK" +
+ "BQQFAgEBEgMnCRQKDAoFBAUCAQMSAycXGAoLCgQEBQICEgMoAhcKDAoFBAUCAgUSAygCCAoMCgUEBQIC" +
+ "ARIDKAkSCgwKBQQFAgIDEgMoFRYKCwoEBAUCAxIDKQIYCgwKBQQFAgMFEgMpAggKDAoFBAUCAwESAykJ" +
+ "EwoMCgUEBQIDAxIDKRYXCgoKAgQGEgQsADEBCgoKAwQGARIDLAgnCgsKBAQGAgASAy0CGAoMCgUEBgIA" +
+ "BRIDLQIICgwKBQQGAgABEgMtCRMKDAoFBAYCAAMSAy0WFwoLCgQEBgIBEgMuAhkKDAoFBAYCAQUSAy4C" +
+ "CAoMCgUEBgIBARIDLgkUCgwKBQQGAgEDEgMuFxgKCwoEBAYCAhIDLwIXCgwKBQQGAgIFEgMvAggKDAoF" +
+ "BAYCAgESAy8JEgoMCgUEBgICAxIDLxUWCgsKBAQGAgMSAzACGAoMCgUEBgIDBRIDMAIICgwKBQQGAgMB" +
+ "EgMwCRMKDAoFBAYCAwMSAzAWFwoKCgIEBxIEMwA1AQoKCgMEBwESAzMIJQoLCgQEBwIAEgM0Ai0KDAoF" +
+ "BAcCAAQSAzQCCgoMCgUEBwIABhIDNAsgCgwKBQQHAgABEgM0ISgKDAoFBAcCAAMSAzQrLAoKCgIECBIE" +
+ "NwA6AQoKCgMECAESAzcIJAoLCgQECAIAEgM4AhYKDAoFBAgCAAUSAzgCCAoMCgUECAIAARIDOAkRCgwK" +
+ "BQQIAgADEgM4FBUKCwoEBAgCARIDOQIfCgwKBQQIAgEGEgM5AhQKDAoFBAgCAQESAzkVGgoMCgUECAIB" +
+ "AxIDOR0eCgoKAgQJEgQ8AD8BCgoKAwQJARIDPAghCgsKBAQJAgASAz0CEwoMCgUECQIABRIDPQIICgwK" +
+ "BQQJAgABEgM9CQ4KDAoFBAkCAAMSAz0REgoLCgQECQIBEgM+Ah8KDAoFBAkCAQYSAz4CFAoMCgUECQIB" +
+ "ARIDPhUaCgwKBQQJAgEDEgM+HR5iBnByb3RvMw==");
+
+ static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("kinematics.proto", "wpi.proto", descriptorData, Geometry2D.getDescriptor());
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufChassisSpeeds_descriptor = descriptor.internalContainedType(49, 77, "ProtobufChassisSpeeds", "wpi.proto.ProtobufChassisSpeeds");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufDifferentialDriveKinematics_descriptor = descriptor.internalContainedType(128, 70, "ProtobufDifferentialDriveKinematics", "wpi.proto.ProtobufDifferentialDriveKinematics");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufDifferentialDriveWheelSpeeds_descriptor = descriptor.internalContainedType(200, 80, "ProtobufDifferentialDriveWheelSpeeds", "wpi.proto.ProtobufDifferentialDriveWheelSpeeds");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufMecanumDriveKinematics_descriptor = descriptor.internalContainedType(283, 292, "ProtobufMecanumDriveKinematics", "wpi.proto.ProtobufMecanumDriveKinematics");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufMecanumDriveMotorVoltages_descriptor = descriptor.internalContainedType(578, 159, "ProtobufMecanumDriveMotorVoltages", "wpi.proto.ProtobufMecanumDriveMotorVoltages");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufMecanumDriveWheelPositions_descriptor = descriptor.internalContainedType(740, 160, "ProtobufMecanumDriveWheelPositions", "wpi.proto.ProtobufMecanumDriveWheelPositions");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufMecanumDriveWheelSpeeds_descriptor = descriptor.internalContainedType(903, 157, "ProtobufMecanumDriveWheelSpeeds", "wpi.proto.ProtobufMecanumDriveWheelSpeeds");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufSwerveDriveKinematics_descriptor = descriptor.internalContainedType(1062, 91, "ProtobufSwerveDriveKinematics", "wpi.proto.ProtobufSwerveDriveKinematics");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufSwerveModulePosition_descriptor = descriptor.internalContainedType(1155, 111, "ProtobufSwerveModulePosition", "wpi.proto.ProtobufSwerveModulePosition");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufSwerveModuleState_descriptor = descriptor.internalContainedType(1268, 102, "ProtobufSwerveModuleState", "wpi.proto.ProtobufSwerveModuleState");
+
+ /**
+ * @return this proto file's descriptor.
+ */
+ public static Descriptors.FileDescriptor getDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Protobuf type {@code ProtobufChassisSpeeds}
+ */
+ public static final class ProtobufChassisSpeeds extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double vx = 1;
+ */
+ private double vx;
+
+ /**
+ * optional double vy = 2;
+ */
+ private double vy;
+
+ /**
+ * optional double omega = 3;
+ */
+ private double omega;
+
+ private ProtobufChassisSpeeds() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufChassisSpeeds}
+ */
+ public static ProtobufChassisSpeeds newInstance() {
+ return new ProtobufChassisSpeeds();
+ }
+
+ /**
+ * optional double vx = 1;
+ * @return whether the vx field is set
+ */
+ public boolean hasVx() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double vx = 1;
+ * @return this
+ */
+ public ProtobufChassisSpeeds clearVx() {
+ bitField0_ &= ~0x00000001;
+ vx = 0D;
+ return this;
+ }
+
+ /**
+ * optional double vx = 1;
+ * @return the vx
+ */
+ public double getVx() {
+ return vx;
+ }
+
+ /**
+ * optional double vx = 1;
+ * @param value the vx to set
+ * @return this
+ */
+ public ProtobufChassisSpeeds setVx(final double value) {
+ bitField0_ |= 0x00000001;
+ vx = value;
+ return this;
+ }
+
+ /**
+ * optional double vy = 2;
+ * @return whether the vy field is set
+ */
+ public boolean hasVy() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double vy = 2;
+ * @return this
+ */
+ public ProtobufChassisSpeeds clearVy() {
+ bitField0_ &= ~0x00000002;
+ vy = 0D;
+ return this;
+ }
+
+ /**
+ * optional double vy = 2;
+ * @return the vy
+ */
+ public double getVy() {
+ return vy;
+ }
+
+ /**
+ * optional double vy = 2;
+ * @param value the vy to set
+ * @return this
+ */
+ public ProtobufChassisSpeeds setVy(final double value) {
+ bitField0_ |= 0x00000002;
+ vy = value;
+ return this;
+ }
+
+ /**
+ * optional double omega = 3;
+ * @return whether the omega field is set
+ */
+ public boolean hasOmega() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double omega = 3;
+ * @return this
+ */
+ public ProtobufChassisSpeeds clearOmega() {
+ bitField0_ &= ~0x00000004;
+ omega = 0D;
+ return this;
+ }
+
+ /**
+ * optional double omega = 3;
+ * @return the omega
+ */
+ public double getOmega() {
+ return omega;
+ }
+
+ /**
+ * optional double omega = 3;
+ * @param value the omega to set
+ * @return this
+ */
+ public ProtobufChassisSpeeds setOmega(final double value) {
+ bitField0_ |= 0x00000004;
+ omega = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufChassisSpeeds copyFrom(final ProtobufChassisSpeeds other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ vx = other.vx;
+ vy = other.vy;
+ omega = other.omega;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufChassisSpeeds mergeFrom(final ProtobufChassisSpeeds other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasVx()) {
+ setVx(other.vx);
+ }
+ if (other.hasVy()) {
+ setVy(other.vy);
+ }
+ if (other.hasOmega()) {
+ setOmega(other.omega);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufChassisSpeeds clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ vx = 0D;
+ vy = 0D;
+ omega = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufChassisSpeeds clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufChassisSpeeds)) {
+ return false;
+ }
+ ProtobufChassisSpeeds other = (ProtobufChassisSpeeds) o;
+ return bitField0_ == other.bitField0_
+ && (!hasVx() || ProtoUtil.isEqual(vx, other.vx))
+ && (!hasVy() || ProtoUtil.isEqual(vy, other.vy))
+ && (!hasOmega() || ProtoUtil.isEqual(omega, other.omega));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(vx);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(vy);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(omega);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufChassisSpeeds mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // vx
+ vx = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // vy
+ vy = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // omega
+ omega = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.vx, vx);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.vy, vy);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.omega, omega);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufChassisSpeeds mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 3778: {
+ if (input.isAtField(FieldNames.vx)) {
+ if (!input.trySkipNullValue()) {
+ vx = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3779: {
+ if (input.isAtField(FieldNames.vy)) {
+ if (!input.trySkipNullValue()) {
+ vy = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 105858401: {
+ if (input.isAtField(FieldNames.omega)) {
+ if (!input.trySkipNullValue()) {
+ omega = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufChassisSpeeds clone() {
+ return new ProtobufChassisSpeeds().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufChassisSpeeds parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufChassisSpeeds(), data).checkInitialized();
+ }
+
+ public static ProtobufChassisSpeeds parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufChassisSpeeds(), input).checkInitialized();
+ }
+
+ public static ProtobufChassisSpeeds parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufChassisSpeeds(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufChassisSpeeds messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufChassisSpeedsFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Kinematics.wpi_proto_ProtobufChassisSpeeds_descriptor;
+ }
+
+ private enum ProtobufChassisSpeedsFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufChassisSpeeds create() {
+ return ProtobufChassisSpeeds.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName vx = FieldName.forField("vx");
+
+ static final FieldName vy = FieldName.forField("vy");
+
+ static final FieldName omega = FieldName.forField("omega");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufDifferentialDriveKinematics}
+ */
+ public static final class ProtobufDifferentialDriveKinematics extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double track_width = 1;
+ */
+ private double trackWidth;
+
+ private ProtobufDifferentialDriveKinematics() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufDifferentialDriveKinematics}
+ */
+ public static ProtobufDifferentialDriveKinematics newInstance() {
+ return new ProtobufDifferentialDriveKinematics();
+ }
+
+ /**
+ * optional double track_width = 1;
+ * @return whether the trackWidth field is set
+ */
+ public boolean hasTrackWidth() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double track_width = 1;
+ * @return this
+ */
+ public ProtobufDifferentialDriveKinematics clearTrackWidth() {
+ bitField0_ &= ~0x00000001;
+ trackWidth = 0D;
+ return this;
+ }
+
+ /**
+ * optional double track_width = 1;
+ * @return the trackWidth
+ */
+ public double getTrackWidth() {
+ return trackWidth;
+ }
+
+ /**
+ * optional double track_width = 1;
+ * @param value the trackWidth to set
+ * @return this
+ */
+ public ProtobufDifferentialDriveKinematics setTrackWidth(final double value) {
+ bitField0_ |= 0x00000001;
+ trackWidth = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveKinematics copyFrom(
+ final ProtobufDifferentialDriveKinematics other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ trackWidth = other.trackWidth;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveKinematics mergeFrom(
+ final ProtobufDifferentialDriveKinematics other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasTrackWidth()) {
+ setTrackWidth(other.trackWidth);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveKinematics clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ trackWidth = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveKinematics clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufDifferentialDriveKinematics)) {
+ return false;
+ }
+ ProtobufDifferentialDriveKinematics other = (ProtobufDifferentialDriveKinematics) o;
+ return bitField0_ == other.bitField0_
+ && (!hasTrackWidth() || ProtoUtil.isEqual(trackWidth, other.trackWidth));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(trackWidth);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufDifferentialDriveKinematics mergeFrom(final ProtoSource input) throws
+ IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // trackWidth
+ trackWidth = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.trackWidth, trackWidth);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufDifferentialDriveKinematics mergeFrom(final JsonSource input) throws
+ IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 1152213819:
+ case 1600986578: {
+ if (input.isAtField(FieldNames.trackWidth)) {
+ if (!input.trySkipNullValue()) {
+ trackWidth = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveKinematics clone() {
+ return new ProtobufDifferentialDriveKinematics().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufDifferentialDriveKinematics parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveKinematics(), data).checkInitialized();
+ }
+
+ public static ProtobufDifferentialDriveKinematics parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveKinematics(), input).checkInitialized();
+ }
+
+ public static ProtobufDifferentialDriveKinematics parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveKinematics(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufDifferentialDriveKinematics messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufDifferentialDriveKinematicsFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Kinematics.wpi_proto_ProtobufDifferentialDriveKinematics_descriptor;
+ }
+
+ private enum ProtobufDifferentialDriveKinematicsFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufDifferentialDriveKinematics create() {
+ return ProtobufDifferentialDriveKinematics.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName trackWidth = FieldName.forField("trackWidth", "track_width");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufDifferentialDriveWheelSpeeds}
+ */
+ public static final class ProtobufDifferentialDriveWheelSpeeds extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double left = 1;
+ */
+ private double left;
+
+ /**
+ * optional double right = 2;
+ */
+ private double right;
+
+ private ProtobufDifferentialDriveWheelSpeeds() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufDifferentialDriveWheelSpeeds}
+ */
+ public static ProtobufDifferentialDriveWheelSpeeds newInstance() {
+ return new ProtobufDifferentialDriveWheelSpeeds();
+ }
+
+ /**
+ * optional double left = 1;
+ * @return whether the left field is set
+ */
+ public boolean hasLeft() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double left = 1;
+ * @return this
+ */
+ public ProtobufDifferentialDriveWheelSpeeds clearLeft() {
+ bitField0_ &= ~0x00000001;
+ left = 0D;
+ return this;
+ }
+
+ /**
+ * optional double left = 1;
+ * @return the left
+ */
+ public double getLeft() {
+ return left;
+ }
+
+ /**
+ * optional double left = 1;
+ * @param value the left to set
+ * @return this
+ */
+ public ProtobufDifferentialDriveWheelSpeeds setLeft(final double value) {
+ bitField0_ |= 0x00000001;
+ left = value;
+ return this;
+ }
+
+ /**
+ * optional double right = 2;
+ * @return whether the right field is set
+ */
+ public boolean hasRight() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double right = 2;
+ * @return this
+ */
+ public ProtobufDifferentialDriveWheelSpeeds clearRight() {
+ bitField0_ &= ~0x00000002;
+ right = 0D;
+ return this;
+ }
+
+ /**
+ * optional double right = 2;
+ * @return the right
+ */
+ public double getRight() {
+ return right;
+ }
+
+ /**
+ * optional double right = 2;
+ * @param value the right to set
+ * @return this
+ */
+ public ProtobufDifferentialDriveWheelSpeeds setRight(final double value) {
+ bitField0_ |= 0x00000002;
+ right = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelSpeeds copyFrom(
+ final ProtobufDifferentialDriveWheelSpeeds other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ left = other.left;
+ right = other.right;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelSpeeds mergeFrom(
+ final ProtobufDifferentialDriveWheelSpeeds other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasLeft()) {
+ setLeft(other.left);
+ }
+ if (other.hasRight()) {
+ setRight(other.right);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelSpeeds clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ left = 0D;
+ right = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelSpeeds clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufDifferentialDriveWheelSpeeds)) {
+ return false;
+ }
+ ProtobufDifferentialDriveWheelSpeeds other = (ProtobufDifferentialDriveWheelSpeeds) o;
+ return bitField0_ == other.bitField0_
+ && (!hasLeft() || ProtoUtil.isEqual(left, other.left))
+ && (!hasRight() || ProtoUtil.isEqual(right, other.right));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(left);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(right);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufDifferentialDriveWheelSpeeds mergeFrom(final ProtoSource input) throws
+ IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // left
+ left = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // right
+ right = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.left, left);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.right, right);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelSpeeds mergeFrom(final JsonSource input) throws
+ IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 3317767: {
+ if (input.isAtField(FieldNames.left)) {
+ if (!input.trySkipNullValue()) {
+ left = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 108511772: {
+ if (input.isAtField(FieldNames.right)) {
+ if (!input.trySkipNullValue()) {
+ right = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufDifferentialDriveWheelSpeeds clone() {
+ return new ProtobufDifferentialDriveWheelSpeeds().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufDifferentialDriveWheelSpeeds parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelSpeeds(), data).checkInitialized();
+ }
+
+ public static ProtobufDifferentialDriveWheelSpeeds parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelSpeeds(), input).checkInitialized();
+ }
+
+ public static ProtobufDifferentialDriveWheelSpeeds parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufDifferentialDriveWheelSpeeds(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufDifferentialDriveWheelSpeeds messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufDifferentialDriveWheelSpeedsFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Kinematics.wpi_proto_ProtobufDifferentialDriveWheelSpeeds_descriptor;
+ }
+
+ private enum ProtobufDifferentialDriveWheelSpeedsFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufDifferentialDriveWheelSpeeds create() {
+ return ProtobufDifferentialDriveWheelSpeeds.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName left = FieldName.forField("left");
+
+ static final FieldName right = FieldName.forField("right");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufMecanumDriveKinematics}
+ */
+ public static final class ProtobufMecanumDriveKinematics extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_left = 1;
+ */
+ private final Geometry2D.ProtobufTranslation2d frontLeft = Geometry2D.ProtobufTranslation2d.newInstance();
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_right = 2;
+ */
+ private final Geometry2D.ProtobufTranslation2d frontRight = Geometry2D.ProtobufTranslation2d.newInstance();
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_left = 3;
+ */
+ private final Geometry2D.ProtobufTranslation2d rearLeft = Geometry2D.ProtobufTranslation2d.newInstance();
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_right = 4;
+ */
+ private final Geometry2D.ProtobufTranslation2d rearRight = Geometry2D.ProtobufTranslation2d.newInstance();
+
+ private ProtobufMecanumDriveKinematics() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufMecanumDriveKinematics}
+ */
+ public static ProtobufMecanumDriveKinematics newInstance() {
+ return new ProtobufMecanumDriveKinematics();
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_left = 1;
+ * @return whether the frontLeft field is set
+ */
+ public boolean hasFrontLeft() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_left = 1;
+ * @return this
+ */
+ public ProtobufMecanumDriveKinematics clearFrontLeft() {
+ bitField0_ &= ~0x00000001;
+ frontLeft.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_left = 1;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableFrontLeft()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public Geometry2D.ProtobufTranslation2d getFrontLeft() {
+ return frontLeft;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_left = 1;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public Geometry2D.ProtobufTranslation2d getMutableFrontLeft() {
+ bitField0_ |= 0x00000001;
+ return frontLeft;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_left = 1;
+ * @param value the frontLeft to set
+ * @return this
+ */
+ public ProtobufMecanumDriveKinematics setFrontLeft(
+ final Geometry2D.ProtobufTranslation2d value) {
+ bitField0_ |= 0x00000001;
+ frontLeft.copyFrom(value);
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_right = 2;
+ * @return whether the frontRight field is set
+ */
+ public boolean hasFrontRight() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_right = 2;
+ * @return this
+ */
+ public ProtobufMecanumDriveKinematics clearFrontRight() {
+ bitField0_ &= ~0x00000002;
+ frontRight.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_right = 2;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableFrontRight()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public Geometry2D.ProtobufTranslation2d getFrontRight() {
+ return frontRight;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_right = 2;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public Geometry2D.ProtobufTranslation2d getMutableFrontRight() {
+ bitField0_ |= 0x00000002;
+ return frontRight;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d front_right = 2;
+ * @param value the frontRight to set
+ * @return this
+ */
+ public ProtobufMecanumDriveKinematics setFrontRight(
+ final Geometry2D.ProtobufTranslation2d value) {
+ bitField0_ |= 0x00000002;
+ frontRight.copyFrom(value);
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_left = 3;
+ * @return whether the rearLeft field is set
+ */
+ public boolean hasRearLeft() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_left = 3;
+ * @return this
+ */
+ public ProtobufMecanumDriveKinematics clearRearLeft() {
+ bitField0_ &= ~0x00000004;
+ rearLeft.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_left = 3;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableRearLeft()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public Geometry2D.ProtobufTranslation2d getRearLeft() {
+ return rearLeft;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_left = 3;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public Geometry2D.ProtobufTranslation2d getMutableRearLeft() {
+ bitField0_ |= 0x00000004;
+ return rearLeft;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_left = 3;
+ * @param value the rearLeft to set
+ * @return this
+ */
+ public ProtobufMecanumDriveKinematics setRearLeft(
+ final Geometry2D.ProtobufTranslation2d value) {
+ bitField0_ |= 0x00000004;
+ rearLeft.copyFrom(value);
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_right = 4;
+ * @return whether the rearRight field is set
+ */
+ public boolean hasRearRight() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_right = 4;
+ * @return this
+ */
+ public ProtobufMecanumDriveKinematics clearRearRight() {
+ bitField0_ &= ~0x00000008;
+ rearRight.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_right = 4;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableRearRight()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public Geometry2D.ProtobufTranslation2d getRearRight() {
+ return rearRight;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_right = 4;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public Geometry2D.ProtobufTranslation2d getMutableRearRight() {
+ bitField0_ |= 0x00000008;
+ return rearRight;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufTranslation2d rear_right = 4;
+ * @param value the rearRight to set
+ * @return this
+ */
+ public ProtobufMecanumDriveKinematics setRearRight(
+ final Geometry2D.ProtobufTranslation2d value) {
+ bitField0_ |= 0x00000008;
+ rearRight.copyFrom(value);
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveKinematics copyFrom(final ProtobufMecanumDriveKinematics other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ frontLeft.copyFrom(other.frontLeft);
+ frontRight.copyFrom(other.frontRight);
+ rearLeft.copyFrom(other.rearLeft);
+ rearRight.copyFrom(other.rearRight);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveKinematics mergeFrom(final ProtobufMecanumDriveKinematics other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasFrontLeft()) {
+ getMutableFrontLeft().mergeFrom(other.frontLeft);
+ }
+ if (other.hasFrontRight()) {
+ getMutableFrontRight().mergeFrom(other.frontRight);
+ }
+ if (other.hasRearLeft()) {
+ getMutableRearLeft().mergeFrom(other.rearLeft);
+ }
+ if (other.hasRearRight()) {
+ getMutableRearRight().mergeFrom(other.rearRight);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveKinematics clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ frontLeft.clear();
+ frontRight.clear();
+ rearLeft.clear();
+ rearRight.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveKinematics clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ frontLeft.clearQuick();
+ frontRight.clearQuick();
+ rearLeft.clearQuick();
+ rearRight.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufMecanumDriveKinematics)) {
+ return false;
+ }
+ ProtobufMecanumDriveKinematics other = (ProtobufMecanumDriveKinematics) o;
+ return bitField0_ == other.bitField0_
+ && (!hasFrontLeft() || frontLeft.equals(other.frontLeft))
+ && (!hasFrontRight() || frontRight.equals(other.frontRight))
+ && (!hasRearLeft() || rearLeft.equals(other.rearLeft))
+ && (!hasRearRight() || rearRight.equals(other.rearRight));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 10);
+ output.writeMessageNoTag(frontLeft);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 18);
+ output.writeMessageNoTag(frontRight);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 26);
+ output.writeMessageNoTag(rearLeft);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 34);
+ output.writeMessageNoTag(rearRight);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(frontLeft);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(frontRight);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(rearLeft);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(rearRight);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufMecanumDriveKinematics mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 10: {
+ // frontLeft
+ input.readMessage(frontLeft);
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 18) {
+ break;
+ }
+ }
+ case 18: {
+ // frontRight
+ input.readMessage(frontRight);
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 26) {
+ break;
+ }
+ }
+ case 26: {
+ // rearLeft
+ input.readMessage(rearLeft);
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 34) {
+ break;
+ }
+ }
+ case 34: {
+ // rearRight
+ input.readMessage(rearRight);
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeMessage(FieldNames.frontLeft, frontLeft);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeMessage(FieldNames.frontRight, frontRight);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeMessage(FieldNames.rearLeft, rearLeft);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeMessage(FieldNames.rearRight, rearRight);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufMecanumDriveKinematics mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 127514064:
+ case -324277155: {
+ if (input.isAtField(FieldNames.frontLeft)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(frontLeft);
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -336370317:
+ case -1456996218: {
+ if (input.isAtField(FieldNames.frontRight)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(frontRight);
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -854852661:
+ case -712874558: {
+ if (input.isAtField(FieldNames.rearLeft)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(rearLeft);
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -724967720:
+ case -618613823: {
+ if (input.isAtField(FieldNames.rearRight)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(rearRight);
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveKinematics clone() {
+ return new ProtobufMecanumDriveKinematics().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufMecanumDriveKinematics parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveKinematics(), data).checkInitialized();
+ }
+
+ public static ProtobufMecanumDriveKinematics parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveKinematics(), input).checkInitialized();
+ }
+
+ public static ProtobufMecanumDriveKinematics parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveKinematics(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufMecanumDriveKinematics messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufMecanumDriveKinematicsFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Kinematics.wpi_proto_ProtobufMecanumDriveKinematics_descriptor;
+ }
+
+ private enum ProtobufMecanumDriveKinematicsFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufMecanumDriveKinematics create() {
+ return ProtobufMecanumDriveKinematics.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName frontLeft = FieldName.forField("frontLeft", "front_left");
+
+ static final FieldName frontRight = FieldName.forField("frontRight", "front_right");
+
+ static final FieldName rearLeft = FieldName.forField("rearLeft", "rear_left");
+
+ static final FieldName rearRight = FieldName.forField("rearRight", "rear_right");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufMecanumDriveMotorVoltages}
+ */
+ public static final class ProtobufMecanumDriveMotorVoltages extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double front_left = 1;
+ */
+ private double frontLeft;
+
+ /**
+ * optional double front_right = 2;
+ */
+ private double frontRight;
+
+ /**
+ * optional double rear_left = 3;
+ */
+ private double rearLeft;
+
+ /**
+ * optional double rear_right = 4;
+ */
+ private double rearRight;
+
+ private ProtobufMecanumDriveMotorVoltages() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufMecanumDriveMotorVoltages}
+ */
+ public static ProtobufMecanumDriveMotorVoltages newInstance() {
+ return new ProtobufMecanumDriveMotorVoltages();
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @return whether the frontLeft field is set
+ */
+ public boolean hasFrontLeft() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @return this
+ */
+ public ProtobufMecanumDriveMotorVoltages clearFrontLeft() {
+ bitField0_ &= ~0x00000001;
+ frontLeft = 0D;
+ return this;
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @return the frontLeft
+ */
+ public double getFrontLeft() {
+ return frontLeft;
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @param value the frontLeft to set
+ * @return this
+ */
+ public ProtobufMecanumDriveMotorVoltages setFrontLeft(final double value) {
+ bitField0_ |= 0x00000001;
+ frontLeft = value;
+ return this;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @return whether the frontRight field is set
+ */
+ public boolean hasFrontRight() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @return this
+ */
+ public ProtobufMecanumDriveMotorVoltages clearFrontRight() {
+ bitField0_ &= ~0x00000002;
+ frontRight = 0D;
+ return this;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @return the frontRight
+ */
+ public double getFrontRight() {
+ return frontRight;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @param value the frontRight to set
+ * @return this
+ */
+ public ProtobufMecanumDriveMotorVoltages setFrontRight(final double value) {
+ bitField0_ |= 0x00000002;
+ frontRight = value;
+ return this;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @return whether the rearLeft field is set
+ */
+ public boolean hasRearLeft() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @return this
+ */
+ public ProtobufMecanumDriveMotorVoltages clearRearLeft() {
+ bitField0_ &= ~0x00000004;
+ rearLeft = 0D;
+ return this;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @return the rearLeft
+ */
+ public double getRearLeft() {
+ return rearLeft;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @param value the rearLeft to set
+ * @return this
+ */
+ public ProtobufMecanumDriveMotorVoltages setRearLeft(final double value) {
+ bitField0_ |= 0x00000004;
+ rearLeft = value;
+ return this;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @return whether the rearRight field is set
+ */
+ public boolean hasRearRight() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @return this
+ */
+ public ProtobufMecanumDriveMotorVoltages clearRearRight() {
+ bitField0_ &= ~0x00000008;
+ rearRight = 0D;
+ return this;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @return the rearRight
+ */
+ public double getRearRight() {
+ return rearRight;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @param value the rearRight to set
+ * @return this
+ */
+ public ProtobufMecanumDriveMotorVoltages setRearRight(final double value) {
+ bitField0_ |= 0x00000008;
+ rearRight = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveMotorVoltages copyFrom(
+ final ProtobufMecanumDriveMotorVoltages other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ frontLeft = other.frontLeft;
+ frontRight = other.frontRight;
+ rearLeft = other.rearLeft;
+ rearRight = other.rearRight;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveMotorVoltages mergeFrom(
+ final ProtobufMecanumDriveMotorVoltages other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasFrontLeft()) {
+ setFrontLeft(other.frontLeft);
+ }
+ if (other.hasFrontRight()) {
+ setFrontRight(other.frontRight);
+ }
+ if (other.hasRearLeft()) {
+ setRearLeft(other.rearLeft);
+ }
+ if (other.hasRearRight()) {
+ setRearRight(other.rearRight);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveMotorVoltages clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ frontLeft = 0D;
+ frontRight = 0D;
+ rearLeft = 0D;
+ rearRight = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveMotorVoltages clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufMecanumDriveMotorVoltages)) {
+ return false;
+ }
+ ProtobufMecanumDriveMotorVoltages other = (ProtobufMecanumDriveMotorVoltages) o;
+ return bitField0_ == other.bitField0_
+ && (!hasFrontLeft() || ProtoUtil.isEqual(frontLeft, other.frontLeft))
+ && (!hasFrontRight() || ProtoUtil.isEqual(frontRight, other.frontRight))
+ && (!hasRearLeft() || ProtoUtil.isEqual(rearLeft, other.rearLeft))
+ && (!hasRearRight() || ProtoUtil.isEqual(rearRight, other.rearRight));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(frontLeft);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(frontRight);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(rearLeft);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 33);
+ output.writeDoubleNoTag(rearRight);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufMecanumDriveMotorVoltages mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // frontLeft
+ frontLeft = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // frontRight
+ frontRight = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // rearLeft
+ rearLeft = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 33) {
+ break;
+ }
+ }
+ case 33: {
+ // rearRight
+ rearRight = input.readDouble();
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.frontLeft, frontLeft);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.frontRight, frontRight);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.rearLeft, rearLeft);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeDouble(FieldNames.rearRight, rearRight);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufMecanumDriveMotorVoltages mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 127514064:
+ case -324277155: {
+ if (input.isAtField(FieldNames.frontLeft)) {
+ if (!input.trySkipNullValue()) {
+ frontLeft = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -336370317:
+ case -1456996218: {
+ if (input.isAtField(FieldNames.frontRight)) {
+ if (!input.trySkipNullValue()) {
+ frontRight = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -854852661:
+ case -712874558: {
+ if (input.isAtField(FieldNames.rearLeft)) {
+ if (!input.trySkipNullValue()) {
+ rearLeft = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -724967720:
+ case -618613823: {
+ if (input.isAtField(FieldNames.rearRight)) {
+ if (!input.trySkipNullValue()) {
+ rearRight = input.readDouble();
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveMotorVoltages clone() {
+ return new ProtobufMecanumDriveMotorVoltages().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufMecanumDriveMotorVoltages parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveMotorVoltages(), data).checkInitialized();
+ }
+
+ public static ProtobufMecanumDriveMotorVoltages parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveMotorVoltages(), input).checkInitialized();
+ }
+
+ public static ProtobufMecanumDriveMotorVoltages parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveMotorVoltages(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufMecanumDriveMotorVoltages messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufMecanumDriveMotorVoltagesFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Kinematics.wpi_proto_ProtobufMecanumDriveMotorVoltages_descriptor;
+ }
+
+ private enum ProtobufMecanumDriveMotorVoltagesFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufMecanumDriveMotorVoltages create() {
+ return ProtobufMecanumDriveMotorVoltages.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName frontLeft = FieldName.forField("frontLeft", "front_left");
+
+ static final FieldName frontRight = FieldName.forField("frontRight", "front_right");
+
+ static final FieldName rearLeft = FieldName.forField("rearLeft", "rear_left");
+
+ static final FieldName rearRight = FieldName.forField("rearRight", "rear_right");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufMecanumDriveWheelPositions}
+ */
+ public static final class ProtobufMecanumDriveWheelPositions extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double front_left = 1;
+ */
+ private double frontLeft;
+
+ /**
+ * optional double front_right = 2;
+ */
+ private double frontRight;
+
+ /**
+ * optional double rear_left = 3;
+ */
+ private double rearLeft;
+
+ /**
+ * optional double rear_right = 4;
+ */
+ private double rearRight;
+
+ private ProtobufMecanumDriveWheelPositions() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufMecanumDriveWheelPositions}
+ */
+ public static ProtobufMecanumDriveWheelPositions newInstance() {
+ return new ProtobufMecanumDriveWheelPositions();
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @return whether the frontLeft field is set
+ */
+ public boolean hasFrontLeft() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelPositions clearFrontLeft() {
+ bitField0_ &= ~0x00000001;
+ frontLeft = 0D;
+ return this;
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @return the frontLeft
+ */
+ public double getFrontLeft() {
+ return frontLeft;
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @param value the frontLeft to set
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelPositions setFrontLeft(final double value) {
+ bitField0_ |= 0x00000001;
+ frontLeft = value;
+ return this;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @return whether the frontRight field is set
+ */
+ public boolean hasFrontRight() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelPositions clearFrontRight() {
+ bitField0_ &= ~0x00000002;
+ frontRight = 0D;
+ return this;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @return the frontRight
+ */
+ public double getFrontRight() {
+ return frontRight;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @param value the frontRight to set
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelPositions setFrontRight(final double value) {
+ bitField0_ |= 0x00000002;
+ frontRight = value;
+ return this;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @return whether the rearLeft field is set
+ */
+ public boolean hasRearLeft() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelPositions clearRearLeft() {
+ bitField0_ &= ~0x00000004;
+ rearLeft = 0D;
+ return this;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @return the rearLeft
+ */
+ public double getRearLeft() {
+ return rearLeft;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @param value the rearLeft to set
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelPositions setRearLeft(final double value) {
+ bitField0_ |= 0x00000004;
+ rearLeft = value;
+ return this;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @return whether the rearRight field is set
+ */
+ public boolean hasRearRight() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelPositions clearRearRight() {
+ bitField0_ &= ~0x00000008;
+ rearRight = 0D;
+ return this;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @return the rearRight
+ */
+ public double getRearRight() {
+ return rearRight;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @param value the rearRight to set
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelPositions setRearRight(final double value) {
+ bitField0_ |= 0x00000008;
+ rearRight = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelPositions copyFrom(
+ final ProtobufMecanumDriveWheelPositions other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ frontLeft = other.frontLeft;
+ frontRight = other.frontRight;
+ rearLeft = other.rearLeft;
+ rearRight = other.rearRight;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelPositions mergeFrom(
+ final ProtobufMecanumDriveWheelPositions other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasFrontLeft()) {
+ setFrontLeft(other.frontLeft);
+ }
+ if (other.hasFrontRight()) {
+ setFrontRight(other.frontRight);
+ }
+ if (other.hasRearLeft()) {
+ setRearLeft(other.rearLeft);
+ }
+ if (other.hasRearRight()) {
+ setRearRight(other.rearRight);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelPositions clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ frontLeft = 0D;
+ frontRight = 0D;
+ rearLeft = 0D;
+ rearRight = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelPositions clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufMecanumDriveWheelPositions)) {
+ return false;
+ }
+ ProtobufMecanumDriveWheelPositions other = (ProtobufMecanumDriveWheelPositions) o;
+ return bitField0_ == other.bitField0_
+ && (!hasFrontLeft() || ProtoUtil.isEqual(frontLeft, other.frontLeft))
+ && (!hasFrontRight() || ProtoUtil.isEqual(frontRight, other.frontRight))
+ && (!hasRearLeft() || ProtoUtil.isEqual(rearLeft, other.rearLeft))
+ && (!hasRearRight() || ProtoUtil.isEqual(rearRight, other.rearRight));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(frontLeft);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(frontRight);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(rearLeft);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 33);
+ output.writeDoubleNoTag(rearRight);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufMecanumDriveWheelPositions mergeFrom(final ProtoSource input) throws
+ IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // frontLeft
+ frontLeft = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // frontRight
+ frontRight = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // rearLeft
+ rearLeft = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 33) {
+ break;
+ }
+ }
+ case 33: {
+ // rearRight
+ rearRight = input.readDouble();
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.frontLeft, frontLeft);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.frontRight, frontRight);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.rearLeft, rearLeft);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeDouble(FieldNames.rearRight, rearRight);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelPositions mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 127514064:
+ case -324277155: {
+ if (input.isAtField(FieldNames.frontLeft)) {
+ if (!input.trySkipNullValue()) {
+ frontLeft = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -336370317:
+ case -1456996218: {
+ if (input.isAtField(FieldNames.frontRight)) {
+ if (!input.trySkipNullValue()) {
+ frontRight = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -854852661:
+ case -712874558: {
+ if (input.isAtField(FieldNames.rearLeft)) {
+ if (!input.trySkipNullValue()) {
+ rearLeft = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -724967720:
+ case -618613823: {
+ if (input.isAtField(FieldNames.rearRight)) {
+ if (!input.trySkipNullValue()) {
+ rearRight = input.readDouble();
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelPositions clone() {
+ return new ProtobufMecanumDriveWheelPositions().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufMecanumDriveWheelPositions parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelPositions(), data).checkInitialized();
+ }
+
+ public static ProtobufMecanumDriveWheelPositions parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelPositions(), input).checkInitialized();
+ }
+
+ public static ProtobufMecanumDriveWheelPositions parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelPositions(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufMecanumDriveWheelPositions messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufMecanumDriveWheelPositionsFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Kinematics.wpi_proto_ProtobufMecanumDriveWheelPositions_descriptor;
+ }
+
+ private enum ProtobufMecanumDriveWheelPositionsFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufMecanumDriveWheelPositions create() {
+ return ProtobufMecanumDriveWheelPositions.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName frontLeft = FieldName.forField("frontLeft", "front_left");
+
+ static final FieldName frontRight = FieldName.forField("frontRight", "front_right");
+
+ static final FieldName rearLeft = FieldName.forField("rearLeft", "rear_left");
+
+ static final FieldName rearRight = FieldName.forField("rearRight", "rear_right");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufMecanumDriveWheelSpeeds}
+ */
+ public static final class ProtobufMecanumDriveWheelSpeeds extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double front_left = 1;
+ */
+ private double frontLeft;
+
+ /**
+ * optional double front_right = 2;
+ */
+ private double frontRight;
+
+ /**
+ * optional double rear_left = 3;
+ */
+ private double rearLeft;
+
+ /**
+ * optional double rear_right = 4;
+ */
+ private double rearRight;
+
+ private ProtobufMecanumDriveWheelSpeeds() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufMecanumDriveWheelSpeeds}
+ */
+ public static ProtobufMecanumDriveWheelSpeeds newInstance() {
+ return new ProtobufMecanumDriveWheelSpeeds();
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @return whether the frontLeft field is set
+ */
+ public boolean hasFrontLeft() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelSpeeds clearFrontLeft() {
+ bitField0_ &= ~0x00000001;
+ frontLeft = 0D;
+ return this;
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @return the frontLeft
+ */
+ public double getFrontLeft() {
+ return frontLeft;
+ }
+
+ /**
+ * optional double front_left = 1;
+ * @param value the frontLeft to set
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelSpeeds setFrontLeft(final double value) {
+ bitField0_ |= 0x00000001;
+ frontLeft = value;
+ return this;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @return whether the frontRight field is set
+ */
+ public boolean hasFrontRight() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelSpeeds clearFrontRight() {
+ bitField0_ &= ~0x00000002;
+ frontRight = 0D;
+ return this;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @return the frontRight
+ */
+ public double getFrontRight() {
+ return frontRight;
+ }
+
+ /**
+ * optional double front_right = 2;
+ * @param value the frontRight to set
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelSpeeds setFrontRight(final double value) {
+ bitField0_ |= 0x00000002;
+ frontRight = value;
+ return this;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @return whether the rearLeft field is set
+ */
+ public boolean hasRearLeft() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelSpeeds clearRearLeft() {
+ bitField0_ &= ~0x00000004;
+ rearLeft = 0D;
+ return this;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @return the rearLeft
+ */
+ public double getRearLeft() {
+ return rearLeft;
+ }
+
+ /**
+ * optional double rear_left = 3;
+ * @param value the rearLeft to set
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelSpeeds setRearLeft(final double value) {
+ bitField0_ |= 0x00000004;
+ rearLeft = value;
+ return this;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @return whether the rearRight field is set
+ */
+ public boolean hasRearRight() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelSpeeds clearRearRight() {
+ bitField0_ &= ~0x00000008;
+ rearRight = 0D;
+ return this;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @return the rearRight
+ */
+ public double getRearRight() {
+ return rearRight;
+ }
+
+ /**
+ * optional double rear_right = 4;
+ * @param value the rearRight to set
+ * @return this
+ */
+ public ProtobufMecanumDriveWheelSpeeds setRearRight(final double value) {
+ bitField0_ |= 0x00000008;
+ rearRight = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelSpeeds copyFrom(final ProtobufMecanumDriveWheelSpeeds other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ frontLeft = other.frontLeft;
+ frontRight = other.frontRight;
+ rearLeft = other.rearLeft;
+ rearRight = other.rearRight;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelSpeeds mergeFrom(final ProtobufMecanumDriveWheelSpeeds other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasFrontLeft()) {
+ setFrontLeft(other.frontLeft);
+ }
+ if (other.hasFrontRight()) {
+ setFrontRight(other.frontRight);
+ }
+ if (other.hasRearLeft()) {
+ setRearLeft(other.rearLeft);
+ }
+ if (other.hasRearRight()) {
+ setRearRight(other.rearRight);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelSpeeds clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ frontLeft = 0D;
+ frontRight = 0D;
+ rearLeft = 0D;
+ rearRight = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelSpeeds clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufMecanumDriveWheelSpeeds)) {
+ return false;
+ }
+ ProtobufMecanumDriveWheelSpeeds other = (ProtobufMecanumDriveWheelSpeeds) o;
+ return bitField0_ == other.bitField0_
+ && (!hasFrontLeft() || ProtoUtil.isEqual(frontLeft, other.frontLeft))
+ && (!hasFrontRight() || ProtoUtil.isEqual(frontRight, other.frontRight))
+ && (!hasRearLeft() || ProtoUtil.isEqual(rearLeft, other.rearLeft))
+ && (!hasRearRight() || ProtoUtil.isEqual(rearRight, other.rearRight));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(frontLeft);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(frontRight);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(rearLeft);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 33);
+ output.writeDoubleNoTag(rearRight);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufMecanumDriveWheelSpeeds mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // frontLeft
+ frontLeft = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // frontRight
+ frontRight = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // rearLeft
+ rearLeft = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 33) {
+ break;
+ }
+ }
+ case 33: {
+ // rearRight
+ rearRight = input.readDouble();
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.frontLeft, frontLeft);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.frontRight, frontRight);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.rearLeft, rearLeft);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeDouble(FieldNames.rearRight, rearRight);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelSpeeds mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 127514064:
+ case -324277155: {
+ if (input.isAtField(FieldNames.frontLeft)) {
+ if (!input.trySkipNullValue()) {
+ frontLeft = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -336370317:
+ case -1456996218: {
+ if (input.isAtField(FieldNames.frontRight)) {
+ if (!input.trySkipNullValue()) {
+ frontRight = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -854852661:
+ case -712874558: {
+ if (input.isAtField(FieldNames.rearLeft)) {
+ if (!input.trySkipNullValue()) {
+ rearLeft = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -724967720:
+ case -618613823: {
+ if (input.isAtField(FieldNames.rearRight)) {
+ if (!input.trySkipNullValue()) {
+ rearRight = input.readDouble();
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufMecanumDriveWheelSpeeds clone() {
+ return new ProtobufMecanumDriveWheelSpeeds().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufMecanumDriveWheelSpeeds parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelSpeeds(), data).checkInitialized();
+ }
+
+ public static ProtobufMecanumDriveWheelSpeeds parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelSpeeds(), input).checkInitialized();
+ }
+
+ public static ProtobufMecanumDriveWheelSpeeds parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufMecanumDriveWheelSpeeds(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufMecanumDriveWheelSpeeds messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufMecanumDriveWheelSpeedsFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Kinematics.wpi_proto_ProtobufMecanumDriveWheelSpeeds_descriptor;
+ }
+
+ private enum ProtobufMecanumDriveWheelSpeedsFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufMecanumDriveWheelSpeeds create() {
+ return ProtobufMecanumDriveWheelSpeeds.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName frontLeft = FieldName.forField("frontLeft", "front_left");
+
+ static final FieldName frontRight = FieldName.forField("frontRight", "front_right");
+
+ static final FieldName rearLeft = FieldName.forField("rearLeft", "rear_left");
+
+ static final FieldName rearRight = FieldName.forField("rearRight", "rear_right");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufSwerveDriveKinematics}
+ */
+ public static final class ProtobufSwerveDriveKinematics extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * repeated .wpi.proto.ProtobufTranslation2d modules = 1;
+ */
+ private final RepeatedMessage modules = RepeatedMessage.newEmptyInstance(Geometry2D.ProtobufTranslation2d.getFactory());
+
+ private ProtobufSwerveDriveKinematics() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufSwerveDriveKinematics}
+ */
+ public static ProtobufSwerveDriveKinematics newInstance() {
+ return new ProtobufSwerveDriveKinematics();
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTranslation2d modules = 1;
+ * @return whether the modules field is set
+ */
+ public boolean hasModules() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTranslation2d modules = 1;
+ * @return this
+ */
+ public ProtobufSwerveDriveKinematics clearModules() {
+ bitField0_ &= ~0x00000001;
+ modules.clear();
+ return this;
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTranslation2d modules = 1;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableModules()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedMessage getModules() {
+ return modules;
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTranslation2d modules = 1;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedMessage getMutableModules() {
+ bitField0_ |= 0x00000001;
+ return modules;
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTranslation2d modules = 1;
+ * @param value the modules to add
+ * @return this
+ */
+ public ProtobufSwerveDriveKinematics addModules(final Geometry2D.ProtobufTranslation2d value) {
+ bitField0_ |= 0x00000001;
+ modules.add(value);
+ return this;
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTranslation2d modules = 1;
+ * @param values the modules to add
+ * @return this
+ */
+ public ProtobufSwerveDriveKinematics addAllModules(
+ final Geometry2D.ProtobufTranslation2d... values) {
+ bitField0_ |= 0x00000001;
+ modules.addAll(values);
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveDriveKinematics copyFrom(final ProtobufSwerveDriveKinematics other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ modules.copyFrom(other.modules);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveDriveKinematics mergeFrom(final ProtobufSwerveDriveKinematics other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasModules()) {
+ getMutableModules().addAll(other.modules);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveDriveKinematics clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ modules.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveDriveKinematics clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ modules.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufSwerveDriveKinematics)) {
+ return false;
+ }
+ ProtobufSwerveDriveKinematics other = (ProtobufSwerveDriveKinematics) o;
+ return bitField0_ == other.bitField0_
+ && (!hasModules() || modules.equals(other.modules));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ for (int i = 0; i < modules.length(); i++) {
+ output.writeRawByte((byte) 10);
+ output.writeMessageNoTag(modules.get(i));
+ }
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += (1 * modules.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(modules);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufSwerveDriveKinematics mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 10: {
+ // modules
+ tag = input.readRepeatedMessage(modules, tag);
+ bitField0_ |= 0x00000001;
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRepeatedMessage(FieldNames.modules, modules);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufSwerveDriveKinematics mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 1227433863: {
+ if (input.isAtField(FieldNames.modules)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedMessage(modules);
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveDriveKinematics clone() {
+ return new ProtobufSwerveDriveKinematics().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufSwerveDriveKinematics parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufSwerveDriveKinematics(), data).checkInitialized();
+ }
+
+ public static ProtobufSwerveDriveKinematics parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufSwerveDriveKinematics(), input).checkInitialized();
+ }
+
+ public static ProtobufSwerveDriveKinematics parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufSwerveDriveKinematics(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufSwerveDriveKinematics messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufSwerveDriveKinematicsFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Kinematics.wpi_proto_ProtobufSwerveDriveKinematics_descriptor;
+ }
+
+ private enum ProtobufSwerveDriveKinematicsFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufSwerveDriveKinematics create() {
+ return ProtobufSwerveDriveKinematics.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName modules = FieldName.forField("modules");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufSwerveModulePosition}
+ */
+ public static final class ProtobufSwerveModulePosition extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double distance = 1;
+ */
+ private double distance;
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ */
+ private final Geometry2D.ProtobufRotation2d angle = Geometry2D.ProtobufRotation2d.newInstance();
+
+ private ProtobufSwerveModulePosition() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufSwerveModulePosition}
+ */
+ public static ProtobufSwerveModulePosition newInstance() {
+ return new ProtobufSwerveModulePosition();
+ }
+
+ /**
+ * optional double distance = 1;
+ * @return whether the distance field is set
+ */
+ public boolean hasDistance() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double distance = 1;
+ * @return this
+ */
+ public ProtobufSwerveModulePosition clearDistance() {
+ bitField0_ &= ~0x00000001;
+ distance = 0D;
+ return this;
+ }
+
+ /**
+ * optional double distance = 1;
+ * @return the distance
+ */
+ public double getDistance() {
+ return distance;
+ }
+
+ /**
+ * optional double distance = 1;
+ * @param value the distance to set
+ * @return this
+ */
+ public ProtobufSwerveModulePosition setDistance(final double value) {
+ bitField0_ |= 0x00000001;
+ distance = value;
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ * @return whether the angle field is set
+ */
+ public boolean hasAngle() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ * @return this
+ */
+ public ProtobufSwerveModulePosition clearAngle() {
+ bitField0_ &= ~0x00000002;
+ angle.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableAngle()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public Geometry2D.ProtobufRotation2d getAngle() {
+ return angle;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public Geometry2D.ProtobufRotation2d getMutableAngle() {
+ bitField0_ |= 0x00000002;
+ return angle;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ * @param value the angle to set
+ * @return this
+ */
+ public ProtobufSwerveModulePosition setAngle(final Geometry2D.ProtobufRotation2d value) {
+ bitField0_ |= 0x00000002;
+ angle.copyFrom(value);
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveModulePosition copyFrom(final ProtobufSwerveModulePosition other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ distance = other.distance;
+ angle.copyFrom(other.angle);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveModulePosition mergeFrom(final ProtobufSwerveModulePosition other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasDistance()) {
+ setDistance(other.distance);
+ }
+ if (other.hasAngle()) {
+ getMutableAngle().mergeFrom(other.angle);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveModulePosition clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ distance = 0D;
+ angle.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveModulePosition clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ angle.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufSwerveModulePosition)) {
+ return false;
+ }
+ ProtobufSwerveModulePosition other = (ProtobufSwerveModulePosition) o;
+ return bitField0_ == other.bitField0_
+ && (!hasDistance() || ProtoUtil.isEqual(distance, other.distance))
+ && (!hasAngle() || angle.equals(other.angle));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(distance);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 18);
+ output.writeMessageNoTag(angle);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(angle);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufSwerveModulePosition mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // distance
+ distance = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 18) {
+ break;
+ }
+ }
+ case 18: {
+ // angle
+ input.readMessage(angle);
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.distance, distance);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeMessage(FieldNames.angle, angle);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufSwerveModulePosition mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 288459765: {
+ if (input.isAtField(FieldNames.distance)) {
+ if (!input.trySkipNullValue()) {
+ distance = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 92960979: {
+ if (input.isAtField(FieldNames.angle)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(angle);
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveModulePosition clone() {
+ return new ProtobufSwerveModulePosition().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufSwerveModulePosition parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufSwerveModulePosition(), data).checkInitialized();
+ }
+
+ public static ProtobufSwerveModulePosition parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufSwerveModulePosition(), input).checkInitialized();
+ }
+
+ public static ProtobufSwerveModulePosition parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufSwerveModulePosition(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufSwerveModulePosition messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufSwerveModulePositionFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Kinematics.wpi_proto_ProtobufSwerveModulePosition_descriptor;
+ }
+
+ private enum ProtobufSwerveModulePositionFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufSwerveModulePosition create() {
+ return ProtobufSwerveModulePosition.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName distance = FieldName.forField("distance");
+
+ static final FieldName angle = FieldName.forField("angle");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufSwerveModuleState}
+ */
+ public static final class ProtobufSwerveModuleState extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double speed = 1;
+ */
+ private double speed;
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ */
+ private final Geometry2D.ProtobufRotation2d angle = Geometry2D.ProtobufRotation2d.newInstance();
+
+ private ProtobufSwerveModuleState() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufSwerveModuleState}
+ */
+ public static ProtobufSwerveModuleState newInstance() {
+ return new ProtobufSwerveModuleState();
+ }
+
+ /**
+ * optional double speed = 1;
+ * @return whether the speed field is set
+ */
+ public boolean hasSpeed() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double speed = 1;
+ * @return this
+ */
+ public ProtobufSwerveModuleState clearSpeed() {
+ bitField0_ &= ~0x00000001;
+ speed = 0D;
+ return this;
+ }
+
+ /**
+ * optional double speed = 1;
+ * @return the speed
+ */
+ public double getSpeed() {
+ return speed;
+ }
+
+ /**
+ * optional double speed = 1;
+ * @param value the speed to set
+ * @return this
+ */
+ public ProtobufSwerveModuleState setSpeed(final double value) {
+ bitField0_ |= 0x00000001;
+ speed = value;
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ * @return whether the angle field is set
+ */
+ public boolean hasAngle() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ * @return this
+ */
+ public ProtobufSwerveModuleState clearAngle() {
+ bitField0_ &= ~0x00000002;
+ angle.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableAngle()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public Geometry2D.ProtobufRotation2d getAngle() {
+ return angle;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public Geometry2D.ProtobufRotation2d getMutableAngle() {
+ bitField0_ |= 0x00000002;
+ return angle;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufRotation2d angle = 2;
+ * @param value the angle to set
+ * @return this
+ */
+ public ProtobufSwerveModuleState setAngle(final Geometry2D.ProtobufRotation2d value) {
+ bitField0_ |= 0x00000002;
+ angle.copyFrom(value);
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveModuleState copyFrom(final ProtobufSwerveModuleState other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ speed = other.speed;
+ angle.copyFrom(other.angle);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveModuleState mergeFrom(final ProtobufSwerveModuleState other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasSpeed()) {
+ setSpeed(other.speed);
+ }
+ if (other.hasAngle()) {
+ getMutableAngle().mergeFrom(other.angle);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveModuleState clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ speed = 0D;
+ angle.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveModuleState clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ angle.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufSwerveModuleState)) {
+ return false;
+ }
+ ProtobufSwerveModuleState other = (ProtobufSwerveModuleState) o;
+ return bitField0_ == other.bitField0_
+ && (!hasSpeed() || ProtoUtil.isEqual(speed, other.speed))
+ && (!hasAngle() || angle.equals(other.angle));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(speed);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 18);
+ output.writeMessageNoTag(angle);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(angle);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufSwerveModuleState mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // speed
+ speed = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 18) {
+ break;
+ }
+ }
+ case 18: {
+ // angle
+ input.readMessage(angle);
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.speed, speed);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeMessage(FieldNames.angle, angle);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufSwerveModuleState mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 109641799: {
+ if (input.isAtField(FieldNames.speed)) {
+ if (!input.trySkipNullValue()) {
+ speed = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 92960979: {
+ if (input.isAtField(FieldNames.angle)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(angle);
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufSwerveModuleState clone() {
+ return new ProtobufSwerveModuleState().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufSwerveModuleState parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufSwerveModuleState(), data).checkInitialized();
+ }
+
+ public static ProtobufSwerveModuleState parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufSwerveModuleState(), input).checkInitialized();
+ }
+
+ public static ProtobufSwerveModuleState parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufSwerveModuleState(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufSwerveModuleState messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufSwerveModuleStateFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Kinematics.wpi_proto_ProtobufSwerveModuleState_descriptor;
+ }
+
+ private enum ProtobufSwerveModuleStateFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufSwerveModuleState create() {
+ return ProtobufSwerveModuleState.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName speed = FieldName.forField("speed");
+
+ static final FieldName angle = FieldName.forField("angle");
+ }
+ }
+}
diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Plant.java b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Plant.java
new file mode 100644
index 0000000000..61b758fd12
--- /dev/null
+++ b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Plant.java
@@ -0,0 +1,621 @@
+// Copyright (c) FIRST and other WPILib contributors.
+// Open Source Software; you can modify and/or share it under the terms of
+// the WPILib BSD license file in the root directory of this project.
+// Code generated by protocol buffer compiler. Do not edit!
+package edu.wpi.first.math.proto;
+
+import java.io.IOException;
+import us.hebi.quickbuf.Descriptors;
+import us.hebi.quickbuf.FieldName;
+import us.hebi.quickbuf.InvalidProtocolBufferException;
+import us.hebi.quickbuf.JsonSink;
+import us.hebi.quickbuf.JsonSource;
+import us.hebi.quickbuf.MessageFactory;
+import us.hebi.quickbuf.ProtoMessage;
+import us.hebi.quickbuf.ProtoSink;
+import us.hebi.quickbuf.ProtoSource;
+import us.hebi.quickbuf.ProtoUtil;
+import us.hebi.quickbuf.RepeatedByte;
+
+public final class Plant {
+ private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(610,
+ "CgtwbGFudC5wcm90bxIJd3BpLnByb3RvIsQBCg9Qcm90b2J1ZkRDTW90b3ISJwoPbm9taW5hbF92b2x0" +
+ "YWdlGAEgASgBUg5ub21pbmFsVm9sdGFnZRIhCgxzdGFsbF90b3JxdWUYAiABKAFSC3N0YWxsVG9ycXVl" +
+ "EiMKDXN0YWxsX2N1cnJlbnQYAyABKAFSDHN0YWxsQ3VycmVudBIhCgxmcmVlX2N1cnJlbnQYBCABKAFS" +
+ "C2ZyZWVDdXJyZW50Eh0KCmZyZWVfc3BlZWQYBSABKAFSCWZyZWVTcGVlZEIaChhlZHUud3BpLmZpcnN0" +
+ "Lm1hdGgucHJvdG9K3AIKBhIEAAAMAQoICgEMEgMAABIKCAoBAhIDAgASCggKAQgSAwQAMQoJCgIIARID" +
+ "BAAxCgoKAgQAEgQGAAwBCgoKAwQAARIDBggXCgsKBAQAAgASAwcCHQoMCgUEAAIABRIDBwIICgwKBQQA" +
+ "AgABEgMHCRgKDAoFBAACAAMSAwcbHAoLCgQEAAIBEgMIAhoKDAoFBAACAQUSAwgCCAoMCgUEAAIBARID" +
+ "CAkVCgwKBQQAAgEDEgMIGBkKCwoEBAACAhIDCQIbCgwKBQQAAgIFEgMJAggKDAoFBAACAgESAwkJFgoM" +
+ "CgUEAAICAxIDCRkaCgsKBAQAAgMSAwoCGgoMCgUEAAIDBRIDCgIICgwKBQQAAgMBEgMKCRUKDAoFBAAC" +
+ "AwMSAwoYGQoLCgQEAAIEEgMLAhgKDAoFBAACBAUSAwsCCAoMCgUEAAIEARIDCwkTCgwKBQQAAgQDEgML" +
+ "FhdiBnByb3RvMw==");
+
+ static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("plant.proto", "wpi.proto", descriptorData);
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufDCMotor_descriptor = descriptor.internalContainedType(27, 196, "ProtobufDCMotor", "wpi.proto.ProtobufDCMotor");
+
+ /**
+ * @return this proto file's descriptor.
+ */
+ public static Descriptors.FileDescriptor getDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Protobuf type {@code ProtobufDCMotor}
+ */
+ public static final class ProtobufDCMotor extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double nominal_voltage = 1;
+ */
+ private double nominalVoltage;
+
+ /**
+ * optional double stall_torque = 2;
+ */
+ private double stallTorque;
+
+ /**
+ * optional double stall_current = 3;
+ */
+ private double stallCurrent;
+
+ /**
+ * optional double free_current = 4;
+ */
+ private double freeCurrent;
+
+ /**
+ * optional double free_speed = 5;
+ */
+ private double freeSpeed;
+
+ private ProtobufDCMotor() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufDCMotor}
+ */
+ public static ProtobufDCMotor newInstance() {
+ return new ProtobufDCMotor();
+ }
+
+ /**
+ * optional double nominal_voltage = 1;
+ * @return whether the nominalVoltage field is set
+ */
+ public boolean hasNominalVoltage() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double nominal_voltage = 1;
+ * @return this
+ */
+ public ProtobufDCMotor clearNominalVoltage() {
+ bitField0_ &= ~0x00000001;
+ nominalVoltage = 0D;
+ return this;
+ }
+
+ /**
+ * optional double nominal_voltage = 1;
+ * @return the nominalVoltage
+ */
+ public double getNominalVoltage() {
+ return nominalVoltage;
+ }
+
+ /**
+ * optional double nominal_voltage = 1;
+ * @param value the nominalVoltage to set
+ * @return this
+ */
+ public ProtobufDCMotor setNominalVoltage(final double value) {
+ bitField0_ |= 0x00000001;
+ nominalVoltage = value;
+ return this;
+ }
+
+ /**
+ * optional double stall_torque = 2;
+ * @return whether the stallTorque field is set
+ */
+ public boolean hasStallTorque() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double stall_torque = 2;
+ * @return this
+ */
+ public ProtobufDCMotor clearStallTorque() {
+ bitField0_ &= ~0x00000002;
+ stallTorque = 0D;
+ return this;
+ }
+
+ /**
+ * optional double stall_torque = 2;
+ * @return the stallTorque
+ */
+ public double getStallTorque() {
+ return stallTorque;
+ }
+
+ /**
+ * optional double stall_torque = 2;
+ * @param value the stallTorque to set
+ * @return this
+ */
+ public ProtobufDCMotor setStallTorque(final double value) {
+ bitField0_ |= 0x00000002;
+ stallTorque = value;
+ return this;
+ }
+
+ /**
+ * optional double stall_current = 3;
+ * @return whether the stallCurrent field is set
+ */
+ public boolean hasStallCurrent() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double stall_current = 3;
+ * @return this
+ */
+ public ProtobufDCMotor clearStallCurrent() {
+ bitField0_ &= ~0x00000004;
+ stallCurrent = 0D;
+ return this;
+ }
+
+ /**
+ * optional double stall_current = 3;
+ * @return the stallCurrent
+ */
+ public double getStallCurrent() {
+ return stallCurrent;
+ }
+
+ /**
+ * optional double stall_current = 3;
+ * @param value the stallCurrent to set
+ * @return this
+ */
+ public ProtobufDCMotor setStallCurrent(final double value) {
+ bitField0_ |= 0x00000004;
+ stallCurrent = value;
+ return this;
+ }
+
+ /**
+ * optional double free_current = 4;
+ * @return whether the freeCurrent field is set
+ */
+ public boolean hasFreeCurrent() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional double free_current = 4;
+ * @return this
+ */
+ public ProtobufDCMotor clearFreeCurrent() {
+ bitField0_ &= ~0x00000008;
+ freeCurrent = 0D;
+ return this;
+ }
+
+ /**
+ * optional double free_current = 4;
+ * @return the freeCurrent
+ */
+ public double getFreeCurrent() {
+ return freeCurrent;
+ }
+
+ /**
+ * optional double free_current = 4;
+ * @param value the freeCurrent to set
+ * @return this
+ */
+ public ProtobufDCMotor setFreeCurrent(final double value) {
+ bitField0_ |= 0x00000008;
+ freeCurrent = value;
+ return this;
+ }
+
+ /**
+ * optional double free_speed = 5;
+ * @return whether the freeSpeed field is set
+ */
+ public boolean hasFreeSpeed() {
+ return (bitField0_ & 0x00000010) != 0;
+ }
+
+ /**
+ * optional double free_speed = 5;
+ * @return this
+ */
+ public ProtobufDCMotor clearFreeSpeed() {
+ bitField0_ &= ~0x00000010;
+ freeSpeed = 0D;
+ return this;
+ }
+
+ /**
+ * optional double free_speed = 5;
+ * @return the freeSpeed
+ */
+ public double getFreeSpeed() {
+ return freeSpeed;
+ }
+
+ /**
+ * optional double free_speed = 5;
+ * @param value the freeSpeed to set
+ * @return this
+ */
+ public ProtobufDCMotor setFreeSpeed(final double value) {
+ bitField0_ |= 0x00000010;
+ freeSpeed = value;
+ return this;
+ }
+
+ @Override
+ public ProtobufDCMotor copyFrom(final ProtobufDCMotor other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ nominalVoltage = other.nominalVoltage;
+ stallTorque = other.stallTorque;
+ stallCurrent = other.stallCurrent;
+ freeCurrent = other.freeCurrent;
+ freeSpeed = other.freeSpeed;
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufDCMotor mergeFrom(final ProtobufDCMotor other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasNominalVoltage()) {
+ setNominalVoltage(other.nominalVoltage);
+ }
+ if (other.hasStallTorque()) {
+ setStallTorque(other.stallTorque);
+ }
+ if (other.hasStallCurrent()) {
+ setStallCurrent(other.stallCurrent);
+ }
+ if (other.hasFreeCurrent()) {
+ setFreeCurrent(other.freeCurrent);
+ }
+ if (other.hasFreeSpeed()) {
+ setFreeSpeed(other.freeSpeed);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufDCMotor clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ nominalVoltage = 0D;
+ stallTorque = 0D;
+ stallCurrent = 0D;
+ freeCurrent = 0D;
+ freeSpeed = 0D;
+ return this;
+ }
+
+ @Override
+ public ProtobufDCMotor clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufDCMotor)) {
+ return false;
+ }
+ ProtobufDCMotor other = (ProtobufDCMotor) o;
+ return bitField0_ == other.bitField0_
+ && (!hasNominalVoltage() || ProtoUtil.isEqual(nominalVoltage, other.nominalVoltage))
+ && (!hasStallTorque() || ProtoUtil.isEqual(stallTorque, other.stallTorque))
+ && (!hasStallCurrent() || ProtoUtil.isEqual(stallCurrent, other.stallCurrent))
+ && (!hasFreeCurrent() || ProtoUtil.isEqual(freeCurrent, other.freeCurrent))
+ && (!hasFreeSpeed() || ProtoUtil.isEqual(freeSpeed, other.freeSpeed));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(nominalVoltage);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(stallTorque);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(stallCurrent);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 33);
+ output.writeDoubleNoTag(freeCurrent);
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ output.writeRawByte((byte) 41);
+ output.writeDoubleNoTag(freeSpeed);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ size += 9;
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufDCMotor mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // nominalVoltage
+ nominalVoltage = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // stallTorque
+ stallTorque = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // stallCurrent
+ stallCurrent = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 33) {
+ break;
+ }
+ }
+ case 33: {
+ // freeCurrent
+ freeCurrent = input.readDouble();
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 41) {
+ break;
+ }
+ }
+ case 41: {
+ // freeSpeed
+ freeSpeed = input.readDouble();
+ bitField0_ |= 0x00000010;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.nominalVoltage, nominalVoltage);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.stallTorque, stallTorque);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.stallCurrent, stallCurrent);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeDouble(FieldNames.freeCurrent, freeCurrent);
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ output.writeDouble(FieldNames.freeSpeed, freeSpeed);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufDCMotor mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 1374862050:
+ case 173092603: {
+ if (input.isAtField(FieldNames.nominalVoltage)) {
+ if (!input.trySkipNullValue()) {
+ nominalVoltage = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 2075810250:
+ case 1238615945: {
+ if (input.isAtField(FieldNames.stallTorque)) {
+ if (!input.trySkipNullValue()) {
+ stallTorque = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -2105262663:
+ case 2006484954: {
+ if (input.isAtField(FieldNames.stallCurrent)) {
+ if (!input.trySkipNullValue()) {
+ stallCurrent = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 1024355693:
+ case 240406182: {
+ if (input.isAtField(FieldNames.freeCurrent)) {
+ if (!input.trySkipNullValue()) {
+ freeCurrent = input.readDouble();
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -444654277:
+ case -552732492: {
+ if (input.isAtField(FieldNames.freeSpeed)) {
+ if (!input.trySkipNullValue()) {
+ freeSpeed = input.readDouble();
+ bitField0_ |= 0x00000010;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufDCMotor clone() {
+ return new ProtobufDCMotor().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufDCMotor parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufDCMotor(), data).checkInitialized();
+ }
+
+ public static ProtobufDCMotor parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufDCMotor(), input).checkInitialized();
+ }
+
+ public static ProtobufDCMotor parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufDCMotor(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufDCMotor messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufDCMotorFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Plant.wpi_proto_ProtobufDCMotor_descriptor;
+ }
+
+ private enum ProtobufDCMotorFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufDCMotor create() {
+ return ProtobufDCMotor.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName nominalVoltage = FieldName.forField("nominalVoltage", "nominal_voltage");
+
+ static final FieldName stallTorque = FieldName.forField("stallTorque", "stall_torque");
+
+ static final FieldName stallCurrent = FieldName.forField("stallCurrent", "stall_current");
+
+ static final FieldName freeCurrent = FieldName.forField("freeCurrent", "free_current");
+
+ static final FieldName freeSpeed = FieldName.forField("freeSpeed", "free_speed");
+ }
+ }
+}
diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Spline.java b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Spline.java
new file mode 100644
index 0000000000..accdecb07a
--- /dev/null
+++ b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Spline.java
@@ -0,0 +1,1367 @@
+// Copyright (c) FIRST and other WPILib contributors.
+// Open Source Software; you can modify and/or share it under the terms of
+// the WPILib BSD license file in the root directory of this project.
+// Code generated by protocol buffer compiler. Do not edit!
+package edu.wpi.first.math.proto;
+
+import java.io.IOException;
+import us.hebi.quickbuf.Descriptors;
+import us.hebi.quickbuf.FieldName;
+import us.hebi.quickbuf.InvalidProtocolBufferException;
+import us.hebi.quickbuf.JsonSink;
+import us.hebi.quickbuf.JsonSource;
+import us.hebi.quickbuf.MessageFactory;
+import us.hebi.quickbuf.ProtoMessage;
+import us.hebi.quickbuf.ProtoSink;
+import us.hebi.quickbuf.ProtoSource;
+import us.hebi.quickbuf.ProtoUtil;
+import us.hebi.quickbuf.RepeatedByte;
+import us.hebi.quickbuf.RepeatedDouble;
+
+public final class Spline {
+ private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(993,
+ "CgxzcGxpbmUucHJvdG8SCXdwaS5wcm90byKIAQoaUHJvdG9idWZDdWJpY0hlcm1pdGVTcGxpbmUSGwoJ" +
+ "eF9pbml0aWFsGAEgAygBUgh4SW5pdGlhbBIXCgd4X2ZpbmFsGAIgAygBUgZ4RmluYWwSGwoJeV9pbml0" +
+ "aWFsGAMgAygBUgh5SW5pdGlhbBIXCgd5X2ZpbmFsGAQgAygBUgZ5RmluYWwiigEKHFByb3RvYnVmUXVp" +
+ "bnRpY0hlcm1pdGVTcGxpbmUSGwoJeF9pbml0aWFsGAEgAygBUgh4SW5pdGlhbBIXCgd4X2ZpbmFsGAIg" +
+ "AygBUgZ4RmluYWwSGwoJeV9pbml0aWFsGAMgAygBUgh5SW5pdGlhbBIXCgd5X2ZpbmFsGAQgAygBUgZ5" +
+ "RmluYWxCGgoYZWR1LndwaS5maXJzdC5tYXRoLnByb3RvSokFCgYSBAAAEgEKCAoBDBIDAAASCggKAQIS" +
+ "AwIAEgoICgEIEgMEADEKCQoCCAESAwQAMQoKCgIEABIEBgALAQoKCgMEAAESAwYIIgoLCgQEAAIAEgMH" +
+ "AiAKDAoFBAACAAQSAwcCCgoMCgUEAAIABRIDBwsRCgwKBQQAAgABEgMHEhsKDAoFBAACAAMSAwceHwoL" +
+ "CgQEAAIBEgMIAh4KDAoFBAACAQQSAwgCCgoMCgUEAAIBBRIDCAsRCgwKBQQAAgEBEgMIEhkKDAoFBAAC" +
+ "AQMSAwgcHQoLCgQEAAICEgMJAiAKDAoFBAACAgQSAwkCCgoMCgUEAAICBRIDCQsRCgwKBQQAAgIBEgMJ" +
+ "EhsKDAoFBAACAgMSAwkeHwoLCgQEAAIDEgMKAh4KDAoFBAACAwQSAwoCCgoMCgUEAAIDBRIDCgsRCgwK" +
+ "BQQAAgMBEgMKEhkKDAoFBAACAwMSAwocHQoKCgIEARIEDQASAQoKCgMEAQESAw0IJAoLCgQEAQIAEgMO" +
+ "AiAKDAoFBAECAAQSAw4CCgoMCgUEAQIABRIDDgsRCgwKBQQBAgABEgMOEhsKDAoFBAECAAMSAw4eHwoL" +
+ "CgQEAQIBEgMPAh4KDAoFBAECAQQSAw8CCgoMCgUEAQIBBRIDDwsRCgwKBQQBAgEBEgMPEhkKDAoFBAEC" +
+ "AQMSAw8cHQoLCgQEAQICEgMQAiAKDAoFBAECAgQSAxACCgoMCgUEAQICBRIDEAsRCgwKBQQBAgIBEgMQ" +
+ "EhsKDAoFBAECAgMSAxAeHwoLCgQEAQIDEgMRAh4KDAoFBAECAwQSAxECCgoMCgUEAQIDBRIDEQsRCgwK" +
+ "BQQBAgMBEgMREhkKDAoFBAECAwMSAxEcHWIGcHJvdG8z");
+
+ static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("spline.proto", "wpi.proto", descriptorData);
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufCubicHermiteSpline_descriptor = descriptor.internalContainedType(28, 136, "ProtobufCubicHermiteSpline", "wpi.proto.ProtobufCubicHermiteSpline");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufQuinticHermiteSpline_descriptor = descriptor.internalContainedType(167, 138, "ProtobufQuinticHermiteSpline", "wpi.proto.ProtobufQuinticHermiteSpline");
+
+ /**
+ * @return this proto file's descriptor.
+ */
+ public static Descriptors.FileDescriptor getDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Protobuf type {@code ProtobufCubicHermiteSpline}
+ */
+ public static final class ProtobufCubicHermiteSpline extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * repeated double x_initial = 1;
+ */
+ private final RepeatedDouble xInitial = RepeatedDouble.newEmptyInstance();
+
+ /**
+ * repeated double x_final = 2;
+ */
+ private final RepeatedDouble xFinal = RepeatedDouble.newEmptyInstance();
+
+ /**
+ * repeated double y_initial = 3;
+ */
+ private final RepeatedDouble yInitial = RepeatedDouble.newEmptyInstance();
+
+ /**
+ * repeated double y_final = 4;
+ */
+ private final RepeatedDouble yFinal = RepeatedDouble.newEmptyInstance();
+
+ private ProtobufCubicHermiteSpline() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufCubicHermiteSpline}
+ */
+ public static ProtobufCubicHermiteSpline newInstance() {
+ return new ProtobufCubicHermiteSpline();
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ * @return whether the xInitial field is set
+ */
+ public boolean hasXInitial() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline clearXInitial() {
+ bitField0_ &= ~0x00000001;
+ xInitial.clear();
+ return this;
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableXInitial()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedDouble getXInitial() {
+ return xInitial;
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedDouble getMutableXInitial() {
+ bitField0_ |= 0x00000001;
+ return xInitial;
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ * @param value the xInitial to add
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline addXInitial(final double value) {
+ bitField0_ |= 0x00000001;
+ xInitial.add(value);
+ return this;
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ * @param values the xInitial to add
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline addAllXInitial(final double... values) {
+ bitField0_ |= 0x00000001;
+ xInitial.addAll(values);
+ return this;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ * @return whether the xFinal field is set
+ */
+ public boolean hasXFinal() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline clearXFinal() {
+ bitField0_ &= ~0x00000002;
+ xFinal.clear();
+ return this;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableXFinal()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedDouble getXFinal() {
+ return xFinal;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedDouble getMutableXFinal() {
+ bitField0_ |= 0x00000002;
+ return xFinal;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ * @param value the xFinal to add
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline addXFinal(final double value) {
+ bitField0_ |= 0x00000002;
+ xFinal.add(value);
+ return this;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ * @param values the xFinal to add
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline addAllXFinal(final double... values) {
+ bitField0_ |= 0x00000002;
+ xFinal.addAll(values);
+ return this;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ * @return whether the yInitial field is set
+ */
+ public boolean hasYInitial() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline clearYInitial() {
+ bitField0_ &= ~0x00000004;
+ yInitial.clear();
+ return this;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableYInitial()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedDouble getYInitial() {
+ return yInitial;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedDouble getMutableYInitial() {
+ bitField0_ |= 0x00000004;
+ return yInitial;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ * @param value the yInitial to add
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline addYInitial(final double value) {
+ bitField0_ |= 0x00000004;
+ yInitial.add(value);
+ return this;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ * @param values the yInitial to add
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline addAllYInitial(final double... values) {
+ bitField0_ |= 0x00000004;
+ yInitial.addAll(values);
+ return this;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ * @return whether the yFinal field is set
+ */
+ public boolean hasYFinal() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline clearYFinal() {
+ bitField0_ &= ~0x00000008;
+ yFinal.clear();
+ return this;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableYFinal()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedDouble getYFinal() {
+ return yFinal;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedDouble getMutableYFinal() {
+ bitField0_ |= 0x00000008;
+ return yFinal;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ * @param value the yFinal to add
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline addYFinal(final double value) {
+ bitField0_ |= 0x00000008;
+ yFinal.add(value);
+ return this;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ * @param values the yFinal to add
+ * @return this
+ */
+ public ProtobufCubicHermiteSpline addAllYFinal(final double... values) {
+ bitField0_ |= 0x00000008;
+ yFinal.addAll(values);
+ return this;
+ }
+
+ @Override
+ public ProtobufCubicHermiteSpline copyFrom(final ProtobufCubicHermiteSpline other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ xInitial.copyFrom(other.xInitial);
+ xFinal.copyFrom(other.xFinal);
+ yInitial.copyFrom(other.yInitial);
+ yFinal.copyFrom(other.yFinal);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufCubicHermiteSpline mergeFrom(final ProtobufCubicHermiteSpline other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasXInitial()) {
+ getMutableXInitial().addAll(other.xInitial);
+ }
+ if (other.hasXFinal()) {
+ getMutableXFinal().addAll(other.xFinal);
+ }
+ if (other.hasYInitial()) {
+ getMutableYInitial().addAll(other.yInitial);
+ }
+ if (other.hasYFinal()) {
+ getMutableYFinal().addAll(other.yFinal);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufCubicHermiteSpline clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ xInitial.clear();
+ xFinal.clear();
+ yInitial.clear();
+ yFinal.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufCubicHermiteSpline clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ xInitial.clear();
+ xFinal.clear();
+ yInitial.clear();
+ yFinal.clear();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufCubicHermiteSpline)) {
+ return false;
+ }
+ ProtobufCubicHermiteSpline other = (ProtobufCubicHermiteSpline) o;
+ return bitField0_ == other.bitField0_
+ && (!hasXInitial() || xInitial.equals(other.xInitial))
+ && (!hasXFinal() || xFinal.equals(other.xFinal))
+ && (!hasYInitial() || yInitial.equals(other.yInitial))
+ && (!hasYFinal() || yFinal.equals(other.yFinal));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ for (int i = 0; i < xInitial.length(); i++) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(xInitial.array()[i]);
+ }
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ for (int i = 0; i < xFinal.length(); i++) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(xFinal.array()[i]);
+ }
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ for (int i = 0; i < yInitial.length(); i++) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(yInitial.array()[i]);
+ }
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ for (int i = 0; i < yFinal.length(); i++) {
+ output.writeRawByte((byte) 33);
+ output.writeDoubleNoTag(yFinal.array()[i]);
+ }
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += (1 + 8) * xInitial.length();
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += (1 + 8) * xFinal.length();
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += (1 + 8) * yInitial.length();
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += (1 + 8) * yFinal.length();
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufCubicHermiteSpline mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 10: {
+ // xInitial [packed=true]
+ input.readPackedDouble(xInitial);
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 18) {
+ break;
+ }
+ }
+ case 18: {
+ // xFinal [packed=true]
+ input.readPackedDouble(xFinal);
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 26) {
+ break;
+ }
+ }
+ case 26: {
+ // yInitial [packed=true]
+ input.readPackedDouble(yInitial);
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 34) {
+ break;
+ }
+ }
+ case 34: {
+ // yFinal [packed=true]
+ input.readPackedDouble(yFinal);
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ case 9: {
+ // xInitial [packed=false]
+ tag = input.readRepeatedDouble(xInitial, tag);
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ case 17: {
+ // xFinal [packed=false]
+ tag = input.readRepeatedDouble(xFinal, tag);
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 25: {
+ // yInitial [packed=false]
+ tag = input.readRepeatedDouble(yInitial, tag);
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 33: {
+ // yFinal [packed=false]
+ tag = input.readRepeatedDouble(yFinal, tag);
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRepeatedDouble(FieldNames.xInitial, xInitial);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRepeatedDouble(FieldNames.xFinal, xFinal);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRepeatedDouble(FieldNames.yInitial, yInitial);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRepeatedDouble(FieldNames.yFinal, yFinal);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufCubicHermiteSpline mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case -1998129236:
+ case -2134571395: {
+ if (input.isAtField(FieldNames.xInitial)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedDouble(xInitial);
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -791585826:
+ case 1943464687: {
+ if (input.isAtField(FieldNames.xFinal)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedDouble(xFinal);
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -255318901:
+ case 352941438: {
+ if (input.isAtField(FieldNames.yInitial)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedDouble(yInitial);
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -762956675:
+ case -1463998928: {
+ if (input.isAtField(FieldNames.yFinal)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedDouble(yFinal);
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufCubicHermiteSpline clone() {
+ return new ProtobufCubicHermiteSpline().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufCubicHermiteSpline parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufCubicHermiteSpline(), data).checkInitialized();
+ }
+
+ public static ProtobufCubicHermiteSpline parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufCubicHermiteSpline(), input).checkInitialized();
+ }
+
+ public static ProtobufCubicHermiteSpline parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufCubicHermiteSpline(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufCubicHermiteSpline messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufCubicHermiteSplineFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Spline.wpi_proto_ProtobufCubicHermiteSpline_descriptor;
+ }
+
+ private enum ProtobufCubicHermiteSplineFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufCubicHermiteSpline create() {
+ return ProtobufCubicHermiteSpline.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName xInitial = FieldName.forField("xInitial", "x_initial");
+
+ static final FieldName xFinal = FieldName.forField("xFinal", "x_final");
+
+ static final FieldName yInitial = FieldName.forField("yInitial", "y_initial");
+
+ static final FieldName yFinal = FieldName.forField("yFinal", "y_final");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufQuinticHermiteSpline}
+ */
+ public static final class ProtobufQuinticHermiteSpline extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * repeated double x_initial = 1;
+ */
+ private final RepeatedDouble xInitial = RepeatedDouble.newEmptyInstance();
+
+ /**
+ * repeated double x_final = 2;
+ */
+ private final RepeatedDouble xFinal = RepeatedDouble.newEmptyInstance();
+
+ /**
+ * repeated double y_initial = 3;
+ */
+ private final RepeatedDouble yInitial = RepeatedDouble.newEmptyInstance();
+
+ /**
+ * repeated double y_final = 4;
+ */
+ private final RepeatedDouble yFinal = RepeatedDouble.newEmptyInstance();
+
+ private ProtobufQuinticHermiteSpline() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufQuinticHermiteSpline}
+ */
+ public static ProtobufQuinticHermiteSpline newInstance() {
+ return new ProtobufQuinticHermiteSpline();
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ * @return whether the xInitial field is set
+ */
+ public boolean hasXInitial() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline clearXInitial() {
+ bitField0_ &= ~0x00000001;
+ xInitial.clear();
+ return this;
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableXInitial()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedDouble getXInitial() {
+ return xInitial;
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedDouble getMutableXInitial() {
+ bitField0_ |= 0x00000001;
+ return xInitial;
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ * @param value the xInitial to add
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline addXInitial(final double value) {
+ bitField0_ |= 0x00000001;
+ xInitial.add(value);
+ return this;
+ }
+
+ /**
+ * repeated double x_initial = 1;
+ * @param values the xInitial to add
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline addAllXInitial(final double... values) {
+ bitField0_ |= 0x00000001;
+ xInitial.addAll(values);
+ return this;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ * @return whether the xFinal field is set
+ */
+ public boolean hasXFinal() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline clearXFinal() {
+ bitField0_ &= ~0x00000002;
+ xFinal.clear();
+ return this;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableXFinal()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedDouble getXFinal() {
+ return xFinal;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedDouble getMutableXFinal() {
+ bitField0_ |= 0x00000002;
+ return xFinal;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ * @param value the xFinal to add
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline addXFinal(final double value) {
+ bitField0_ |= 0x00000002;
+ xFinal.add(value);
+ return this;
+ }
+
+ /**
+ * repeated double x_final = 2;
+ * @param values the xFinal to add
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline addAllXFinal(final double... values) {
+ bitField0_ |= 0x00000002;
+ xFinal.addAll(values);
+ return this;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ * @return whether the yInitial field is set
+ */
+ public boolean hasYInitial() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline clearYInitial() {
+ bitField0_ &= ~0x00000004;
+ yInitial.clear();
+ return this;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableYInitial()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedDouble getYInitial() {
+ return yInitial;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedDouble getMutableYInitial() {
+ bitField0_ |= 0x00000004;
+ return yInitial;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ * @param value the yInitial to add
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline addYInitial(final double value) {
+ bitField0_ |= 0x00000004;
+ yInitial.add(value);
+ return this;
+ }
+
+ /**
+ * repeated double y_initial = 3;
+ * @param values the yInitial to add
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline addAllYInitial(final double... values) {
+ bitField0_ |= 0x00000004;
+ yInitial.addAll(values);
+ return this;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ * @return whether the yFinal field is set
+ */
+ public boolean hasYFinal() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline clearYFinal() {
+ bitField0_ &= ~0x00000008;
+ yFinal.clear();
+ return this;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableYFinal()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedDouble getYFinal() {
+ return yFinal;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedDouble getMutableYFinal() {
+ bitField0_ |= 0x00000008;
+ return yFinal;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ * @param value the yFinal to add
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline addYFinal(final double value) {
+ bitField0_ |= 0x00000008;
+ yFinal.add(value);
+ return this;
+ }
+
+ /**
+ * repeated double y_final = 4;
+ * @param values the yFinal to add
+ * @return this
+ */
+ public ProtobufQuinticHermiteSpline addAllYFinal(final double... values) {
+ bitField0_ |= 0x00000008;
+ yFinal.addAll(values);
+ return this;
+ }
+
+ @Override
+ public ProtobufQuinticHermiteSpline copyFrom(final ProtobufQuinticHermiteSpline other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ xInitial.copyFrom(other.xInitial);
+ xFinal.copyFrom(other.xFinal);
+ yInitial.copyFrom(other.yInitial);
+ yFinal.copyFrom(other.yFinal);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufQuinticHermiteSpline mergeFrom(final ProtobufQuinticHermiteSpline other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasXInitial()) {
+ getMutableXInitial().addAll(other.xInitial);
+ }
+ if (other.hasXFinal()) {
+ getMutableXFinal().addAll(other.xFinal);
+ }
+ if (other.hasYInitial()) {
+ getMutableYInitial().addAll(other.yInitial);
+ }
+ if (other.hasYFinal()) {
+ getMutableYFinal().addAll(other.yFinal);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufQuinticHermiteSpline clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ xInitial.clear();
+ xFinal.clear();
+ yInitial.clear();
+ yFinal.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufQuinticHermiteSpline clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ xInitial.clear();
+ xFinal.clear();
+ yInitial.clear();
+ yFinal.clear();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufQuinticHermiteSpline)) {
+ return false;
+ }
+ ProtobufQuinticHermiteSpline other = (ProtobufQuinticHermiteSpline) o;
+ return bitField0_ == other.bitField0_
+ && (!hasXInitial() || xInitial.equals(other.xInitial))
+ && (!hasXFinal() || xFinal.equals(other.xFinal))
+ && (!hasYInitial() || yInitial.equals(other.yInitial))
+ && (!hasYFinal() || yFinal.equals(other.yFinal));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ for (int i = 0; i < xInitial.length(); i++) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(xInitial.array()[i]);
+ }
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ for (int i = 0; i < xFinal.length(); i++) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(xFinal.array()[i]);
+ }
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ for (int i = 0; i < yInitial.length(); i++) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(yInitial.array()[i]);
+ }
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ for (int i = 0; i < yFinal.length(); i++) {
+ output.writeRawByte((byte) 33);
+ output.writeDoubleNoTag(yFinal.array()[i]);
+ }
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += (1 + 8) * xInitial.length();
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += (1 + 8) * xFinal.length();
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += (1 + 8) * yInitial.length();
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += (1 + 8) * yFinal.length();
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufQuinticHermiteSpline mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 10: {
+ // xInitial [packed=true]
+ input.readPackedDouble(xInitial);
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 18) {
+ break;
+ }
+ }
+ case 18: {
+ // xFinal [packed=true]
+ input.readPackedDouble(xFinal);
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 26) {
+ break;
+ }
+ }
+ case 26: {
+ // yInitial [packed=true]
+ input.readPackedDouble(yInitial);
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 34) {
+ break;
+ }
+ }
+ case 34: {
+ // yFinal [packed=true]
+ input.readPackedDouble(yFinal);
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ case 9: {
+ // xInitial [packed=false]
+ tag = input.readRepeatedDouble(xInitial, tag);
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ case 17: {
+ // xFinal [packed=false]
+ tag = input.readRepeatedDouble(xFinal, tag);
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 25: {
+ // yInitial [packed=false]
+ tag = input.readRepeatedDouble(yInitial, tag);
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 33: {
+ // yFinal [packed=false]
+ tag = input.readRepeatedDouble(yFinal, tag);
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRepeatedDouble(FieldNames.xInitial, xInitial);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRepeatedDouble(FieldNames.xFinal, xFinal);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRepeatedDouble(FieldNames.yInitial, yInitial);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRepeatedDouble(FieldNames.yFinal, yFinal);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufQuinticHermiteSpline mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case -1998129236:
+ case -2134571395: {
+ if (input.isAtField(FieldNames.xInitial)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedDouble(xInitial);
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -791585826:
+ case 1943464687: {
+ if (input.isAtField(FieldNames.xFinal)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedDouble(xFinal);
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -255318901:
+ case 352941438: {
+ if (input.isAtField(FieldNames.yInitial)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedDouble(yInitial);
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -762956675:
+ case -1463998928: {
+ if (input.isAtField(FieldNames.yFinal)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedDouble(yFinal);
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufQuinticHermiteSpline clone() {
+ return new ProtobufQuinticHermiteSpline().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufQuinticHermiteSpline parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufQuinticHermiteSpline(), data).checkInitialized();
+ }
+
+ public static ProtobufQuinticHermiteSpline parseFrom(final ProtoSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufQuinticHermiteSpline(), input).checkInitialized();
+ }
+
+ public static ProtobufQuinticHermiteSpline parseFrom(final JsonSource input) throws
+ IOException {
+ return ProtoMessage.mergeFrom(new ProtobufQuinticHermiteSpline(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufQuinticHermiteSpline messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufQuinticHermiteSplineFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Spline.wpi_proto_ProtobufQuinticHermiteSpline_descriptor;
+ }
+
+ private enum ProtobufQuinticHermiteSplineFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufQuinticHermiteSpline create() {
+ return ProtobufQuinticHermiteSpline.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName xInitial = FieldName.forField("xInitial", "x_initial");
+
+ static final FieldName xFinal = FieldName.forField("xFinal", "x_final");
+
+ static final FieldName yInitial = FieldName.forField("yInitial", "y_initial");
+
+ static final FieldName yFinal = FieldName.forField("yFinal", "y_final");
+ }
+ }
+}
diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/proto/System.java b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/System.java
new file mode 100644
index 0000000000..09ea3b529d
--- /dev/null
+++ b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/System.java
@@ -0,0 +1,866 @@
+// Copyright (c) FIRST and other WPILib contributors.
+// Open Source Software; you can modify and/or share it under the terms of
+// the WPILib BSD license file in the root directory of this project.
+// Code generated by protocol buffer compiler. Do not edit!
+package edu.wpi.first.math.proto;
+
+import java.io.IOException;
+import us.hebi.quickbuf.Descriptors;
+import us.hebi.quickbuf.FieldName;
+import us.hebi.quickbuf.InvalidProtocolBufferException;
+import us.hebi.quickbuf.JsonSink;
+import us.hebi.quickbuf.JsonSource;
+import us.hebi.quickbuf.MessageFactory;
+import us.hebi.quickbuf.ProtoMessage;
+import us.hebi.quickbuf.ProtoSink;
+import us.hebi.quickbuf.ProtoSource;
+import us.hebi.quickbuf.ProtoUtil;
+import us.hebi.quickbuf.RepeatedByte;
+
+public final class System {
+ private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(832,
+ "CgxzeXN0ZW0ucHJvdG8SCXdwaS5wcm90bxoNd3BpbWF0aC5wcm90byKZAgoUUHJvdG9idWZMaW5lYXJT" +
+ "eXN0ZW0SHQoKbnVtX3N0YXRlcxgBIAEoDVIJbnVtU3RhdGVzEh0KCm51bV9pbnB1dHMYAiABKA1SCW51" +
+ "bUlucHV0cxIfCgtudW1fb3V0cHV0cxgDIAEoDVIKbnVtT3V0cHV0cxInCgFhGAQgASgLMhkud3BpLnBy" +
+ "b3RvLlByb3RvYnVmTWF0cml4UgFhEicKAWIYBSABKAsyGS53cGkucHJvdG8uUHJvdG9idWZNYXRyaXhS" +
+ "AWISJwoBYxgGIAEoCzIZLndwaS5wcm90by5Qcm90b2J1Zk1hdHJpeFIBYxInCgFkGAcgASgLMhkud3Bp" +
+ "LnByb3RvLlByb3RvYnVmTWF0cml4UgFkQhoKGGVkdS53cGkuZmlyc3QubWF0aC5wcm90b0rVAwoGEgQA" +
+ "ABABCggKAQwSAwAAEgoICgECEgMCABIKCQoCAwASAwQAFwoICgEIEgMGADEKCQoCCAESAwYAMQoKCgIE" +
+ "ABIECAAQAQoKCgMEAAESAwgIHAoLCgQEAAIAEgMJAhgKDAoFBAACAAUSAwkCCAoMCgUEAAIAARIDCQkT" +
+ "CgwKBQQAAgADEgMJFhcKCwoEBAACARIDCgIYCgwKBQQAAgEFEgMKAggKDAoFBAACAQESAwoJEwoMCgUE" +
+ "AAIBAxIDChYXCgsKBAQAAgISAwsCGQoMCgUEAAICBRIDCwIICgwKBQQAAgIBEgMLCRQKDAoFBAACAgMS" +
+ "AwsXGAoLCgQEAAIDEgMMAhcKDAoFBAACAwYSAwwCEAoMCgUEAAIDARIDDBESCgwKBQQAAgMDEgMMFRYK" +
+ "CwoEBAACBBIDDQIXCgwKBQQAAgQGEgMNAhAKDAoFBAACBAESAw0REgoMCgUEAAIEAxIDDRUWCgsKBAQA" +
+ "AgUSAw4CFwoMCgUEAAIFBhIDDgIQCgwKBQQAAgUBEgMOERIKDAoFBAACBQMSAw4VFgoLCgQEAAIGEgMP" +
+ "AhcKDAoFBAACBgYSAw8CEAoMCgUEAAIGARIDDxESCgwKBQQAAgYDEgMPFRZiBnByb3RvMw==");
+
+ static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("system.proto", "wpi.proto", descriptorData, Wpimath.getDescriptor());
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufLinearSystem_descriptor = descriptor.internalContainedType(43, 281, "ProtobufLinearSystem", "wpi.proto.ProtobufLinearSystem");
+
+ /**
+ * @return this proto file's descriptor.
+ */
+ public static Descriptors.FileDescriptor getDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Protobuf type {@code ProtobufLinearSystem}
+ */
+ public static final class ProtobufLinearSystem extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional uint32 num_states = 1;
+ */
+ private int numStates;
+
+ /**
+ * optional uint32 num_inputs = 2;
+ */
+ private int numInputs;
+
+ /**
+ * optional uint32 num_outputs = 3;
+ */
+ private int numOutputs;
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix a = 4;
+ */
+ private final Wpimath.ProtobufMatrix a = Wpimath.ProtobufMatrix.newInstance();
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix b = 5;
+ */
+ private final Wpimath.ProtobufMatrix b = Wpimath.ProtobufMatrix.newInstance();
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix c = 6;
+ */
+ private final Wpimath.ProtobufMatrix c = Wpimath.ProtobufMatrix.newInstance();
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix d = 7;
+ */
+ private final Wpimath.ProtobufMatrix d = Wpimath.ProtobufMatrix.newInstance();
+
+ private ProtobufLinearSystem() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufLinearSystem}
+ */
+ public static ProtobufLinearSystem newInstance() {
+ return new ProtobufLinearSystem();
+ }
+
+ /**
+ * optional uint32 num_states = 1;
+ * @return whether the numStates field is set
+ */
+ public boolean hasNumStates() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional uint32 num_states = 1;
+ * @return this
+ */
+ public ProtobufLinearSystem clearNumStates() {
+ bitField0_ &= ~0x00000001;
+ numStates = 0;
+ return this;
+ }
+
+ /**
+ * optional uint32 num_states = 1;
+ * @return the numStates
+ */
+ public int getNumStates() {
+ return numStates;
+ }
+
+ /**
+ * optional uint32 num_states = 1;
+ * @param value the numStates to set
+ * @return this
+ */
+ public ProtobufLinearSystem setNumStates(final int value) {
+ bitField0_ |= 0x00000001;
+ numStates = value;
+ return this;
+ }
+
+ /**
+ * optional uint32 num_inputs = 2;
+ * @return whether the numInputs field is set
+ */
+ public boolean hasNumInputs() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional uint32 num_inputs = 2;
+ * @return this
+ */
+ public ProtobufLinearSystem clearNumInputs() {
+ bitField0_ &= ~0x00000002;
+ numInputs = 0;
+ return this;
+ }
+
+ /**
+ * optional uint32 num_inputs = 2;
+ * @return the numInputs
+ */
+ public int getNumInputs() {
+ return numInputs;
+ }
+
+ /**
+ * optional uint32 num_inputs = 2;
+ * @param value the numInputs to set
+ * @return this
+ */
+ public ProtobufLinearSystem setNumInputs(final int value) {
+ bitField0_ |= 0x00000002;
+ numInputs = value;
+ return this;
+ }
+
+ /**
+ * optional uint32 num_outputs = 3;
+ * @return whether the numOutputs field is set
+ */
+ public boolean hasNumOutputs() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional uint32 num_outputs = 3;
+ * @return this
+ */
+ public ProtobufLinearSystem clearNumOutputs() {
+ bitField0_ &= ~0x00000004;
+ numOutputs = 0;
+ return this;
+ }
+
+ /**
+ * optional uint32 num_outputs = 3;
+ * @return the numOutputs
+ */
+ public int getNumOutputs() {
+ return numOutputs;
+ }
+
+ /**
+ * optional uint32 num_outputs = 3;
+ * @param value the numOutputs to set
+ * @return this
+ */
+ public ProtobufLinearSystem setNumOutputs(final int value) {
+ bitField0_ |= 0x00000004;
+ numOutputs = value;
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix a = 4;
+ * @return whether the a field is set
+ */
+ public boolean hasA() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix a = 4;
+ * @return this
+ */
+ public ProtobufLinearSystem clearA() {
+ bitField0_ &= ~0x00000008;
+ a.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix a = 4;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableA()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public Wpimath.ProtobufMatrix getA() {
+ return a;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix a = 4;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public Wpimath.ProtobufMatrix getMutableA() {
+ bitField0_ |= 0x00000008;
+ return a;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix a = 4;
+ * @param value the a to set
+ * @return this
+ */
+ public ProtobufLinearSystem setA(final Wpimath.ProtobufMatrix value) {
+ bitField0_ |= 0x00000008;
+ a.copyFrom(value);
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix b = 5;
+ * @return whether the b field is set
+ */
+ public boolean hasB() {
+ return (bitField0_ & 0x00000010) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix b = 5;
+ * @return this
+ */
+ public ProtobufLinearSystem clearB() {
+ bitField0_ &= ~0x00000010;
+ b.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix b = 5;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableB()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public Wpimath.ProtobufMatrix getB() {
+ return b;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix b = 5;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public Wpimath.ProtobufMatrix getMutableB() {
+ bitField0_ |= 0x00000010;
+ return b;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix b = 5;
+ * @param value the b to set
+ * @return this
+ */
+ public ProtobufLinearSystem setB(final Wpimath.ProtobufMatrix value) {
+ bitField0_ |= 0x00000010;
+ b.copyFrom(value);
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix c = 6;
+ * @return whether the c field is set
+ */
+ public boolean hasC() {
+ return (bitField0_ & 0x00000020) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix c = 6;
+ * @return this
+ */
+ public ProtobufLinearSystem clearC() {
+ bitField0_ &= ~0x00000020;
+ c.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix c = 6;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableC()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public Wpimath.ProtobufMatrix getC() {
+ return c;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix c = 6;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public Wpimath.ProtobufMatrix getMutableC() {
+ bitField0_ |= 0x00000020;
+ return c;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix c = 6;
+ * @param value the c to set
+ * @return this
+ */
+ public ProtobufLinearSystem setC(final Wpimath.ProtobufMatrix value) {
+ bitField0_ |= 0x00000020;
+ c.copyFrom(value);
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix d = 7;
+ * @return whether the d field is set
+ */
+ public boolean hasD() {
+ return (bitField0_ & 0x00000040) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix d = 7;
+ * @return this
+ */
+ public ProtobufLinearSystem clearD() {
+ bitField0_ &= ~0x00000040;
+ d.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix d = 7;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableD()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public Wpimath.ProtobufMatrix getD() {
+ return d;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix d = 7;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public Wpimath.ProtobufMatrix getMutableD() {
+ bitField0_ |= 0x00000040;
+ return d;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufMatrix d = 7;
+ * @param value the d to set
+ * @return this
+ */
+ public ProtobufLinearSystem setD(final Wpimath.ProtobufMatrix value) {
+ bitField0_ |= 0x00000040;
+ d.copyFrom(value);
+ return this;
+ }
+
+ @Override
+ public ProtobufLinearSystem copyFrom(final ProtobufLinearSystem other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ numStates = other.numStates;
+ numInputs = other.numInputs;
+ numOutputs = other.numOutputs;
+ a.copyFrom(other.a);
+ b.copyFrom(other.b);
+ c.copyFrom(other.c);
+ d.copyFrom(other.d);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufLinearSystem mergeFrom(final ProtobufLinearSystem other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasNumStates()) {
+ setNumStates(other.numStates);
+ }
+ if (other.hasNumInputs()) {
+ setNumInputs(other.numInputs);
+ }
+ if (other.hasNumOutputs()) {
+ setNumOutputs(other.numOutputs);
+ }
+ if (other.hasA()) {
+ getMutableA().mergeFrom(other.a);
+ }
+ if (other.hasB()) {
+ getMutableB().mergeFrom(other.b);
+ }
+ if (other.hasC()) {
+ getMutableC().mergeFrom(other.c);
+ }
+ if (other.hasD()) {
+ getMutableD().mergeFrom(other.d);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufLinearSystem clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ numStates = 0;
+ numInputs = 0;
+ numOutputs = 0;
+ a.clear();
+ b.clear();
+ c.clear();
+ d.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufLinearSystem clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ a.clearQuick();
+ b.clearQuick();
+ c.clearQuick();
+ d.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufLinearSystem)) {
+ return false;
+ }
+ ProtobufLinearSystem other = (ProtobufLinearSystem) o;
+ return bitField0_ == other.bitField0_
+ && (!hasNumStates() || numStates == other.numStates)
+ && (!hasNumInputs() || numInputs == other.numInputs)
+ && (!hasNumOutputs() || numOutputs == other.numOutputs)
+ && (!hasA() || a.equals(other.a))
+ && (!hasB() || b.equals(other.b))
+ && (!hasC() || c.equals(other.c))
+ && (!hasD() || d.equals(other.d));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 8);
+ output.writeUInt32NoTag(numStates);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 16);
+ output.writeUInt32NoTag(numInputs);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 24);
+ output.writeUInt32NoTag(numOutputs);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 34);
+ output.writeMessageNoTag(a);
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ output.writeRawByte((byte) 42);
+ output.writeMessageNoTag(b);
+ }
+ if ((bitField0_ & 0x00000020) != 0) {
+ output.writeRawByte((byte) 50);
+ output.writeMessageNoTag(c);
+ }
+ if ((bitField0_ & 0x00000040) != 0) {
+ output.writeRawByte((byte) 58);
+ output.writeMessageNoTag(d);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 1 + ProtoSink.computeUInt32SizeNoTag(numStates);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 1 + ProtoSink.computeUInt32SizeNoTag(numInputs);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 1 + ProtoSink.computeUInt32SizeNoTag(numOutputs);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(a);
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(b);
+ }
+ if ((bitField0_ & 0x00000020) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(c);
+ }
+ if ((bitField0_ & 0x00000040) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(d);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufLinearSystem mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 8: {
+ // numStates
+ numStates = input.readUInt32();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 16) {
+ break;
+ }
+ }
+ case 16: {
+ // numInputs
+ numInputs = input.readUInt32();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 24) {
+ break;
+ }
+ }
+ case 24: {
+ // numOutputs
+ numOutputs = input.readUInt32();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 34) {
+ break;
+ }
+ }
+ case 34: {
+ // a
+ input.readMessage(a);
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 42) {
+ break;
+ }
+ }
+ case 42: {
+ // b
+ input.readMessage(b);
+ bitField0_ |= 0x00000010;
+ tag = input.readTag();
+ if (tag != 50) {
+ break;
+ }
+ }
+ case 50: {
+ // c
+ input.readMessage(c);
+ bitField0_ |= 0x00000020;
+ tag = input.readTag();
+ if (tag != 58) {
+ break;
+ }
+ }
+ case 58: {
+ // d
+ input.readMessage(d);
+ bitField0_ |= 0x00000040;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeUInt32(FieldNames.numStates, numStates);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeUInt32(FieldNames.numInputs, numInputs);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeUInt32(FieldNames.numOutputs, numOutputs);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeMessage(FieldNames.a, a);
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ output.writeMessage(FieldNames.b, b);
+ }
+ if ((bitField0_ & 0x00000020) != 0) {
+ output.writeMessage(FieldNames.c, c);
+ }
+ if ((bitField0_ & 0x00000040) != 0) {
+ output.writeMessage(FieldNames.d, d);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufLinearSystem mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 1233856808:
+ case 1643330779: {
+ if (input.isAtField(FieldNames.numStates)) {
+ if (!input.trySkipNullValue()) {
+ numStates = input.readUInt32();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 942472463:
+ case 1351946434: {
+ if (input.isAtField(FieldNames.numInputs)) {
+ if (!input.trySkipNullValue()) {
+ numInputs = input.readUInt32();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 385880364:
+ case 194671577: {
+ if (input.isAtField(FieldNames.numOutputs)) {
+ if (!input.trySkipNullValue()) {
+ numOutputs = input.readUInt32();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 97: {
+ if (input.isAtField(FieldNames.a)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(a);
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 98: {
+ if (input.isAtField(FieldNames.b)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(b);
+ bitField0_ |= 0x00000010;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 99: {
+ if (input.isAtField(FieldNames.c)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(c);
+ bitField0_ |= 0x00000020;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 100: {
+ if (input.isAtField(FieldNames.d)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(d);
+ bitField0_ |= 0x00000040;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufLinearSystem clone() {
+ return new ProtobufLinearSystem().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufLinearSystem parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufLinearSystem(), data).checkInitialized();
+ }
+
+ public static ProtobufLinearSystem parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufLinearSystem(), input).checkInitialized();
+ }
+
+ public static ProtobufLinearSystem parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufLinearSystem(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufLinearSystem messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufLinearSystemFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return System.wpi_proto_ProtobufLinearSystem_descriptor;
+ }
+
+ private enum ProtobufLinearSystemFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufLinearSystem create() {
+ return ProtobufLinearSystem.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName numStates = FieldName.forField("numStates", "num_states");
+
+ static final FieldName numInputs = FieldName.forField("numInputs", "num_inputs");
+
+ static final FieldName numOutputs = FieldName.forField("numOutputs", "num_outputs");
+
+ static final FieldName a = FieldName.forField("a");
+
+ static final FieldName b = FieldName.forField("b");
+
+ static final FieldName c = FieldName.forField("c");
+
+ static final FieldName d = FieldName.forField("d");
+ }
+ }
+}
diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Trajectory.java b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Trajectory.java
new file mode 100644
index 0000000000..3ec96f8276
--- /dev/null
+++ b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Trajectory.java
@@ -0,0 +1,928 @@
+// Copyright (c) FIRST and other WPILib contributors.
+// Open Source Software; you can modify and/or share it under the terms of
+// the WPILib BSD license file in the root directory of this project.
+// Code generated by protocol buffer compiler. Do not edit!
+package edu.wpi.first.math.proto;
+
+import java.io.IOException;
+import us.hebi.quickbuf.Descriptors;
+import us.hebi.quickbuf.FieldName;
+import us.hebi.quickbuf.InvalidProtocolBufferException;
+import us.hebi.quickbuf.JsonSink;
+import us.hebi.quickbuf.JsonSource;
+import us.hebi.quickbuf.MessageFactory;
+import us.hebi.quickbuf.ProtoMessage;
+import us.hebi.quickbuf.ProtoSink;
+import us.hebi.quickbuf.ProtoSource;
+import us.hebi.quickbuf.ProtoUtil;
+import us.hebi.quickbuf.RepeatedByte;
+import us.hebi.quickbuf.RepeatedMessage;
+
+public final class Trajectory {
+ private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(809,
+ "ChB0cmFqZWN0b3J5LnByb3RvEgl3cGkucHJvdG8aEGdlb21ldHJ5MmQucHJvdG8iugEKF1Byb3RvYnVm" +
+ "VHJhamVjdG9yeVN0YXRlEhIKBHRpbWUYASABKAFSBHRpbWUSGgoIdmVsb2NpdHkYAiABKAFSCHZlbG9j" +
+ "aXR5EiIKDGFjY2VsZXJhdGlvbhgDIAEoAVIMYWNjZWxlcmF0aW9uEi0KBHBvc2UYBCABKAsyGS53cGku" +
+ "cHJvdG8uUHJvdG9idWZQb3NlMmRSBHBvc2USHAoJY3VydmF0dXJlGAUgASgBUgljdXJ2YXR1cmUiUAoS" +
+ "UHJvdG9idWZUcmFqZWN0b3J5EjoKBnN0YXRlcxgCIAMoCzIiLndwaS5wcm90by5Qcm90b2J1ZlRyYWpl" +
+ "Y3RvcnlTdGF0ZVIGc3RhdGVzQhoKGGVkdS53cGkuZmlyc3QubWF0aC5wcm90b0rEAwoGEgQAABIBCggK" +
+ "AQwSAwAAEgoICgECEgMCABIKCQoCAwASAwQAGgoICgEIEgMGADEKCQoCCAESAwYAMQoKCgIEABIECAAO" +
+ "AQoKCgMEAAESAwgIHwoLCgQEAAIAEgMJAhIKDAoFBAACAAUSAwkCCAoMCgUEAAIAARIDCQkNCgwKBQQA" +
+ "AgADEgMJEBEKCwoEBAACARIDCgIWCgwKBQQAAgEFEgMKAggKDAoFBAACAQESAwoJEQoMCgUEAAIBAxID" +
+ "ChQVCgsKBAQAAgISAwsCGgoMCgUEAAICBRIDCwIICgwKBQQAAgIBEgMLCRUKDAoFBAACAgMSAwsYGQoL" +
+ "CgQEAAIDEgMMAhoKDAoFBAACAwYSAwwCEAoMCgUEAAIDARIDDBEVCgwKBQQAAgMDEgMMGBkKCwoEBAAC" +
+ "BBIDDQIXCgwKBQQAAgQFEgMNAggKDAoFBAACBAESAw0JEgoMCgUEAAIEAxIDDRUWCgoKAgQBEgQQABIB" +
+ "CgoKAwQBARIDEAgaCgsKBAQBAgASAxECLgoMCgUEAQIABBIDEQIKCgwKBQQBAgAGEgMRCyIKDAoFBAEC" +
+ "AAESAxEjKQoMCgUEAQIAAxIDESwtYgZwcm90bzM=");
+
+ static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("trajectory.proto", "wpi.proto", descriptorData, Geometry2D.getDescriptor());
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufTrajectoryState_descriptor = descriptor.internalContainedType(50, 186, "ProtobufTrajectoryState", "wpi.proto.ProtobufTrajectoryState");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufTrajectory_descriptor = descriptor.internalContainedType(238, 80, "ProtobufTrajectory", "wpi.proto.ProtobufTrajectory");
+
+ /**
+ * @return this proto file's descriptor.
+ */
+ public static Descriptors.FileDescriptor getDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Protobuf type {@code ProtobufTrajectoryState}
+ */
+ public static final class ProtobufTrajectoryState extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional double time = 1;
+ */
+ private double time;
+
+ /**
+ * optional double velocity = 2;
+ */
+ private double velocity;
+
+ /**
+ * optional double acceleration = 3;
+ */
+ private double acceleration;
+
+ /**
+ * optional double curvature = 5;
+ */
+ private double curvature;
+
+ /**
+ * optional .wpi.proto.ProtobufPose2d pose = 4;
+ */
+ private final Geometry2D.ProtobufPose2d pose = Geometry2D.ProtobufPose2d.newInstance();
+
+ private ProtobufTrajectoryState() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufTrajectoryState}
+ */
+ public static ProtobufTrajectoryState newInstance() {
+ return new ProtobufTrajectoryState();
+ }
+
+ /**
+ * optional double time = 1;
+ * @return whether the time field is set
+ */
+ public boolean hasTime() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional double time = 1;
+ * @return this
+ */
+ public ProtobufTrajectoryState clearTime() {
+ bitField0_ &= ~0x00000001;
+ time = 0D;
+ return this;
+ }
+
+ /**
+ * optional double time = 1;
+ * @return the time
+ */
+ public double getTime() {
+ return time;
+ }
+
+ /**
+ * optional double time = 1;
+ * @param value the time to set
+ * @return this
+ */
+ public ProtobufTrajectoryState setTime(final double value) {
+ bitField0_ |= 0x00000001;
+ time = value;
+ return this;
+ }
+
+ /**
+ * optional double velocity = 2;
+ * @return whether the velocity field is set
+ */
+ public boolean hasVelocity() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional double velocity = 2;
+ * @return this
+ */
+ public ProtobufTrajectoryState clearVelocity() {
+ bitField0_ &= ~0x00000002;
+ velocity = 0D;
+ return this;
+ }
+
+ /**
+ * optional double velocity = 2;
+ * @return the velocity
+ */
+ public double getVelocity() {
+ return velocity;
+ }
+
+ /**
+ * optional double velocity = 2;
+ * @param value the velocity to set
+ * @return this
+ */
+ public ProtobufTrajectoryState setVelocity(final double value) {
+ bitField0_ |= 0x00000002;
+ velocity = value;
+ return this;
+ }
+
+ /**
+ * optional double acceleration = 3;
+ * @return whether the acceleration field is set
+ */
+ public boolean hasAcceleration() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * optional double acceleration = 3;
+ * @return this
+ */
+ public ProtobufTrajectoryState clearAcceleration() {
+ bitField0_ &= ~0x00000004;
+ acceleration = 0D;
+ return this;
+ }
+
+ /**
+ * optional double acceleration = 3;
+ * @return the acceleration
+ */
+ public double getAcceleration() {
+ return acceleration;
+ }
+
+ /**
+ * optional double acceleration = 3;
+ * @param value the acceleration to set
+ * @return this
+ */
+ public ProtobufTrajectoryState setAcceleration(final double value) {
+ bitField0_ |= 0x00000004;
+ acceleration = value;
+ return this;
+ }
+
+ /**
+ * optional double curvature = 5;
+ * @return whether the curvature field is set
+ */
+ public boolean hasCurvature() {
+ return (bitField0_ & 0x00000008) != 0;
+ }
+
+ /**
+ * optional double curvature = 5;
+ * @return this
+ */
+ public ProtobufTrajectoryState clearCurvature() {
+ bitField0_ &= ~0x00000008;
+ curvature = 0D;
+ return this;
+ }
+
+ /**
+ * optional double curvature = 5;
+ * @return the curvature
+ */
+ public double getCurvature() {
+ return curvature;
+ }
+
+ /**
+ * optional double curvature = 5;
+ * @param value the curvature to set
+ * @return this
+ */
+ public ProtobufTrajectoryState setCurvature(final double value) {
+ bitField0_ |= 0x00000008;
+ curvature = value;
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufPose2d pose = 4;
+ * @return whether the pose field is set
+ */
+ public boolean hasPose() {
+ return (bitField0_ & 0x00000010) != 0;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufPose2d pose = 4;
+ * @return this
+ */
+ public ProtobufTrajectoryState clearPose() {
+ bitField0_ &= ~0x00000010;
+ pose.clear();
+ return this;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufPose2d pose = 4;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutablePose()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public Geometry2D.ProtobufPose2d getPose() {
+ return pose;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufPose2d pose = 4;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public Geometry2D.ProtobufPose2d getMutablePose() {
+ bitField0_ |= 0x00000010;
+ return pose;
+ }
+
+ /**
+ * optional .wpi.proto.ProtobufPose2d pose = 4;
+ * @param value the pose to set
+ * @return this
+ */
+ public ProtobufTrajectoryState setPose(final Geometry2D.ProtobufPose2d value) {
+ bitField0_ |= 0x00000010;
+ pose.copyFrom(value);
+ return this;
+ }
+
+ @Override
+ public ProtobufTrajectoryState copyFrom(final ProtobufTrajectoryState other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ time = other.time;
+ velocity = other.velocity;
+ acceleration = other.acceleration;
+ curvature = other.curvature;
+ pose.copyFrom(other.pose);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTrajectoryState mergeFrom(final ProtobufTrajectoryState other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasTime()) {
+ setTime(other.time);
+ }
+ if (other.hasVelocity()) {
+ setVelocity(other.velocity);
+ }
+ if (other.hasAcceleration()) {
+ setAcceleration(other.acceleration);
+ }
+ if (other.hasCurvature()) {
+ setCurvature(other.curvature);
+ }
+ if (other.hasPose()) {
+ getMutablePose().mergeFrom(other.pose);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTrajectoryState clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ time = 0D;
+ velocity = 0D;
+ acceleration = 0D;
+ curvature = 0D;
+ pose.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufTrajectoryState clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ pose.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufTrajectoryState)) {
+ return false;
+ }
+ ProtobufTrajectoryState other = (ProtobufTrajectoryState) o;
+ return bitField0_ == other.bitField0_
+ && (!hasTime() || ProtoUtil.isEqual(time, other.time))
+ && (!hasVelocity() || ProtoUtil.isEqual(velocity, other.velocity))
+ && (!hasAcceleration() || ProtoUtil.isEqual(acceleration, other.acceleration))
+ && (!hasCurvature() || ProtoUtil.isEqual(curvature, other.curvature))
+ && (!hasPose() || pose.equals(other.pose));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(time);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 17);
+ output.writeDoubleNoTag(velocity);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(acceleration);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeRawByte((byte) 41);
+ output.writeDoubleNoTag(curvature);
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ output.writeRawByte((byte) 34);
+ output.writeMessageNoTag(pose);
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ size += 9;
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ size += 1 + ProtoSink.computeMessageSizeNoTag(pose);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufTrajectoryState mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 9: {
+ // time
+ time = input.readDouble();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 17) {
+ break;
+ }
+ }
+ case 17: {
+ // velocity
+ velocity = input.readDouble();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 25) {
+ break;
+ }
+ }
+ case 25: {
+ // acceleration
+ acceleration = input.readDouble();
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 41) {
+ break;
+ }
+ }
+ case 41: {
+ // curvature
+ curvature = input.readDouble();
+ bitField0_ |= 0x00000008;
+ tag = input.readTag();
+ if (tag != 34) {
+ break;
+ }
+ }
+ case 34: {
+ // pose
+ input.readMessage(pose);
+ bitField0_ |= 0x00000010;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeDouble(FieldNames.time, time);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeDouble(FieldNames.velocity, velocity);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeDouble(FieldNames.acceleration, acceleration);
+ }
+ if ((bitField0_ & 0x00000008) != 0) {
+ output.writeDouble(FieldNames.curvature, curvature);
+ }
+ if ((bitField0_ & 0x00000010) != 0) {
+ output.writeMessage(FieldNames.pose, pose);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufTrajectoryState mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 3560141: {
+ if (input.isAtField(FieldNames.time)) {
+ if (!input.trySkipNullValue()) {
+ time = input.readDouble();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 2134260957: {
+ if (input.isAtField(FieldNames.velocity)) {
+ if (!input.trySkipNullValue()) {
+ velocity = input.readDouble();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -267299712: {
+ if (input.isAtField(FieldNames.acceleration)) {
+ if (!input.trySkipNullValue()) {
+ acceleration = input.readDouble();
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 768611295: {
+ if (input.isAtField(FieldNames.curvature)) {
+ if (!input.trySkipNullValue()) {
+ curvature = input.readDouble();
+ bitField0_ |= 0x00000008;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3446929: {
+ if (input.isAtField(FieldNames.pose)) {
+ if (!input.trySkipNullValue()) {
+ input.readMessage(pose);
+ bitField0_ |= 0x00000010;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufTrajectoryState clone() {
+ return new ProtobufTrajectoryState().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufTrajectoryState parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufTrajectoryState(), data).checkInitialized();
+ }
+
+ public static ProtobufTrajectoryState parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTrajectoryState(), input).checkInitialized();
+ }
+
+ public static ProtobufTrajectoryState parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTrajectoryState(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufTrajectoryState messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufTrajectoryStateFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Trajectory.wpi_proto_ProtobufTrajectoryState_descriptor;
+ }
+
+ private enum ProtobufTrajectoryStateFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufTrajectoryState create() {
+ return ProtobufTrajectoryState.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName time = FieldName.forField("time");
+
+ static final FieldName velocity = FieldName.forField("velocity");
+
+ static final FieldName acceleration = FieldName.forField("acceleration");
+
+ static final FieldName curvature = FieldName.forField("curvature");
+
+ static final FieldName pose = FieldName.forField("pose");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufTrajectory}
+ */
+ public static final class ProtobufTrajectory extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * repeated .wpi.proto.ProtobufTrajectoryState states = 2;
+ */
+ private final RepeatedMessage states = RepeatedMessage.newEmptyInstance(ProtobufTrajectoryState.getFactory());
+
+ private ProtobufTrajectory() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufTrajectory}
+ */
+ public static ProtobufTrajectory newInstance() {
+ return new ProtobufTrajectory();
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTrajectoryState states = 2;
+ * @return whether the states field is set
+ */
+ public boolean hasStates() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTrajectoryState states = 2;
+ * @return this
+ */
+ public ProtobufTrajectory clearStates() {
+ bitField0_ &= ~0x00000001;
+ states.clear();
+ return this;
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTrajectoryState states = 2;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableStates()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedMessage getStates() {
+ return states;
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTrajectoryState states = 2;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedMessage getMutableStates() {
+ bitField0_ |= 0x00000001;
+ return states;
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTrajectoryState states = 2;
+ * @param value the states to add
+ * @return this
+ */
+ public ProtobufTrajectory addStates(final ProtobufTrajectoryState value) {
+ bitField0_ |= 0x00000001;
+ states.add(value);
+ return this;
+ }
+
+ /**
+ * repeated .wpi.proto.ProtobufTrajectoryState states = 2;
+ * @param values the states to add
+ * @return this
+ */
+ public ProtobufTrajectory addAllStates(final ProtobufTrajectoryState... values) {
+ bitField0_ |= 0x00000001;
+ states.addAll(values);
+ return this;
+ }
+
+ @Override
+ public ProtobufTrajectory copyFrom(final ProtobufTrajectory other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ states.copyFrom(other.states);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTrajectory mergeFrom(final ProtobufTrajectory other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasStates()) {
+ getMutableStates().addAll(other.states);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufTrajectory clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ states.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufTrajectory clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ states.clearQuick();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufTrajectory)) {
+ return false;
+ }
+ ProtobufTrajectory other = (ProtobufTrajectory) o;
+ return bitField0_ == other.bitField0_
+ && (!hasStates() || states.equals(other.states));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ for (int i = 0; i < states.length(); i++) {
+ output.writeRawByte((byte) 18);
+ output.writeMessageNoTag(states.get(i));
+ }
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += (1 * states.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(states);
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufTrajectory mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 18: {
+ // states
+ tag = input.readRepeatedMessage(states, tag);
+ bitField0_ |= 0x00000001;
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRepeatedMessage(FieldNames.states, states);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufTrajectory mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case -892482046: {
+ if (input.isAtField(FieldNames.states)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedMessage(states);
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufTrajectory clone() {
+ return new ProtobufTrajectory().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufTrajectory parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufTrajectory(), data).checkInitialized();
+ }
+
+ public static ProtobufTrajectory parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTrajectory(), input).checkInitialized();
+ }
+
+ public static ProtobufTrajectory parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufTrajectory(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufTrajectory messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufTrajectoryFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Trajectory.wpi_proto_ProtobufTrajectory_descriptor;
+ }
+
+ private enum ProtobufTrajectoryFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufTrajectory create() {
+ return ProtobufTrajectory.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName states = FieldName.forField("states");
+ }
+ }
+}
diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Wpimath.java b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Wpimath.java
new file mode 100644
index 0000000000..ce964a2795
--- /dev/null
+++ b/wpimath/src/generated/main/java/edu/wpi/first/math/proto/Wpimath.java
@@ -0,0 +1,791 @@
+// Copyright (c) FIRST and other WPILib contributors.
+// Open Source Software; you can modify and/or share it under the terms of
+// the WPILib BSD license file in the root directory of this project.
+// Code generated by protocol buffer compiler. Do not edit!
+package edu.wpi.first.math.proto;
+
+import java.io.IOException;
+import us.hebi.quickbuf.Descriptors;
+import us.hebi.quickbuf.FieldName;
+import us.hebi.quickbuf.InvalidProtocolBufferException;
+import us.hebi.quickbuf.JsonSink;
+import us.hebi.quickbuf.JsonSource;
+import us.hebi.quickbuf.MessageFactory;
+import us.hebi.quickbuf.ProtoMessage;
+import us.hebi.quickbuf.ProtoSink;
+import us.hebi.quickbuf.ProtoSource;
+import us.hebi.quickbuf.ProtoUtil;
+import us.hebi.quickbuf.RepeatedByte;
+import us.hebi.quickbuf.RepeatedDouble;
+
+public final class Wpimath {
+ private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(540,
+ "Cg13cGltYXRoLnByb3RvEgl3cGkucHJvdG8iWgoOUHJvdG9idWZNYXRyaXgSGQoIbnVtX3Jvd3MYASAB" +
+ "KA1SB251bVJvd3MSGQoIbnVtX2NvbHMYAiABKA1SB251bUNvbHMSEgoEZGF0YRgDIAMoAVIEZGF0YSIk" +
+ "Cg5Qcm90b2J1ZlZlY3RvchISCgRyb3dzGAEgAygBUgRyb3dzQhoKGGVkdS53cGkuZmlyc3QubWF0aC5w" +
+ "cm90b0rZAgoGEgQAAA4BCggKAQwSAwAAEgoICgECEgMCABIKCAoBCBIDBAAxCgkKAggBEgMEADEKCgoC" +
+ "BAASBAYACgEKCgoDBAABEgMGCBYKCwoEBAACABIDBwIWCgwKBQQAAgAFEgMHAggKDAoFBAACAAESAwcJ" +
+ "EQoMCgUEAAIAAxIDBxQVCgsKBAQAAgESAwgCFgoMCgUEAAIBBRIDCAIICgwKBQQAAgEBEgMICREKDAoF" +
+ "BAACAQMSAwgUFQoLCgQEAAICEgMJAhsKDAoFBAACAgQSAwkCCgoMCgUEAAICBRIDCQsRCgwKBQQAAgIB" +
+ "EgMJEhYKDAoFBAACAgMSAwkZGgoKCgIEARIEDAAOAQoKCgMEAQESAwwIFgoLCgQEAQIAEgMNAhsKDAoF" +
+ "BAECAAQSAw0CCgoMCgUEAQIABRIDDQsRCgwKBQQBAgABEgMNEhYKDAoFBAECAAMSAw0ZGmIGcHJvdG8z");
+
+ static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("wpimath.proto", "wpi.proto", descriptorData);
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufMatrix_descriptor = descriptor.internalContainedType(28, 90, "ProtobufMatrix", "wpi.proto.ProtobufMatrix");
+
+ static final Descriptors.Descriptor wpi_proto_ProtobufVector_descriptor = descriptor.internalContainedType(120, 36, "ProtobufVector", "wpi.proto.ProtobufVector");
+
+ /**
+ * @return this proto file's descriptor.
+ */
+ public static Descriptors.FileDescriptor getDescriptor() {
+ return descriptor;
+ }
+
+ /**
+ * Protobuf type {@code ProtobufMatrix}
+ */
+ public static final class ProtobufMatrix extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * optional uint32 num_rows = 1;
+ */
+ private int numRows;
+
+ /**
+ * optional uint32 num_cols = 2;
+ */
+ private int numCols;
+
+ /**
+ * repeated double data = 3;
+ */
+ private final RepeatedDouble data = RepeatedDouble.newEmptyInstance();
+
+ private ProtobufMatrix() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufMatrix}
+ */
+ public static ProtobufMatrix newInstance() {
+ return new ProtobufMatrix();
+ }
+
+ /**
+ * optional uint32 num_rows = 1;
+ * @return whether the numRows field is set
+ */
+ public boolean hasNumRows() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * optional uint32 num_rows = 1;
+ * @return this
+ */
+ public ProtobufMatrix clearNumRows() {
+ bitField0_ &= ~0x00000001;
+ numRows = 0;
+ return this;
+ }
+
+ /**
+ * optional uint32 num_rows = 1;
+ * @return the numRows
+ */
+ public int getNumRows() {
+ return numRows;
+ }
+
+ /**
+ * optional uint32 num_rows = 1;
+ * @param value the numRows to set
+ * @return this
+ */
+ public ProtobufMatrix setNumRows(final int value) {
+ bitField0_ |= 0x00000001;
+ numRows = value;
+ return this;
+ }
+
+ /**
+ * optional uint32 num_cols = 2;
+ * @return whether the numCols field is set
+ */
+ public boolean hasNumCols() {
+ return (bitField0_ & 0x00000002) != 0;
+ }
+
+ /**
+ * optional uint32 num_cols = 2;
+ * @return this
+ */
+ public ProtobufMatrix clearNumCols() {
+ bitField0_ &= ~0x00000002;
+ numCols = 0;
+ return this;
+ }
+
+ /**
+ * optional uint32 num_cols = 2;
+ * @return the numCols
+ */
+ public int getNumCols() {
+ return numCols;
+ }
+
+ /**
+ * optional uint32 num_cols = 2;
+ * @param value the numCols to set
+ * @return this
+ */
+ public ProtobufMatrix setNumCols(final int value) {
+ bitField0_ |= 0x00000002;
+ numCols = value;
+ return this;
+ }
+
+ /**
+ * repeated double data = 3;
+ * @return whether the data field is set
+ */
+ public boolean hasData() {
+ return (bitField0_ & 0x00000004) != 0;
+ }
+
+ /**
+ * repeated double data = 3;
+ * @return this
+ */
+ public ProtobufMatrix clearData() {
+ bitField0_ &= ~0x00000004;
+ data.clear();
+ return this;
+ }
+
+ /**
+ * repeated double data = 3;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableData()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedDouble getData() {
+ return data;
+ }
+
+ /**
+ * repeated double data = 3;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedDouble getMutableData() {
+ bitField0_ |= 0x00000004;
+ return data;
+ }
+
+ /**
+ * repeated double data = 3;
+ * @param value the data to add
+ * @return this
+ */
+ public ProtobufMatrix addData(final double value) {
+ bitField0_ |= 0x00000004;
+ data.add(value);
+ return this;
+ }
+
+ /**
+ * repeated double data = 3;
+ * @param values the data to add
+ * @return this
+ */
+ public ProtobufMatrix addAllData(final double... values) {
+ bitField0_ |= 0x00000004;
+ data.addAll(values);
+ return this;
+ }
+
+ @Override
+ public ProtobufMatrix copyFrom(final ProtobufMatrix other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ numRows = other.numRows;
+ numCols = other.numCols;
+ data.copyFrom(other.data);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufMatrix mergeFrom(final ProtobufMatrix other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasNumRows()) {
+ setNumRows(other.numRows);
+ }
+ if (other.hasNumCols()) {
+ setNumCols(other.numCols);
+ }
+ if (other.hasData()) {
+ getMutableData().addAll(other.data);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufMatrix clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ numRows = 0;
+ numCols = 0;
+ data.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufMatrix clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ data.clear();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufMatrix)) {
+ return false;
+ }
+ ProtobufMatrix other = (ProtobufMatrix) o;
+ return bitField0_ == other.bitField0_
+ && (!hasNumRows() || numRows == other.numRows)
+ && (!hasNumCols() || numCols == other.numCols)
+ && (!hasData() || data.equals(other.data));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRawByte((byte) 8);
+ output.writeUInt32NoTag(numRows);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeRawByte((byte) 16);
+ output.writeUInt32NoTag(numCols);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ for (int i = 0; i < data.length(); i++) {
+ output.writeRawByte((byte) 25);
+ output.writeDoubleNoTag(data.array()[i]);
+ }
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += 1 + ProtoSink.computeUInt32SizeNoTag(numRows);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ size += 1 + ProtoSink.computeUInt32SizeNoTag(numCols);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ size += (1 + 8) * data.length();
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufMatrix mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 8: {
+ // numRows
+ numRows = input.readUInt32();
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 16) {
+ break;
+ }
+ }
+ case 16: {
+ // numCols
+ numCols = input.readUInt32();
+ bitField0_ |= 0x00000002;
+ tag = input.readTag();
+ if (tag != 26) {
+ break;
+ }
+ }
+ case 26: {
+ // data [packed=true]
+ input.readPackedDouble(data);
+ bitField0_ |= 0x00000004;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ case 25: {
+ // data [packed=false]
+ tag = input.readRepeatedDouble(data, tag);
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeUInt32(FieldNames.numRows, numRows);
+ }
+ if ((bitField0_ & 0x00000002) != 0) {
+ output.writeUInt32(FieldNames.numCols, numCols);
+ }
+ if ((bitField0_ & 0x00000004) != 0) {
+ output.writeRepeatedDouble(FieldNames.data, data);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufMatrix mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case -2000982401:
+ case -1888824590: {
+ if (input.isAtField(FieldNames.numRows)) {
+ if (!input.trySkipNullValue()) {
+ numRows = input.readUInt32();
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case -2001429607:
+ case -1889271796: {
+ if (input.isAtField(FieldNames.numCols)) {
+ if (!input.trySkipNullValue()) {
+ numCols = input.readUInt32();
+ bitField0_ |= 0x00000002;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ case 3076010: {
+ if (input.isAtField(FieldNames.data)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedDouble(data);
+ bitField0_ |= 0x00000004;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufMatrix clone() {
+ return new ProtobufMatrix().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufMatrix parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufMatrix(), data).checkInitialized();
+ }
+
+ public static ProtobufMatrix parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufMatrix(), input).checkInitialized();
+ }
+
+ public static ProtobufMatrix parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufMatrix(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufMatrix messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufMatrixFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Wpimath.wpi_proto_ProtobufMatrix_descriptor;
+ }
+
+ private enum ProtobufMatrixFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufMatrix create() {
+ return ProtobufMatrix.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName numRows = FieldName.forField("numRows", "num_rows");
+
+ static final FieldName numCols = FieldName.forField("numCols", "num_cols");
+
+ static final FieldName data = FieldName.forField("data");
+ }
+ }
+
+ /**
+ * Protobuf type {@code ProtobufVector}
+ */
+ public static final class ProtobufVector extends ProtoMessage implements Cloneable {
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * repeated double rows = 1;
+ */
+ private final RepeatedDouble rows = RepeatedDouble.newEmptyInstance();
+
+ private ProtobufVector() {
+ }
+
+ /**
+ * @return a new empty instance of {@code ProtobufVector}
+ */
+ public static ProtobufVector newInstance() {
+ return new ProtobufVector();
+ }
+
+ /**
+ * repeated double rows = 1;
+ * @return whether the rows field is set
+ */
+ public boolean hasRows() {
+ return (bitField0_ & 0x00000001) != 0;
+ }
+
+ /**
+ * repeated double rows = 1;
+ * @return this
+ */
+ public ProtobufVector clearRows() {
+ bitField0_ &= ~0x00000001;
+ rows.clear();
+ return this;
+ }
+
+ /**
+ * repeated double rows = 1;
+ *
+ * This method returns the internal storage object without modifying any has state.
+ * The returned object should not be modified and be treated as read-only.
+ *
+ * Use {@link #getMutableRows()} if you want to modify it.
+ *
+ * @return internal storage object for reading
+ */
+ public RepeatedDouble getRows() {
+ return rows;
+ }
+
+ /**
+ * repeated double rows = 1;
+ *
+ * This method returns the internal storage object and sets the corresponding
+ * has state. The returned object will become part of this message and its
+ * contents may be modified as long as the has state is not cleared.
+ *
+ * @return internal storage object for modifications
+ */
+ public RepeatedDouble getMutableRows() {
+ bitField0_ |= 0x00000001;
+ return rows;
+ }
+
+ /**
+ * repeated double rows = 1;
+ * @param value the rows to add
+ * @return this
+ */
+ public ProtobufVector addRows(final double value) {
+ bitField0_ |= 0x00000001;
+ rows.add(value);
+ return this;
+ }
+
+ /**
+ * repeated double rows = 1;
+ * @param values the rows to add
+ * @return this
+ */
+ public ProtobufVector addAllRows(final double... values) {
+ bitField0_ |= 0x00000001;
+ rows.addAll(values);
+ return this;
+ }
+
+ @Override
+ public ProtobufVector copyFrom(final ProtobufVector other) {
+ cachedSize = other.cachedSize;
+ if ((bitField0_ | other.bitField0_) != 0) {
+ bitField0_ = other.bitField0_;
+ rows.copyFrom(other.rows);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufVector mergeFrom(final ProtobufVector other) {
+ if (other.isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ if (other.hasRows()) {
+ getMutableRows().addAll(other.rows);
+ }
+ return this;
+ }
+
+ @Override
+ public ProtobufVector clear() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ rows.clear();
+ return this;
+ }
+
+ @Override
+ public ProtobufVector clearQuick() {
+ if (isEmpty()) {
+ return this;
+ }
+ cachedSize = -1;
+ bitField0_ = 0;
+ rows.clear();
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+ if (!(o instanceof ProtobufVector)) {
+ return false;
+ }
+ ProtobufVector other = (ProtobufVector) o;
+ return bitField0_ == other.bitField0_
+ && (!hasRows() || rows.equals(other.rows));
+ }
+
+ @Override
+ public void writeTo(final ProtoSink output) throws IOException {
+ if ((bitField0_ & 0x00000001) != 0) {
+ for (int i = 0; i < rows.length(); i++) {
+ output.writeRawByte((byte) 9);
+ output.writeDoubleNoTag(rows.array()[i]);
+ }
+ }
+ }
+
+ @Override
+ protected int computeSerializedSize() {
+ int size = 0;
+ if ((bitField0_ & 0x00000001) != 0) {
+ size += (1 + 8) * rows.length();
+ }
+ return size;
+ }
+
+ @Override
+ @SuppressWarnings("fallthrough")
+ public ProtobufVector mergeFrom(final ProtoSource input) throws IOException {
+ // Enabled Fall-Through Optimization (QuickBuffers)
+ int tag = input.readTag();
+ while (true) {
+ switch (tag) {
+ case 10: {
+ // rows [packed=true]
+ input.readPackedDouble(rows);
+ bitField0_ |= 0x00000001;
+ tag = input.readTag();
+ if (tag != 0) {
+ break;
+ }
+ }
+ case 0: {
+ return this;
+ }
+ default: {
+ if (!input.skipField(tag)) {
+ return this;
+ }
+ tag = input.readTag();
+ break;
+ }
+ case 9: {
+ // rows [packed=false]
+ tag = input.readRepeatedDouble(rows, tag);
+ bitField0_ |= 0x00000001;
+ break;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void writeTo(final JsonSink output) throws IOException {
+ output.beginObject();
+ if ((bitField0_ & 0x00000001) != 0) {
+ output.writeRepeatedDouble(FieldNames.rows, rows);
+ }
+ output.endObject();
+ }
+
+ @Override
+ public ProtobufVector mergeFrom(final JsonSource input) throws IOException {
+ if (!input.beginObject()) {
+ return this;
+ }
+ while (!input.isAtEnd()) {
+ switch (input.readFieldHash()) {
+ case 3506649: {
+ if (input.isAtField(FieldNames.rows)) {
+ if (!input.trySkipNullValue()) {
+ input.readRepeatedDouble(rows);
+ bitField0_ |= 0x00000001;
+ }
+ } else {
+ input.skipUnknownField();
+ }
+ break;
+ }
+ default: {
+ input.skipUnknownField();
+ break;
+ }
+ }
+ }
+ input.endObject();
+ return this;
+ }
+
+ @Override
+ public ProtobufVector clone() {
+ return new ProtobufVector().copyFrom(this);
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return ((bitField0_) == 0);
+ }
+
+ public static ProtobufVector parseFrom(final byte[] data) throws
+ InvalidProtocolBufferException {
+ return ProtoMessage.mergeFrom(new ProtobufVector(), data).checkInitialized();
+ }
+
+ public static ProtobufVector parseFrom(final ProtoSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufVector(), input).checkInitialized();
+ }
+
+ public static ProtobufVector parseFrom(final JsonSource input) throws IOException {
+ return ProtoMessage.mergeFrom(new ProtobufVector(), input).checkInitialized();
+ }
+
+ /**
+ * @return factory for creating ProtobufVector messages
+ */
+ public static MessageFactory getFactory() {
+ return ProtobufVectorFactory.INSTANCE;
+ }
+
+ /**
+ * @return this type's descriptor.
+ */
+ public static Descriptors.Descriptor getDescriptor() {
+ return Wpimath.wpi_proto_ProtobufVector_descriptor;
+ }
+
+ private enum ProtobufVectorFactory implements MessageFactory {
+ INSTANCE;
+
+ @Override
+ public ProtobufVector create() {
+ return ProtobufVector.newInstance();
+ }
+ }
+
+ /**
+ * Contains name constants used for serializing JSON
+ */
+ static class FieldNames {
+ static final FieldName rows = FieldName.forField("rows");
+ }
+ }
+}