mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[wpimath] Reorganize LinearSystem factories (#8468)
This commit is contained in:
@@ -1,621 +0,0 @@
|
||||
// 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 org.wpilib.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(607,
|
||||
"CgtwbGFudC5wcm90bxIJd3BpLnByb3RvIsQBCg9Qcm90b2J1ZkRDTW90b3ISJwoPbm9taW5hbF92b2x0" +
|
||||
"YWdlGAEgASgBUg5ub21pbmFsVm9sdGFnZRIhCgxzdGFsbF90b3JxdWUYAiABKAFSC3N0YWxsVG9ycXVl" +
|
||||
"EiMKDXN0YWxsX2N1cnJlbnQYAyABKAFSDHN0YWxsQ3VycmVudBIhCgxmcmVlX2N1cnJlbnQYBCABKAFS" +
|
||||
"C2ZyZWVDdXJyZW50Eh0KCmZyZWVfc3BlZWQYBSABKAFSCWZyZWVTcGVlZEIXChVvcmcud3BpbGliLm1h" +
|
||||
"dGgucHJvdG9K3AIKBhIEAAAMAQoICgEMEgMAABIKCAoBAhIDAgASCggKAQgSAwQALgoJCgIIARIDBAAu" +
|
||||
"CgoKAgQAEgQGAAwBCgoKAwQAARIDBggXCgsKBAQAAgASAwcCHQoMCgUEAAIABRIDBwIICgwKBQQAAgAB" +
|
||||
"EgMHCRgKDAoFBAACAAMSAwcbHAoLCgQEAAIBEgMIAhoKDAoFBAACAQUSAwgCCAoMCgUEAAIBARIDCAkV" +
|
||||
"CgwKBQQAAgEDEgMIGBkKCwoEBAACAhIDCQIbCgwKBQQAAgIFEgMJAggKDAoFBAACAgESAwkJFgoMCgUE" +
|
||||
"AAICAxIDCRkaCgsKBAQAAgMSAwoCGgoMCgUEAAIDBRIDCgIICgwKBQQAAgMBEgMKCRUKDAoFBAACAwMS" +
|
||||
"AwoYGQoLCgQEAAIEEgMLAhgKDAoFBAACBAUSAwsCCAoMCgUEAAIEARIDCwkTCgwKBQQAAgQDEgMLFhdi" +
|
||||
"BnByb3RvMw==");
|
||||
|
||||
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<ProtobufDCMotor> implements Cloneable {
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
/**
|
||||
* <code>optional double nominal_voltage = 1;</code>
|
||||
*/
|
||||
private double nominalVoltage;
|
||||
|
||||
/**
|
||||
* <code>optional double stall_torque = 2;</code>
|
||||
*/
|
||||
private double stallTorque;
|
||||
|
||||
/**
|
||||
* <code>optional double stall_current = 3;</code>
|
||||
*/
|
||||
private double stallCurrent;
|
||||
|
||||
/**
|
||||
* <code>optional double free_current = 4;</code>
|
||||
*/
|
||||
private double freeCurrent;
|
||||
|
||||
/**
|
||||
* <code>optional double free_speed = 5;</code>
|
||||
*/
|
||||
private double freeSpeed;
|
||||
|
||||
private ProtobufDCMotor() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a new empty instance of {@code ProtobufDCMotor}
|
||||
*/
|
||||
public static ProtobufDCMotor newInstance() {
|
||||
return new ProtobufDCMotor();
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double nominal_voltage = 1;</code>
|
||||
* @return whether the nominalVoltage field is set
|
||||
*/
|
||||
public boolean hasNominalVoltage() {
|
||||
return (bitField0_ & 0x00000001) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double nominal_voltage = 1;</code>
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor clearNominalVoltage() {
|
||||
bitField0_ &= ~0x00000001;
|
||||
nominalVoltage = 0D;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double nominal_voltage = 1;</code>
|
||||
* @return the nominalVoltage
|
||||
*/
|
||||
public double getNominalVoltage() {
|
||||
return nominalVoltage;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double nominal_voltage = 1;</code>
|
||||
* @param value the nominalVoltage to set
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor setNominalVoltage(final double value) {
|
||||
bitField0_ |= 0x00000001;
|
||||
nominalVoltage = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_torque = 2;</code>
|
||||
* @return whether the stallTorque field is set
|
||||
*/
|
||||
public boolean hasStallTorque() {
|
||||
return (bitField0_ & 0x00000002) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_torque = 2;</code>
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor clearStallTorque() {
|
||||
bitField0_ &= ~0x00000002;
|
||||
stallTorque = 0D;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_torque = 2;</code>
|
||||
* @return the stallTorque
|
||||
*/
|
||||
public double getStallTorque() {
|
||||
return stallTorque;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_torque = 2;</code>
|
||||
* @param value the stallTorque to set
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor setStallTorque(final double value) {
|
||||
bitField0_ |= 0x00000002;
|
||||
stallTorque = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_current = 3;</code>
|
||||
* @return whether the stallCurrent field is set
|
||||
*/
|
||||
public boolean hasStallCurrent() {
|
||||
return (bitField0_ & 0x00000004) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_current = 3;</code>
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor clearStallCurrent() {
|
||||
bitField0_ &= ~0x00000004;
|
||||
stallCurrent = 0D;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_current = 3;</code>
|
||||
* @return the stallCurrent
|
||||
*/
|
||||
public double getStallCurrent() {
|
||||
return stallCurrent;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_current = 3;</code>
|
||||
* @param value the stallCurrent to set
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor setStallCurrent(final double value) {
|
||||
bitField0_ |= 0x00000004;
|
||||
stallCurrent = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_current = 4;</code>
|
||||
* @return whether the freeCurrent field is set
|
||||
*/
|
||||
public boolean hasFreeCurrent() {
|
||||
return (bitField0_ & 0x00000008) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_current = 4;</code>
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor clearFreeCurrent() {
|
||||
bitField0_ &= ~0x00000008;
|
||||
freeCurrent = 0D;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_current = 4;</code>
|
||||
* @return the freeCurrent
|
||||
*/
|
||||
public double getFreeCurrent() {
|
||||
return freeCurrent;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_current = 4;</code>
|
||||
* @param value the freeCurrent to set
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor setFreeCurrent(final double value) {
|
||||
bitField0_ |= 0x00000008;
|
||||
freeCurrent = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_speed = 5;</code>
|
||||
* @return whether the freeSpeed field is set
|
||||
*/
|
||||
public boolean hasFreeSpeed() {
|
||||
return (bitField0_ & 0x00000010) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_speed = 5;</code>
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor clearFreeSpeed() {
|
||||
bitField0_ &= ~0x00000010;
|
||||
freeSpeed = 0D;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_speed = 5;</code>
|
||||
* @return the freeSpeed
|
||||
*/
|
||||
public double getFreeSpeed() {
|
||||
return freeSpeed;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_speed = 5;</code>
|
||||
* @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<ProtobufDCMotor> 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<ProtobufDCMotor> {
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,25 +18,36 @@ import us.hebi.quickbuf.ProtoUtil;
|
||||
import us.hebi.quickbuf.RepeatedByte;
|
||||
|
||||
public final class System {
|
||||
private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(829,
|
||||
"CgxzeXN0ZW0ucHJvdG8SCXdwaS5wcm90bxoNd3BpbWF0aC5wcm90byKZAgoUUHJvdG9idWZMaW5lYXJT" +
|
||||
"eXN0ZW0SHQoKbnVtX3N0YXRlcxgBIAEoDVIJbnVtU3RhdGVzEh0KCm51bV9pbnB1dHMYAiABKA1SCW51" +
|
||||
"bUlucHV0cxIfCgtudW1fb3V0cHV0cxgDIAEoDVIKbnVtT3V0cHV0cxInCgFhGAQgASgLMhkud3BpLnBy" +
|
||||
"b3RvLlByb3RvYnVmTWF0cml4UgFhEicKAWIYBSABKAsyGS53cGkucHJvdG8uUHJvdG9idWZNYXRyaXhS" +
|
||||
"AWISJwoBYxgGIAEoCzIZLndwaS5wcm90by5Qcm90b2J1Zk1hdHJpeFIBYxInCgFkGAcgASgLMhkud3Bp" +
|
||||
"LnByb3RvLlByb3RvYnVmTWF0cml4UgFkQhcKFW9yZy53cGlsaWIubWF0aC5wcm90b0rVAwoGEgQAABAB" +
|
||||
"CggKAQwSAwAAEgoICgECEgMCABIKCQoCAwASAwQAFwoICgEIEgMGAC4KCQoCCAESAwYALgoKCgIEABIE" +
|
||||
"CAAQAQoKCgMEAAESAwgIHAoLCgQEAAIAEgMJAhgKDAoFBAACAAUSAwkCCAoMCgUEAAIAARIDCQkTCgwK" +
|
||||
"BQQAAgADEgMJFhcKCwoEBAACARIDCgIYCgwKBQQAAgEFEgMKAggKDAoFBAACAQESAwoJEwoMCgUEAAIB" +
|
||||
"AxIDChYXCgsKBAQAAgISAwsCGQoMCgUEAAICBRIDCwIICgwKBQQAAgIBEgMLCRQKDAoFBAACAgMSAwsX" +
|
||||
"GAoLCgQEAAIDEgMMAhcKDAoFBAACAwYSAwwCEAoMCgUEAAIDARIDDBESCgwKBQQAAgMDEgMMFRYKCwoE" +
|
||||
"BAACBBIDDQIXCgwKBQQAAgQGEgMNAhAKDAoFBAACBAESAw0REgoMCgUEAAIEAxIDDRUWCgsKBAQAAgUS" +
|
||||
"Aw4CFwoMCgUEAAIFBhIDDgIQCgwKBQQAAgUBEgMOERIKDAoFBAACBQMSAw4VFgoLCgQEAAIGEgMPAhcK" +
|
||||
"DAoFBAACBgYSAw8CEAoMCgUEAAIGARIDDxESCgwKBQQAAgYDEgMPFRZiBnByb3RvMw==");
|
||||
private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(1327,
|
||||
"CgxzeXN0ZW0ucHJvdG8SCXdwaS5wcm90bxoNd3BpbWF0aC5wcm90byLEAQoPUHJvdG9idWZEQ01vdG9y" +
|
||||
"EicKD25vbWluYWxfdm9sdGFnZRgBIAEoAVIObm9taW5hbFZvbHRhZ2USIQoMc3RhbGxfdG9ycXVlGAIg" +
|
||||
"ASgBUgtzdGFsbFRvcnF1ZRIjCg1zdGFsbF9jdXJyZW50GAMgASgBUgxzdGFsbEN1cnJlbnQSIQoMZnJl" +
|
||||
"ZV9jdXJyZW50GAQgASgBUgtmcmVlQ3VycmVudBIdCgpmcmVlX3NwZWVkGAUgASgBUglmcmVlU3BlZWQi" +
|
||||
"mQIKFFByb3RvYnVmTGluZWFyU3lzdGVtEh0KCm51bV9zdGF0ZXMYASABKA1SCW51bVN0YXRlcxIdCgpu" +
|
||||
"dW1faW5wdXRzGAIgASgNUgludW1JbnB1dHMSHwoLbnVtX291dHB1dHMYAyABKA1SCm51bU91dHB1dHMS" +
|
||||
"JwoBYRgEIAEoCzIZLndwaS5wcm90by5Qcm90b2J1Zk1hdHJpeFIBYRInCgFiGAUgASgLMhkud3BpLnBy" +
|
||||
"b3RvLlByb3RvYnVmTWF0cml4UgFiEicKAWMYBiABKAsyGS53cGkucHJvdG8uUHJvdG9idWZNYXRyaXhS" +
|
||||
"AWMSJwoBZBgHIAEoCzIZLndwaS5wcm90by5Qcm90b2J1Zk1hdHJpeFIBZEIXChVvcmcud3BpbGliLm1h" +
|
||||
"dGgucHJvdG9KgAYKBhIEAAAYAQoICgEMEgMAABIKCAoBAhIDAgASCgkKAgMAEgMEABcKCAoBCBIDBgAu" +
|
||||
"CgkKAggBEgMGAC4KCgoCBAASBAgADgEKCgoDBAABEgMICBcKCwoEBAACABIDCQIdCgwKBQQAAgAFEgMJ" +
|
||||
"AggKDAoFBAACAAESAwkJGAoMCgUEAAIAAxIDCRscCgsKBAQAAgESAwoCGgoMCgUEAAIBBRIDCgIICgwK" +
|
||||
"BQQAAgEBEgMKCRUKDAoFBAACAQMSAwoYGQoLCgQEAAICEgMLAhsKDAoFBAACAgUSAwsCCAoMCgUEAAIC" +
|
||||
"ARIDCwkWCgwKBQQAAgIDEgMLGRoKCwoEBAACAxIDDAIaCgwKBQQAAgMFEgMMAggKDAoFBAACAwESAwwJ" +
|
||||
"FQoMCgUEAAIDAxIDDBgZCgsKBAQAAgQSAw0CGAoMCgUEAAIEBRIDDQIICgwKBQQAAgQBEgMNCRMKDAoF" +
|
||||
"BAACBAMSAw0WFwoKCgIEARIEEAAYAQoKCgMEAQESAxAIHAoLCgQEAQIAEgMRAhgKDAoFBAECAAUSAxEC" +
|
||||
"CAoMCgUEAQIAARIDEQkTCgwKBQQBAgADEgMRFhcKCwoEBAECARIDEgIYCgwKBQQBAgEFEgMSAggKDAoF" +
|
||||
"BAECAQESAxIJEwoMCgUEAQIBAxIDEhYXCgsKBAQBAgISAxMCGQoMCgUEAQICBRIDEwIICgwKBQQBAgIB" +
|
||||
"EgMTCRQKDAoFBAECAgMSAxMXGAoLCgQEAQIDEgMUAhcKDAoFBAECAwYSAxQCEAoMCgUEAQIDARIDFBES" +
|
||||
"CgwKBQQBAgMDEgMUFRYKCwoEBAECBBIDFQIXCgwKBQQBAgQGEgMVAhAKDAoFBAECBAESAxUREgoMCgUE",
|
||||
"AQIEAxIDFRUWCgsKBAQBAgUSAxYCFwoMCgUEAQIFBhIDFgIQCgwKBQQBAgUBEgMWERIKDAoFBAECBQMS" +
|
||||
"AxYVFgoLCgQEAQIGEgMXAhcKDAoFBAECBgYSAxcCEAoMCgUEAQIGARIDFxESCgwKBQQBAgYDEgMXFRZi" +
|
||||
"BnByb3RvMw==");
|
||||
|
||||
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");
|
||||
static final Descriptors.Descriptor wpi_proto_ProtobufDCMotor_descriptor = descriptor.internalContainedType(43, 196, "ProtobufDCMotor", "wpi.proto.ProtobufDCMotor");
|
||||
|
||||
static final Descriptors.Descriptor wpi_proto_ProtobufLinearSystem_descriptor = descriptor.internalContainedType(242, 281, "ProtobufLinearSystem", "wpi.proto.ProtobufLinearSystem");
|
||||
|
||||
/**
|
||||
* @return this proto file's descriptor.
|
||||
@@ -45,6 +56,583 @@ public final class System {
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protobuf type {@code ProtobufDCMotor}
|
||||
*/
|
||||
public static final class ProtobufDCMotor extends ProtoMessage<ProtobufDCMotor> implements Cloneable {
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
/**
|
||||
* <code>optional double nominal_voltage = 1;</code>
|
||||
*/
|
||||
private double nominalVoltage;
|
||||
|
||||
/**
|
||||
* <code>optional double stall_torque = 2;</code>
|
||||
*/
|
||||
private double stallTorque;
|
||||
|
||||
/**
|
||||
* <code>optional double stall_current = 3;</code>
|
||||
*/
|
||||
private double stallCurrent;
|
||||
|
||||
/**
|
||||
* <code>optional double free_current = 4;</code>
|
||||
*/
|
||||
private double freeCurrent;
|
||||
|
||||
/**
|
||||
* <code>optional double free_speed = 5;</code>
|
||||
*/
|
||||
private double freeSpeed;
|
||||
|
||||
private ProtobufDCMotor() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a new empty instance of {@code ProtobufDCMotor}
|
||||
*/
|
||||
public static ProtobufDCMotor newInstance() {
|
||||
return new ProtobufDCMotor();
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double nominal_voltage = 1;</code>
|
||||
* @return whether the nominalVoltage field is set
|
||||
*/
|
||||
public boolean hasNominalVoltage() {
|
||||
return (bitField0_ & 0x00000001) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double nominal_voltage = 1;</code>
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor clearNominalVoltage() {
|
||||
bitField0_ &= ~0x00000001;
|
||||
nominalVoltage = 0D;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double nominal_voltage = 1;</code>
|
||||
* @return the nominalVoltage
|
||||
*/
|
||||
public double getNominalVoltage() {
|
||||
return nominalVoltage;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double nominal_voltage = 1;</code>
|
||||
* @param value the nominalVoltage to set
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor setNominalVoltage(final double value) {
|
||||
bitField0_ |= 0x00000001;
|
||||
nominalVoltage = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_torque = 2;</code>
|
||||
* @return whether the stallTorque field is set
|
||||
*/
|
||||
public boolean hasStallTorque() {
|
||||
return (bitField0_ & 0x00000002) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_torque = 2;</code>
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor clearStallTorque() {
|
||||
bitField0_ &= ~0x00000002;
|
||||
stallTorque = 0D;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_torque = 2;</code>
|
||||
* @return the stallTorque
|
||||
*/
|
||||
public double getStallTorque() {
|
||||
return stallTorque;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_torque = 2;</code>
|
||||
* @param value the stallTorque to set
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor setStallTorque(final double value) {
|
||||
bitField0_ |= 0x00000002;
|
||||
stallTorque = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_current = 3;</code>
|
||||
* @return whether the stallCurrent field is set
|
||||
*/
|
||||
public boolean hasStallCurrent() {
|
||||
return (bitField0_ & 0x00000004) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_current = 3;</code>
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor clearStallCurrent() {
|
||||
bitField0_ &= ~0x00000004;
|
||||
stallCurrent = 0D;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_current = 3;</code>
|
||||
* @return the stallCurrent
|
||||
*/
|
||||
public double getStallCurrent() {
|
||||
return stallCurrent;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double stall_current = 3;</code>
|
||||
* @param value the stallCurrent to set
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor setStallCurrent(final double value) {
|
||||
bitField0_ |= 0x00000004;
|
||||
stallCurrent = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_current = 4;</code>
|
||||
* @return whether the freeCurrent field is set
|
||||
*/
|
||||
public boolean hasFreeCurrent() {
|
||||
return (bitField0_ & 0x00000008) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_current = 4;</code>
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor clearFreeCurrent() {
|
||||
bitField0_ &= ~0x00000008;
|
||||
freeCurrent = 0D;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_current = 4;</code>
|
||||
* @return the freeCurrent
|
||||
*/
|
||||
public double getFreeCurrent() {
|
||||
return freeCurrent;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_current = 4;</code>
|
||||
* @param value the freeCurrent to set
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor setFreeCurrent(final double value) {
|
||||
bitField0_ |= 0x00000008;
|
||||
freeCurrent = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_speed = 5;</code>
|
||||
* @return whether the freeSpeed field is set
|
||||
*/
|
||||
public boolean hasFreeSpeed() {
|
||||
return (bitField0_ & 0x00000010) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_speed = 5;</code>
|
||||
* @return this
|
||||
*/
|
||||
public ProtobufDCMotor clearFreeSpeed() {
|
||||
bitField0_ &= ~0x00000010;
|
||||
freeSpeed = 0D;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_speed = 5;</code>
|
||||
* @return the freeSpeed
|
||||
*/
|
||||
public double getFreeSpeed() {
|
||||
return freeSpeed;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional double free_speed = 5;</code>
|
||||
* @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<ProtobufDCMotor> getFactory() {
|
||||
return ProtobufDCMotorFactory.INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return this type's descriptor.
|
||||
*/
|
||||
public static Descriptors.Descriptor getDescriptor() {
|
||||
return System.wpi_proto_ProtobufDCMotor_descriptor;
|
||||
}
|
||||
|
||||
private enum ProtobufDCMotorFactory implements MessageFactory<ProtobufDCMotor> {
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Protobuf type {@code ProtobufLinearSystem}
|
||||
*/
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
// 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.
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#include "plant.npb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
static const uint8_t file_descriptor[] {
|
||||
0x0a,0x0b,0x70,0x6c,0x61,0x6e,0x74,0x2e,0x70,0x72,
|
||||
0x6f,0x74,0x6f,0x12,0x09,0x77,0x70,0x69,0x2e,0x70,
|
||||
0x72,0x6f,0x74,0x6f,0x22,0xc4,0x01,0x0a,0x0f,0x50,
|
||||
0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x44,0x43,0x4d,
|
||||
0x6f,0x74,0x6f,0x72,0x12,0x27,0x0a,0x0f,0x6e,0x6f,
|
||||
0x6d,0x69,0x6e,0x61,0x6c,0x5f,0x76,0x6f,0x6c,0x74,
|
||||
0x61,0x67,0x65,0x18,0x01,0x20,0x01,0x28,0x01,0x52,
|
||||
0x0e,0x6e,0x6f,0x6d,0x69,0x6e,0x61,0x6c,0x56,0x6f,
|
||||
0x6c,0x74,0x61,0x67,0x65,0x12,0x21,0x0a,0x0c,0x73,
|
||||
0x74,0x61,0x6c,0x6c,0x5f,0x74,0x6f,0x72,0x71,0x75,
|
||||
0x65,0x18,0x02,0x20,0x01,0x28,0x01,0x52,0x0b,0x73,
|
||||
0x74,0x61,0x6c,0x6c,0x54,0x6f,0x72,0x71,0x75,0x65,
|
||||
0x12,0x23,0x0a,0x0d,0x73,0x74,0x61,0x6c,0x6c,0x5f,
|
||||
0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x18,0x03,0x20,
|
||||
0x01,0x28,0x01,0x52,0x0c,0x73,0x74,0x61,0x6c,0x6c,
|
||||
0x43,0x75,0x72,0x72,0x65,0x6e,0x74,0x12,0x21,0x0a,
|
||||
0x0c,0x66,0x72,0x65,0x65,0x5f,0x63,0x75,0x72,0x72,
|
||||
0x65,0x6e,0x74,0x18,0x04,0x20,0x01,0x28,0x01,0x52,
|
||||
0x0b,0x66,0x72,0x65,0x65,0x43,0x75,0x72,0x72,0x65,
|
||||
0x6e,0x74,0x12,0x1d,0x0a,0x0a,0x66,0x72,0x65,0x65,
|
||||
0x5f,0x73,0x70,0x65,0x65,0x64,0x18,0x05,0x20,0x01,
|
||||
0x28,0x01,0x52,0x09,0x66,0x72,0x65,0x65,0x53,0x70,
|
||||
0x65,0x65,0x64,0x42,0x17,0x0a,0x15,0x6f,0x72,0x67,
|
||||
0x2e,0x77,0x70,0x69,0x6c,0x69,0x62,0x2e,0x6d,0x61,
|
||||
0x74,0x68,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x4a,0xdc,
|
||||
0x02,0x0a,0x06,0x12,0x04,0x00,0x00,0x0c,0x01,0x0a,
|
||||
0x08,0x0a,0x01,0x0c,0x12,0x03,0x00,0x00,0x12,0x0a,
|
||||
0x08,0x0a,0x01,0x02,0x12,0x03,0x02,0x00,0x12,0x0a,
|
||||
0x08,0x0a,0x01,0x08,0x12,0x03,0x04,0x00,0x2e,0x0a,
|
||||
0x09,0x0a,0x02,0x08,0x01,0x12,0x03,0x04,0x00,0x2e,
|
||||
0x0a,0x0a,0x0a,0x02,0x04,0x00,0x12,0x04,0x06,0x00,
|
||||
0x0c,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x00,0x01,0x12,
|
||||
0x03,0x06,0x08,0x17,0x0a,0x0b,0x0a,0x04,0x04,0x00,
|
||||
0x02,0x00,0x12,0x03,0x07,0x02,0x1d,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x00,0x05,0x12,0x03,0x07,0x02,
|
||||
0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,0x01,
|
||||
0x12,0x03,0x07,0x09,0x18,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x00,0x03,0x12,0x03,0x07,0x1b,0x1c,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x00,0x02,0x01,0x12,0x03,0x08,
|
||||
0x02,0x1a,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,
|
||||
0x05,0x12,0x03,0x08,0x02,0x08,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x01,0x01,0x12,0x03,0x08,0x09,0x15,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x03,0x12,
|
||||
0x03,0x08,0x18,0x19,0x0a,0x0b,0x0a,0x04,0x04,0x00,
|
||||
0x02,0x02,0x12,0x03,0x09,0x02,0x1b,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x02,0x05,0x12,0x03,0x09,0x02,
|
||||
0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,0x01,
|
||||
0x12,0x03,0x09,0x09,0x16,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x02,0x03,0x12,0x03,0x09,0x19,0x1a,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x00,0x02,0x03,0x12,0x03,0x0a,
|
||||
0x02,0x1a,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,
|
||||
0x05,0x12,0x03,0x0a,0x02,0x08,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x03,0x01,0x12,0x03,0x0a,0x09,0x15,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,0x03,0x12,
|
||||
0x03,0x0a,0x18,0x19,0x0a,0x0b,0x0a,0x04,0x04,0x00,
|
||||
0x02,0x04,0x12,0x03,0x0b,0x02,0x18,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x04,0x05,0x12,0x03,0x0b,0x02,
|
||||
0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x04,0x01,
|
||||
0x12,0x03,0x0b,0x09,0x13,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x04,0x03,0x12,0x03,0x0b,0x16,0x17,0x62,
|
||||
0x06,0x70,0x72,0x6f,0x74,0x6f,0x33,
|
||||
};
|
||||
static const char file_name[] = "plant.proto";
|
||||
static const char wpi_proto_ProtobufDCMotor_name[] = "wpi.proto.ProtobufDCMotor";
|
||||
std::string_view wpi_proto_ProtobufDCMotor::msg_name(void) noexcept { return wpi_proto_ProtobufDCMotor_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufDCMotor::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufDCMotor, wpi_proto_ProtobufDCMotor, AUTO)
|
||||
|
||||
|
||||
|
||||
#ifndef PB_CONVERT_DOUBLE_FLOAT
|
||||
/* On some platforms (such as AVR), double is really float.
|
||||
* To be able to encode/decode double on these platforms, you need.
|
||||
* to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line.
|
||||
*/
|
||||
PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
|
||||
#endif
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
// 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.
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#ifndef PB_WPI_PROTO_PLANT_NPB_H_INCLUDED
|
||||
#define PB_WPI_PROTO_PLANT_NPB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _wpi_proto_ProtobufDCMotor {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double nominal_voltage;
|
||||
double stall_torque;
|
||||
double stall_current;
|
||||
double free_current;
|
||||
double free_speed;
|
||||
} wpi_proto_ProtobufDCMotor;
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define wpi_proto_ProtobufDCMotor_init_default {0, 0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufDCMotor_init_zero {0, 0, 0, 0, 0}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define wpi_proto_ProtobufDCMotor_nominal_voltage_tag 1
|
||||
#define wpi_proto_ProtobufDCMotor_stall_torque_tag 2
|
||||
#define wpi_proto_ProtobufDCMotor_stall_current_tag 3
|
||||
#define wpi_proto_ProtobufDCMotor_free_current_tag 4
|
||||
#define wpi_proto_ProtobufDCMotor_free_speed_tag 5
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define wpi_proto_ProtobufDCMotor_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, nominal_voltage, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, stall_torque, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, stall_current, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, free_current, 4) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, free_speed, 5)
|
||||
#define wpi_proto_ProtobufDCMotor_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufDCMotor_DEFAULT NULL
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define WPI_PROTO_PLANT_NPB_H_MAX_SIZE wpi_proto_ProtobufDCMotor_size
|
||||
#define wpi_proto_ProtobufDCMotor_size 45
|
||||
|
||||
|
||||
#endif
|
||||
@@ -16,87 +16,143 @@ static const uint8_t file_descriptor[] {
|
||||
0x72,0x6f,0x74,0x6f,0x12,0x09,0x77,0x70,0x69,0x2e,
|
||||
0x70,0x72,0x6f,0x74,0x6f,0x1a,0x0d,0x77,0x70,0x69,
|
||||
0x6d,0x61,0x74,0x68,0x2e,0x70,0x72,0x6f,0x74,0x6f,
|
||||
0x22,0x99,0x02,0x0a,0x14,0x50,0x72,0x6f,0x74,0x6f,
|
||||
0x62,0x75,0x66,0x4c,0x69,0x6e,0x65,0x61,0x72,0x53,
|
||||
0x79,0x73,0x74,0x65,0x6d,0x12,0x1d,0x0a,0x0a,0x6e,
|
||||
0x75,0x6d,0x5f,0x73,0x74,0x61,0x74,0x65,0x73,0x18,
|
||||
0x01,0x20,0x01,0x28,0x0d,0x52,0x09,0x6e,0x75,0x6d,
|
||||
0x53,0x74,0x61,0x74,0x65,0x73,0x12,0x1d,0x0a,0x0a,
|
||||
0x6e,0x75,0x6d,0x5f,0x69,0x6e,0x70,0x75,0x74,0x73,
|
||||
0x18,0x02,0x20,0x01,0x28,0x0d,0x52,0x09,0x6e,0x75,
|
||||
0x6d,0x49,0x6e,0x70,0x75,0x74,0x73,0x12,0x1f,0x0a,
|
||||
0x0b,0x6e,0x75,0x6d,0x5f,0x6f,0x75,0x74,0x70,0x75,
|
||||
0x74,0x73,0x18,0x03,0x20,0x01,0x28,0x0d,0x52,0x0a,
|
||||
0x6e,0x75,0x6d,0x4f,0x75,0x74,0x70,0x75,0x74,0x73,
|
||||
0x12,0x27,0x0a,0x01,0x61,0x18,0x04,0x20,0x01,0x28,
|
||||
0x22,0xc4,0x01,0x0a,0x0f,0x50,0x72,0x6f,0x74,0x6f,
|
||||
0x62,0x75,0x66,0x44,0x43,0x4d,0x6f,0x74,0x6f,0x72,
|
||||
0x12,0x27,0x0a,0x0f,0x6e,0x6f,0x6d,0x69,0x6e,0x61,
|
||||
0x6c,0x5f,0x76,0x6f,0x6c,0x74,0x61,0x67,0x65,0x18,
|
||||
0x01,0x20,0x01,0x28,0x01,0x52,0x0e,0x6e,0x6f,0x6d,
|
||||
0x69,0x6e,0x61,0x6c,0x56,0x6f,0x6c,0x74,0x61,0x67,
|
||||
0x65,0x12,0x21,0x0a,0x0c,0x73,0x74,0x61,0x6c,0x6c,
|
||||
0x5f,0x74,0x6f,0x72,0x71,0x75,0x65,0x18,0x02,0x20,
|
||||
0x01,0x28,0x01,0x52,0x0b,0x73,0x74,0x61,0x6c,0x6c,
|
||||
0x54,0x6f,0x72,0x71,0x75,0x65,0x12,0x23,0x0a,0x0d,
|
||||
0x73,0x74,0x61,0x6c,0x6c,0x5f,0x63,0x75,0x72,0x72,
|
||||
0x65,0x6e,0x74,0x18,0x03,0x20,0x01,0x28,0x01,0x52,
|
||||
0x0c,0x73,0x74,0x61,0x6c,0x6c,0x43,0x75,0x72,0x72,
|
||||
0x65,0x6e,0x74,0x12,0x21,0x0a,0x0c,0x66,0x72,0x65,
|
||||
0x65,0x5f,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x18,
|
||||
0x04,0x20,0x01,0x28,0x01,0x52,0x0b,0x66,0x72,0x65,
|
||||
0x65,0x43,0x75,0x72,0x72,0x65,0x6e,0x74,0x12,0x1d,
|
||||
0x0a,0x0a,0x66,0x72,0x65,0x65,0x5f,0x73,0x70,0x65,
|
||||
0x65,0x64,0x18,0x05,0x20,0x01,0x28,0x01,0x52,0x09,
|
||||
0x66,0x72,0x65,0x65,0x53,0x70,0x65,0x65,0x64,0x22,
|
||||
0x99,0x02,0x0a,0x14,0x50,0x72,0x6f,0x74,0x6f,0x62,
|
||||
0x75,0x66,0x4c,0x69,0x6e,0x65,0x61,0x72,0x53,0x79,
|
||||
0x73,0x74,0x65,0x6d,0x12,0x1d,0x0a,0x0a,0x6e,0x75,
|
||||
0x6d,0x5f,0x73,0x74,0x61,0x74,0x65,0x73,0x18,0x01,
|
||||
0x20,0x01,0x28,0x0d,0x52,0x09,0x6e,0x75,0x6d,0x53,
|
||||
0x74,0x61,0x74,0x65,0x73,0x12,0x1d,0x0a,0x0a,0x6e,
|
||||
0x75,0x6d,0x5f,0x69,0x6e,0x70,0x75,0x74,0x73,0x18,
|
||||
0x02,0x20,0x01,0x28,0x0d,0x52,0x09,0x6e,0x75,0x6d,
|
||||
0x49,0x6e,0x70,0x75,0x74,0x73,0x12,0x1f,0x0a,0x0b,
|
||||
0x6e,0x75,0x6d,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,
|
||||
0x73,0x18,0x03,0x20,0x01,0x28,0x0d,0x52,0x0a,0x6e,
|
||||
0x75,0x6d,0x4f,0x75,0x74,0x70,0x75,0x74,0x73,0x12,
|
||||
0x27,0x0a,0x01,0x61,0x18,0x04,0x20,0x01,0x28,0x0b,
|
||||
0x32,0x19,0x2e,0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,
|
||||
0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,
|
||||
0x66,0x4d,0x61,0x74,0x72,0x69,0x78,0x52,0x01,0x61,
|
||||
0x12,0x27,0x0a,0x01,0x62,0x18,0x05,0x20,0x01,0x28,
|
||||
0x0b,0x32,0x19,0x2e,0x77,0x70,0x69,0x2e,0x70,0x72,
|
||||
0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,0x6f,0x62,
|
||||
0x75,0x66,0x4d,0x61,0x74,0x72,0x69,0x78,0x52,0x01,
|
||||
0x61,0x12,0x27,0x0a,0x01,0x62,0x18,0x05,0x20,0x01,
|
||||
0x62,0x12,0x27,0x0a,0x01,0x63,0x18,0x06,0x20,0x01,
|
||||
0x28,0x0b,0x32,0x19,0x2e,0x77,0x70,0x69,0x2e,0x70,
|
||||
0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,0x6f,
|
||||
0x62,0x75,0x66,0x4d,0x61,0x74,0x72,0x69,0x78,0x52,
|
||||
0x01,0x62,0x12,0x27,0x0a,0x01,0x63,0x18,0x06,0x20,
|
||||
0x01,0x63,0x12,0x27,0x0a,0x01,0x64,0x18,0x07,0x20,
|
||||
0x01,0x28,0x0b,0x32,0x19,0x2e,0x77,0x70,0x69,0x2e,
|
||||
0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,
|
||||
0x6f,0x62,0x75,0x66,0x4d,0x61,0x74,0x72,0x69,0x78,
|
||||
0x52,0x01,0x63,0x12,0x27,0x0a,0x01,0x64,0x18,0x07,
|
||||
0x20,0x01,0x28,0x0b,0x32,0x19,0x2e,0x77,0x70,0x69,
|
||||
0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,
|
||||
0x74,0x6f,0x62,0x75,0x66,0x4d,0x61,0x74,0x72,0x69,
|
||||
0x78,0x52,0x01,0x64,0x42,0x17,0x0a,0x15,0x6f,0x72,
|
||||
0x67,0x2e,0x77,0x70,0x69,0x6c,0x69,0x62,0x2e,0x6d,
|
||||
0x61,0x74,0x68,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x4a,
|
||||
0xd5,0x03,0x0a,0x06,0x12,0x04,0x00,0x00,0x10,0x01,
|
||||
0x0a,0x08,0x0a,0x01,0x0c,0x12,0x03,0x00,0x00,0x12,
|
||||
0x0a,0x08,0x0a,0x01,0x02,0x12,0x03,0x02,0x00,0x12,
|
||||
0x0a,0x09,0x0a,0x02,0x03,0x00,0x12,0x03,0x04,0x00,
|
||||
0x17,0x0a,0x08,0x0a,0x01,0x08,0x12,0x03,0x06,0x00,
|
||||
0x2e,0x0a,0x09,0x0a,0x02,0x08,0x01,0x12,0x03,0x06,
|
||||
0x00,0x2e,0x0a,0x0a,0x0a,0x02,0x04,0x00,0x12,0x04,
|
||||
0x08,0x00,0x10,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x00,
|
||||
0x01,0x12,0x03,0x08,0x08,0x1c,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x00,0x02,0x00,0x12,0x03,0x09,0x02,0x18,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,0x05,0x12,0x03,
|
||||
0x09,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x00,0x01,0x12,0x03,0x09,0x09,0x13,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x00,0x03,0x12,0x03,0x09,0x16,
|
||||
0x17,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x01,0x12,
|
||||
0x03,0x0a,0x02,0x18,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x01,0x05,0x12,0x03,0x0a,0x02,0x08,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x01,0x01,0x12,0x03,0x0a,
|
||||
0x09,0x13,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,
|
||||
0x03,0x12,0x03,0x0a,0x16,0x17,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x00,0x02,0x02,0x12,0x03,0x0b,0x02,0x19,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,0x05,0x12,0x03,
|
||||
0x0b,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x02,0x01,0x12,0x03,0x0b,0x09,0x14,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x02,0x03,0x12,0x03,0x0b,0x17,
|
||||
0x18,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x03,0x12,
|
||||
0x03,0x0c,0x02,0x17,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x03,0x06,0x12,0x03,0x0c,0x02,0x10,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x03,0x01,0x12,0x03,0x0c,
|
||||
0x11,0x12,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,
|
||||
0x03,0x12,0x03,0x0c,0x15,0x16,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x00,0x02,0x04,0x12,0x03,0x0d,0x02,0x17,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x04,0x06,0x12,0x03,
|
||||
0x0d,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x04,0x01,0x12,0x03,0x0d,0x11,0x12,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x04,0x03,0x12,0x03,0x0d,0x15,
|
||||
0x16,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x05,0x12,
|
||||
0x03,0x0e,0x02,0x17,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x05,0x06,0x12,0x03,0x0e,0x02,0x10,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x05,0x01,0x12,0x03,0x0e,
|
||||
0x11,0x12,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x05,
|
||||
0x03,0x12,0x03,0x0e,0x15,0x16,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x00,0x02,0x06,0x12,0x03,0x0f,0x02,0x17,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x06,0x06,0x12,0x03,
|
||||
0x0f,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x06,0x01,0x12,0x03,0x0f,0x11,0x12,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x06,0x03,0x12,0x03,0x0f,0x15,
|
||||
0x16,0x62,0x06,0x70,0x72,0x6f,0x74,0x6f,0x33,
|
||||
0x52,0x01,0x64,0x42,0x17,0x0a,0x15,0x6f,0x72,0x67,
|
||||
0x2e,0x77,0x70,0x69,0x6c,0x69,0x62,0x2e,0x6d,0x61,
|
||||
0x74,0x68,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x4a,0x80,
|
||||
0x06,0x0a,0x06,0x12,0x04,0x00,0x00,0x18,0x01,0x0a,
|
||||
0x08,0x0a,0x01,0x0c,0x12,0x03,0x00,0x00,0x12,0x0a,
|
||||
0x08,0x0a,0x01,0x02,0x12,0x03,0x02,0x00,0x12,0x0a,
|
||||
0x09,0x0a,0x02,0x03,0x00,0x12,0x03,0x04,0x00,0x17,
|
||||
0x0a,0x08,0x0a,0x01,0x08,0x12,0x03,0x06,0x00,0x2e,
|
||||
0x0a,0x09,0x0a,0x02,0x08,0x01,0x12,0x03,0x06,0x00,
|
||||
0x2e,0x0a,0x0a,0x0a,0x02,0x04,0x00,0x12,0x04,0x08,
|
||||
0x00,0x0e,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x00,0x01,
|
||||
0x12,0x03,0x08,0x08,0x17,0x0a,0x0b,0x0a,0x04,0x04,
|
||||
0x00,0x02,0x00,0x12,0x03,0x09,0x02,0x1d,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x00,0x05,0x12,0x03,0x09,
|
||||
0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,
|
||||
0x01,0x12,0x03,0x09,0x09,0x18,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x00,0x03,0x12,0x03,0x09,0x1b,0x1c,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x01,0x12,0x03,
|
||||
0x0a,0x02,0x1a,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x01,0x05,0x12,0x03,0x0a,0x02,0x08,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x01,0x01,0x12,0x03,0x0a,0x09,
|
||||
0x15,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x03,
|
||||
0x12,0x03,0x0a,0x18,0x19,0x0a,0x0b,0x0a,0x04,0x04,
|
||||
0x00,0x02,0x02,0x12,0x03,0x0b,0x02,0x1b,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x02,0x05,0x12,0x03,0x0b,
|
||||
0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,
|
||||
0x01,0x12,0x03,0x0b,0x09,0x16,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x02,0x03,0x12,0x03,0x0b,0x19,0x1a,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x03,0x12,0x03,
|
||||
0x0c,0x02,0x1a,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x03,0x05,0x12,0x03,0x0c,0x02,0x08,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x03,0x01,0x12,0x03,0x0c,0x09,
|
||||
0x15,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,0x03,
|
||||
0x12,0x03,0x0c,0x18,0x19,0x0a,0x0b,0x0a,0x04,0x04,
|
||||
0x00,0x02,0x04,0x12,0x03,0x0d,0x02,0x18,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x04,0x05,0x12,0x03,0x0d,
|
||||
0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x04,
|
||||
0x01,0x12,0x03,0x0d,0x09,0x13,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x04,0x03,0x12,0x03,0x0d,0x16,0x17,
|
||||
0x0a,0x0a,0x0a,0x02,0x04,0x01,0x12,0x04,0x10,0x00,
|
||||
0x18,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x01,0x01,0x12,
|
||||
0x03,0x10,0x08,0x1c,0x0a,0x0b,0x0a,0x04,0x04,0x01,
|
||||
0x02,0x00,0x12,0x03,0x11,0x02,0x18,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x01,0x02,0x00,0x05,0x12,0x03,0x11,0x02,
|
||||
0x08,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x00,0x01,
|
||||
0x12,0x03,0x11,0x09,0x13,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x01,0x02,0x00,0x03,0x12,0x03,0x11,0x16,0x17,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x01,0x02,0x01,0x12,0x03,0x12,
|
||||
0x02,0x18,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x01,
|
||||
0x05,0x12,0x03,0x12,0x02,0x08,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x01,0x02,0x01,0x01,0x12,0x03,0x12,0x09,0x13,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x01,0x03,0x12,
|
||||
0x03,0x12,0x16,0x17,0x0a,0x0b,0x0a,0x04,0x04,0x01,
|
||||
0x02,0x02,0x12,0x03,0x13,0x02,0x19,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x01,0x02,0x02,0x05,0x12,0x03,0x13,0x02,
|
||||
0x08,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x02,0x01,
|
||||
0x12,0x03,0x13,0x09,0x14,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x01,0x02,0x02,0x03,0x12,0x03,0x13,0x17,0x18,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x01,0x02,0x03,0x12,0x03,0x14,
|
||||
0x02,0x17,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x03,
|
||||
0x06,0x12,0x03,0x14,0x02,0x10,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x01,0x02,0x03,0x01,0x12,0x03,0x14,0x11,0x12,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x03,0x03,0x12,
|
||||
0x03,0x14,0x15,0x16,0x0a,0x0b,0x0a,0x04,0x04,0x01,
|
||||
0x02,0x04,0x12,0x03,0x15,0x02,0x17,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x01,0x02,0x04,0x06,0x12,0x03,0x15,0x02,
|
||||
0x10,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x04,0x01,
|
||||
0x12,0x03,0x15,0x11,0x12,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x01,0x02,0x04,0x03,0x12,0x03,0x15,0x15,0x16,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x01,0x02,0x05,0x12,0x03,0x16,
|
||||
0x02,0x17,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x05,
|
||||
0x06,0x12,0x03,0x16,0x02,0x10,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x01,0x02,0x05,0x01,0x12,0x03,0x16,0x11,0x12,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x05,0x03,0x12,
|
||||
0x03,0x16,0x15,0x16,0x0a,0x0b,0x0a,0x04,0x04,0x01,
|
||||
0x02,0x06,0x12,0x03,0x17,0x02,0x17,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x01,0x02,0x06,0x06,0x12,0x03,0x17,0x02,
|
||||
0x10,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x06,0x01,
|
||||
0x12,0x03,0x17,0x11,0x12,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x01,0x02,0x06,0x03,0x12,0x03,0x17,0x15,0x16,0x62,
|
||||
0x06,0x70,0x72,0x6f,0x74,0x6f,0x33,
|
||||
};
|
||||
static const char file_name[] = "system.proto";
|
||||
static const char wpi_proto_ProtobufDCMotor_name[] = "wpi.proto.ProtobufDCMotor";
|
||||
std::string_view wpi_proto_ProtobufDCMotor::msg_name(void) noexcept { return wpi_proto_ProtobufDCMotor_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufDCMotor::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufDCMotor, wpi_proto_ProtobufDCMotor, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufLinearSystem_name[] = "wpi.proto.ProtobufLinearSystem";
|
||||
std::string_view wpi_proto_ProtobufLinearSystem::msg_name(void) noexcept { return wpi_proto_ProtobufLinearSystem_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufLinearSystem::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
@@ -104,3 +160,11 @@ PB_BIND(wpi_proto_ProtobufLinearSystem, wpi_proto_ProtobufLinearSystem, AUTO)
|
||||
|
||||
|
||||
|
||||
#ifndef PB_CONVERT_DOUBLE_FLOAT
|
||||
/* On some platforms (such as AVR), double is really float.
|
||||
* To be able to encode/decode double on these platforms, you need.
|
||||
* to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line.
|
||||
*/
|
||||
PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -16,6 +16,18 @@
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _wpi_proto_ProtobufDCMotor {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double nominal_voltage;
|
||||
double stall_torque;
|
||||
double stall_current;
|
||||
double free_current;
|
||||
double free_speed;
|
||||
} wpi_proto_ProtobufDCMotor;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufLinearSystem {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
@@ -32,10 +44,17 @@ typedef struct _wpi_proto_ProtobufLinearSystem {
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define wpi_proto_ProtobufDCMotor_init_default {0, 0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufLinearSystem_init_default {0, 0, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufDCMotor_init_zero {0, 0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufLinearSystem_init_zero {0, 0, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define wpi_proto_ProtobufDCMotor_nominal_voltage_tag 1
|
||||
#define wpi_proto_ProtobufDCMotor_stall_torque_tag 2
|
||||
#define wpi_proto_ProtobufDCMotor_stall_current_tag 3
|
||||
#define wpi_proto_ProtobufDCMotor_free_current_tag 4
|
||||
#define wpi_proto_ProtobufDCMotor_free_speed_tag 5
|
||||
#define wpi_proto_ProtobufLinearSystem_num_states_tag 1
|
||||
#define wpi_proto_ProtobufLinearSystem_num_inputs_tag 2
|
||||
#define wpi_proto_ProtobufLinearSystem_num_outputs_tag 3
|
||||
@@ -45,6 +64,15 @@ typedef struct _wpi_proto_ProtobufLinearSystem {
|
||||
#define wpi_proto_ProtobufLinearSystem_d_tag 7
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define wpi_proto_ProtobufDCMotor_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, nominal_voltage, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, stall_torque, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, stall_current, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, free_current, 4) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, free_speed, 5)
|
||||
#define wpi_proto_ProtobufDCMotor_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufDCMotor_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufLinearSystem_FIELDLIST(X, a_) \
|
||||
X(a_, STATIC, SINGULAR, UINT32, num_states, 1) \
|
||||
X(a_, STATIC, SINGULAR, UINT32, num_inputs, 2) \
|
||||
@@ -62,6 +90,8 @@ X(a_, CALLBACK, OPTIONAL, MESSAGE, d, 7)
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
/* wpi_proto_ProtobufLinearSystem_size depends on runtime parameters */
|
||||
#define WPI_PROTO_SYSTEM_NPB_H_MAX_SIZE wpi_proto_ProtobufDCMotor_size
|
||||
#define wpi_proto_ProtobufDCMotor_size 45
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user