Files
allwpilib/simulation/JavaGazebo/src/main/java/gazebo/msgs/GzString.java

529 lines
17 KiB
Java
Raw Normal View History

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
2014-06-12 11:02:26 -07:00
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: gz_string.proto
package gazebo.msgs;
public final class GzString {
private GzString() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface StringOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required string data = 1;
/**
* <code>required string data = 1;</code>
*/
boolean hasData();
/**
* <code>required string data = 1;</code>
*/
java.lang.String getData();
/**
* <code>required string data = 1;</code>
*/
com.google.protobuf.ByteString
getDataBytes();
}
/**
* Protobuf type {@code gazebo.msgs.String}
*/
public static final class String extends
com.google.protobuf.GeneratedMessage
implements StringOrBuilder {
// Use String.newBuilder() to construct.
private String(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private String(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final String defaultInstance;
public static String getDefaultInstance() {
return defaultInstance;
}
public String getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private String(
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;
data_ = input.readBytes();
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.GzString.internal_static_gazebo_msgs_String_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzString.internal_static_gazebo_msgs_String_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzString.String.class, gazebo.msgs.GzString.String.Builder.class);
}
public static com.google.protobuf.Parser<String> PARSER =
new com.google.protobuf.AbstractParser<String>() {
public String parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new String(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<String> getParserForType() {
return PARSER;
}
private int bitField0_;
// required string data = 1;
public static final int DATA_FIELD_NUMBER = 1;
private java.lang.Object data_;
/**
* <code>required string data = 1;</code>
*/
public boolean hasData() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string data = 1;</code>
*/
public java.lang.String getData() {
java.lang.Object ref = data_;
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()) {
data_ = s;
}
return s;
}
}
/**
* <code>required string data = 1;</code>
*/
public com.google.protobuf.ByteString
getDataBytes() {
java.lang.Object ref = data_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
data_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private void initFields() {
data_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasData()) {
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, getDataBytes());
}
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, getDataBytes());
}
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.GzString.String parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzString.String 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.GzString.String parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzString.String parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gazebo.msgs.GzString.String parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzString.String parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzString.String parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static gazebo.msgs.GzString.String parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzString.String parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzString.String 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.GzString.String 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.String}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements gazebo.msgs.GzString.StringOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.GzString.internal_static_gazebo_msgs_String_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzString.internal_static_gazebo_msgs_String_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzString.String.class, gazebo.msgs.GzString.String.Builder.class);
}
// Construct using gazebo.msgs.GzString.String.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();
data_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return gazebo.msgs.GzString.internal_static_gazebo_msgs_String_descriptor;
}
public gazebo.msgs.GzString.String getDefaultInstanceForType() {
return gazebo.msgs.GzString.String.getDefaultInstance();
}
public gazebo.msgs.GzString.String build() {
gazebo.msgs.GzString.String result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public gazebo.msgs.GzString.String buildPartial() {
gazebo.msgs.GzString.String result = new gazebo.msgs.GzString.String(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.data_ = data_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof gazebo.msgs.GzString.String) {
return mergeFrom((gazebo.msgs.GzString.String)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(gazebo.msgs.GzString.String other) {
if (other == gazebo.msgs.GzString.String.getDefaultInstance()) return this;
if (other.hasData()) {
bitField0_ |= 0x00000001;
data_ = other.data_;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasData()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
gazebo.msgs.GzString.String parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (gazebo.msgs.GzString.String) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required string data = 1;
private java.lang.Object data_ = "";
/**
* <code>required string data = 1;</code>
*/
public boolean hasData() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required string data = 1;</code>
*/
public java.lang.String getData() {
java.lang.Object ref = data_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
data_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string data = 1;</code>
*/
public com.google.protobuf.ByteString
getDataBytes() {
java.lang.Object ref = data_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
data_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string data = 1;</code>
*/
public Builder setData(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
data_ = value;
onChanged();
return this;
}
/**
* <code>required string data = 1;</code>
*/
public Builder clearData() {
bitField0_ = (bitField0_ & ~0x00000001);
data_ = getDefaultInstance().getData();
onChanged();
return this;
}
/**
* <code>required string data = 1;</code>
*/
public Builder setDataBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
data_ = value;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:gazebo.msgs.String)
}
static {
defaultInstance = new String(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:gazebo.msgs.String)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_gazebo_msgs_String_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_gazebo_msgs_String_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\017gz_string.proto\022\013gazebo.msgs\"\026\n\006String" +
"\022\014\n\004data\030\001 \002(\t"
};
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_String_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_gazebo_msgs_String_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_gazebo_msgs_String_descriptor,
new java.lang.String[] { "Data", });
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}