mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Initial commit of the WPILib simulation support in an alpha quality state.
Fixes to deal with the switch to .hpp files in the HAL and other misc problems due to rebasing. Added Omar's changes to the compressor interface Fixes to make C++ plugin compile on linux. Added import of the WPILibSim code from the graduate class. It shows up as wpilibJavaSim to follow the convention set by wpilibJava, wpilibJavaJNI and wpilibJavaFinal. Fixed wpilibJavaSim artifactId to mirror the new convention. Modified the build of the java plugin to pull in the simulation dependencies. Added stacktrace printing. Fixed support for creating projects. Added support for the isReal() and isSimulation() methods along with the AnalogPotentiometer object to support simulating GearsBot. Added support for a "WPILib Simulate" button. Added GearsBot to the built in examples. Added support for specifying the world file during project creation and switched the default from BluntObjectBot to GearsBot. Removed unused import. Added file browser for world files. Added support for debugging in simulation. Change simulate icon to be a Gazebo icon. Switched over to the gazebo messaging system. Updated location of default world file. Reverted cmake change. Fixed bug in WPILibJSim, added better logging and cleaned up code. Made the frc_gazebo_plugin build using raw cmake instead of catkin, breaking the final ROS dependencies. Added installation to frc_gazebo_plugin Makefile. Fixed running of simulation to actually use frcsim. Initial commit of simulation library for C++. Has the minimal subset of features necessary for having a Simple Robot run in teleoperated mode. Added notes for generating protobuf messages. Import of the debuild process into the main repository. Moved frc_gazebo_plugin under simulation and removed the gazebo folder. Updated the gazebo plugin to remove excessive printing and limit motor signal to [-1,1]. Updated WPILibJSim to support latching messages and to sleep for 20ms in iterative robot. Reduced delay between starting frcsim and the users program to 1 second. Updated GearsBot example. Fixed a few minor issues for demoable state. Added simulator support for Victors, Jaguars and Talons. Added NetworkTables, SmartDashboard and LiveWindow to the simulator. Added AnalogPotentiometer for simulation. Added support for simulating encoders. Added simulation support for Gyro. Added IterativeRobot, Fixed Timers, Notifiers, PIDControllers and other minor fixes + cleanup. Added RobotDrive support to simulation. Separated out JavaGazebo so that SimDS will be able to reuse it. Separated out SimDS into its own application.. Fixes so that the SimDS is distributed and runs properly for Java with the eclipse plugins. Added DriverStation support to WPILibCSim Cleanup of DriverStation, WaitUntilCommand and AnalogPotentiometer for WPILibCSim. Cleanup of includes for WPILibCSim Added AnalogPotentiometer to the real WPILibC. Added AnalogPotentiometer to the real WPILibC. Added GearsBot example to C++ eclipse plugin. WPILibCSim fixes to work with launching from the plugin. Package libwpilibsim in a deb file. Added includes to plugin distribution. Added support for external-limit-switches to Gazebo, Java and C++. Added support for Gazebo Rangefinders and Analog channels to read their values in C++ and Java. Added support for internal limit switches. Updated GearsBot programs to use limit switches + range finders. Added disabling of motors when robot is disabled to more closely mimic the real robot. Fixes to deal with the switch to .hpp files in the HAL and other misc problems due to rebasing. Change-Id: I624c5f4d0f28282616a7c92083575bf68adcdce2
This commit is contained in:
committed by
thomasclark
parent
d5a509c7e7
commit
cb56c9a144
947
simulation/JavaGazebo/src/main/java/gazebo/msgs/GzPublish.java
Normal file
947
simulation/JavaGazebo/src/main/java/gazebo/msgs/GzPublish.java
Normal file
@@ -0,0 +1,947 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: gazebo/src/msgs/publish.proto
|
||||
|
||||
package gazebo.msgs;
|
||||
|
||||
public final class GzPublish {
|
||||
private GzPublish() {}
|
||||
public static void registerAllExtensions(
|
||||
com.google.protobuf.ExtensionRegistry registry) {
|
||||
}
|
||||
public interface PublishOrBuilder
|
||||
extends com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
// required string topic = 1;
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
boolean hasTopic();
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
java.lang.String getTopic();
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getTopicBytes();
|
||||
|
||||
// required string msg_type = 2;
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
boolean hasMsgType();
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
java.lang.String getMsgType();
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getMsgTypeBytes();
|
||||
|
||||
// required string host = 3;
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
boolean hasHost();
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
java.lang.String getHost();
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
com.google.protobuf.ByteString
|
||||
getHostBytes();
|
||||
|
||||
// required uint32 port = 4;
|
||||
/**
|
||||
* <code>required uint32 port = 4;</code>
|
||||
*/
|
||||
boolean hasPort();
|
||||
/**
|
||||
* <code>required uint32 port = 4;</code>
|
||||
*/
|
||||
int getPort();
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code gazebo.msgs.Publish}
|
||||
*/
|
||||
public static final class Publish extends
|
||||
com.google.protobuf.GeneratedMessage
|
||||
implements PublishOrBuilder {
|
||||
// Use Publish.newBuilder() to construct.
|
||||
private Publish(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
|
||||
super(builder);
|
||||
this.unknownFields = builder.getUnknownFields();
|
||||
}
|
||||
private Publish(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
|
||||
|
||||
private static final Publish defaultInstance;
|
||||
public static Publish getDefaultInstance() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
public Publish getDefaultInstanceForType() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
private final com.google.protobuf.UnknownFieldSet unknownFields;
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private Publish(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
initFields();
|
||||
int mutable_bitField0_ = 0;
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
default: {
|
||||
if (!parseUnknownField(input, unknownFields,
|
||||
extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
bitField0_ |= 0x00000001;
|
||||
topic_ = input.readBytes();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
bitField0_ |= 0x00000002;
|
||||
msgType_ = input.readBytes();
|
||||
break;
|
||||
}
|
||||
case 26: {
|
||||
bitField0_ |= 0x00000004;
|
||||
host_ = input.readBytes();
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
bitField0_ |= 0x00000008;
|
||||
port_ = input.readUInt32();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
e.getMessage()).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
this.unknownFields = unknownFields.build();
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return gazebo.msgs.GzPublish.internal_static_gazebo_msgs_Publish_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return gazebo.msgs.GzPublish.internal_static_gazebo_msgs_Publish_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
gazebo.msgs.GzPublish.Publish.class, gazebo.msgs.GzPublish.Publish.Builder.class);
|
||||
}
|
||||
|
||||
public static com.google.protobuf.Parser<Publish> PARSER =
|
||||
new com.google.protobuf.AbstractParser<Publish>() {
|
||||
public Publish parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return new Publish(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<Publish> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
// required string topic = 1;
|
||||
public static final int TOPIC_FIELD_NUMBER = 1;
|
||||
private java.lang.Object topic_;
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
public boolean hasTopic() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
public java.lang.String getTopic() {
|
||||
java.lang.Object ref = topic_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
if (bs.isValidUtf8()) {
|
||||
topic_ = s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getTopicBytes() {
|
||||
java.lang.Object ref = topic_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
topic_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
// required string msg_type = 2;
|
||||
public static final int MSG_TYPE_FIELD_NUMBER = 2;
|
||||
private java.lang.Object msgType_;
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
public boolean hasMsgType() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
public java.lang.String getMsgType() {
|
||||
java.lang.Object ref = msgType_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
if (bs.isValidUtf8()) {
|
||||
msgType_ = s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getMsgTypeBytes() {
|
||||
java.lang.Object ref = msgType_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
msgType_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
// required string host = 3;
|
||||
public static final int HOST_FIELD_NUMBER = 3;
|
||||
private java.lang.Object host_;
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
public boolean hasHost() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
public java.lang.String getHost() {
|
||||
java.lang.Object ref = host_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
return (java.lang.String) ref;
|
||||
} else {
|
||||
com.google.protobuf.ByteString bs =
|
||||
(com.google.protobuf.ByteString) ref;
|
||||
java.lang.String s = bs.toStringUtf8();
|
||||
if (bs.isValidUtf8()) {
|
||||
host_ = s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getHostBytes() {
|
||||
java.lang.Object ref = host_;
|
||||
if (ref instanceof java.lang.String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
host_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
|
||||
// required uint32 port = 4;
|
||||
public static final int PORT_FIELD_NUMBER = 4;
|
||||
private int port_;
|
||||
/**
|
||||
* <code>required uint32 port = 4;</code>
|
||||
*/
|
||||
public boolean hasPort() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>required uint32 port = 4;</code>
|
||||
*/
|
||||
public int getPort() {
|
||||
return port_;
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
topic_ = "";
|
||||
msgType_ = "";
|
||||
host_ = "";
|
||||
port_ = 0;
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized != -1) return isInitialized == 1;
|
||||
|
||||
if (!hasTopic()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasMsgType()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasHost()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasPort()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
output.writeBytes(1, getTopicBytes());
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
output.writeBytes(2, getMsgTypeBytes());
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
output.writeBytes(3, getHostBytes());
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
output.writeUInt32(4, port_);
|
||||
}
|
||||
getUnknownFields().writeTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeBytesSize(1, getTopicBytes());
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeBytesSize(2, getMsgTypeBytes());
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeBytesSize(3, getHostBytes());
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeUInt32Size(4, port_);
|
||||
}
|
||||
size += getUnknownFields().getSerializedSize();
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
@java.lang.Override
|
||||
protected java.lang.Object writeReplace()
|
||||
throws java.io.ObjectStreamException {
|
||||
return super.writeReplace();
|
||||
}
|
||||
|
||||
public static gazebo.msgs.GzPublish.Publish parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static gazebo.msgs.GzPublish.Publish parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static gazebo.msgs.GzPublish.Publish parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static gazebo.msgs.GzPublish.Publish parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static gazebo.msgs.GzPublish.Publish parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static gazebo.msgs.GzPublish.Publish parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
public static gazebo.msgs.GzPublish.Publish parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input);
|
||||
}
|
||||
public static gazebo.msgs.GzPublish.Publish parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input, extensionRegistry);
|
||||
}
|
||||
public static gazebo.msgs.GzPublish.Publish parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static gazebo.msgs.GzPublish.Publish parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
|
||||
public static Builder newBuilder() { return Builder.create(); }
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder(gazebo.msgs.GzPublish.Publish prototype) {
|
||||
return newBuilder().mergeFrom(prototype);
|
||||
}
|
||||
public Builder toBuilder() { return newBuilder(this); }
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code gazebo.msgs.Publish}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessage.Builder<Builder>
|
||||
implements gazebo.msgs.GzPublish.PublishOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return gazebo.msgs.GzPublish.internal_static_gazebo_msgs_Publish_descriptor;
|
||||
}
|
||||
|
||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return gazebo.msgs.GzPublish.internal_static_gazebo_msgs_Publish_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
gazebo.msgs.GzPublish.Publish.class, gazebo.msgs.GzPublish.Publish.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using gazebo.msgs.GzPublish.Publish.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
|
||||
}
|
||||
}
|
||||
private static Builder create() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
topic_ = "";
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
msgType_ = "";
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
host_ = "";
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
port_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clone() {
|
||||
return create().mergeFrom(buildPartial());
|
||||
}
|
||||
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return gazebo.msgs.GzPublish.internal_static_gazebo_msgs_Publish_descriptor;
|
||||
}
|
||||
|
||||
public gazebo.msgs.GzPublish.Publish getDefaultInstanceForType() {
|
||||
return gazebo.msgs.GzPublish.Publish.getDefaultInstance();
|
||||
}
|
||||
|
||||
public gazebo.msgs.GzPublish.Publish build() {
|
||||
gazebo.msgs.GzPublish.Publish result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public gazebo.msgs.GzPublish.Publish buildPartial() {
|
||||
gazebo.msgs.GzPublish.Publish result = new gazebo.msgs.GzPublish.Publish(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
int to_bitField0_ = 0;
|
||||
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
to_bitField0_ |= 0x00000001;
|
||||
}
|
||||
result.topic_ = topic_;
|
||||
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
to_bitField0_ |= 0x00000002;
|
||||
}
|
||||
result.msgType_ = msgType_;
|
||||
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
to_bitField0_ |= 0x00000004;
|
||||
}
|
||||
result.host_ = host_;
|
||||
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
to_bitField0_ |= 0x00000008;
|
||||
}
|
||||
result.port_ = port_;
|
||||
result.bitField0_ = to_bitField0_;
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof gazebo.msgs.GzPublish.Publish) {
|
||||
return mergeFrom((gazebo.msgs.GzPublish.Publish)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(gazebo.msgs.GzPublish.Publish other) {
|
||||
if (other == gazebo.msgs.GzPublish.Publish.getDefaultInstance()) return this;
|
||||
if (other.hasTopic()) {
|
||||
bitField0_ |= 0x00000001;
|
||||
topic_ = other.topic_;
|
||||
onChanged();
|
||||
}
|
||||
if (other.hasMsgType()) {
|
||||
bitField0_ |= 0x00000002;
|
||||
msgType_ = other.msgType_;
|
||||
onChanged();
|
||||
}
|
||||
if (other.hasHost()) {
|
||||
bitField0_ |= 0x00000004;
|
||||
host_ = other.host_;
|
||||
onChanged();
|
||||
}
|
||||
if (other.hasPort()) {
|
||||
setPort(other.getPort());
|
||||
}
|
||||
this.mergeUnknownFields(other.getUnknownFields());
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
if (!hasTopic()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasMsgType()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasHost()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasPort()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
gazebo.msgs.GzPublish.Publish parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (gazebo.msgs.GzPublish.Publish) e.getUnfinishedMessage();
|
||||
throw e;
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
// required string topic = 1;
|
||||
private java.lang.Object topic_ = "";
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
public boolean hasTopic() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
public java.lang.String getTopic() {
|
||||
java.lang.Object ref = topic_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
java.lang.String s = ((com.google.protobuf.ByteString) ref)
|
||||
.toStringUtf8();
|
||||
topic_ = s;
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getTopicBytes() {
|
||||
java.lang.Object ref = topic_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
topic_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
public Builder setTopic(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
bitField0_ |= 0x00000001;
|
||||
topic_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
public Builder clearTopic() {
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
topic_ = getDefaultInstance().getTopic();
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required string topic = 1;</code>
|
||||
*/
|
||||
public Builder setTopicBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
bitField0_ |= 0x00000001;
|
||||
topic_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
// required string msg_type = 2;
|
||||
private java.lang.Object msgType_ = "";
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
public boolean hasMsgType() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
public java.lang.String getMsgType() {
|
||||
java.lang.Object ref = msgType_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
java.lang.String s = ((com.google.protobuf.ByteString) ref)
|
||||
.toStringUtf8();
|
||||
msgType_ = s;
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getMsgTypeBytes() {
|
||||
java.lang.Object ref = msgType_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
msgType_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
public Builder setMsgType(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
bitField0_ |= 0x00000002;
|
||||
msgType_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
public Builder clearMsgType() {
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
msgType_ = getDefaultInstance().getMsgType();
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required string msg_type = 2;</code>
|
||||
*/
|
||||
public Builder setMsgTypeBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
bitField0_ |= 0x00000002;
|
||||
msgType_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
// required string host = 3;
|
||||
private java.lang.Object host_ = "";
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
public boolean hasHost() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
public java.lang.String getHost() {
|
||||
java.lang.Object ref = host_;
|
||||
if (!(ref instanceof java.lang.String)) {
|
||||
java.lang.String s = ((com.google.protobuf.ByteString) ref)
|
||||
.toStringUtf8();
|
||||
host_ = s;
|
||||
return s;
|
||||
} else {
|
||||
return (java.lang.String) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
public com.google.protobuf.ByteString
|
||||
getHostBytes() {
|
||||
java.lang.Object ref = host_;
|
||||
if (ref instanceof String) {
|
||||
com.google.protobuf.ByteString b =
|
||||
com.google.protobuf.ByteString.copyFromUtf8(
|
||||
(java.lang.String) ref);
|
||||
host_ = b;
|
||||
return b;
|
||||
} else {
|
||||
return (com.google.protobuf.ByteString) ref;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
public Builder setHost(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
bitField0_ |= 0x00000004;
|
||||
host_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
public Builder clearHost() {
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
host_ = getDefaultInstance().getHost();
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required string host = 3;</code>
|
||||
*/
|
||||
public Builder setHostBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
bitField0_ |= 0x00000004;
|
||||
host_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
// required uint32 port = 4;
|
||||
private int port_ ;
|
||||
/**
|
||||
* <code>required uint32 port = 4;</code>
|
||||
*/
|
||||
public boolean hasPort() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>required uint32 port = 4;</code>
|
||||
*/
|
||||
public int getPort() {
|
||||
return port_;
|
||||
}
|
||||
/**
|
||||
* <code>required uint32 port = 4;</code>
|
||||
*/
|
||||
public Builder setPort(int value) {
|
||||
bitField0_ |= 0x00000008;
|
||||
port_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required uint32 port = 4;</code>
|
||||
*/
|
||||
public Builder clearPort() {
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
port_ = 0;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:gazebo.msgs.Publish)
|
||||
}
|
||||
|
||||
static {
|
||||
defaultInstance = new Publish(true);
|
||||
defaultInstance.initFields();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:gazebo.msgs.Publish)
|
||||
}
|
||||
|
||||
private static com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_gazebo_msgs_Publish_descriptor;
|
||||
private static
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||
internal_static_gazebo_msgs_Publish_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
return descriptor;
|
||||
}
|
||||
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||
descriptor;
|
||||
static {
|
||||
java.lang.String[] descriptorData = {
|
||||
"\n\035gazebo/src/msgs/publish.proto\022\013gazebo." +
|
||||
"msgs\"F\n\007Publish\022\r\n\005topic\030\001 \002(\t\022\020\n\010msg_ty" +
|
||||
"pe\030\002 \002(\t\022\014\n\004host\030\003 \002(\t\022\014\n\004port\030\004 \002(\rB\013B\t" +
|
||||
"GzPublish"
|
||||
};
|
||||
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
||||
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
|
||||
public com.google.protobuf.ExtensionRegistry assignDescriptors(
|
||||
com.google.protobuf.Descriptors.FileDescriptor root) {
|
||||
descriptor = root;
|
||||
internal_static_gazebo_msgs_Publish_descriptor =
|
||||
getDescriptor().getMessageTypes().get(0);
|
||||
internal_static_gazebo_msgs_Publish_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_gazebo_msgs_Publish_descriptor,
|
||||
new java.lang.String[] { "Topic", "MsgType", "Host", "Port", });
|
||||
return null;
|
||||
}
|
||||
};
|
||||
com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||
}, assigner);
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(outer_class_scope)
|
||||
}
|
||||
Reference in New Issue
Block a user