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:
Alex Henning
2014-06-12 11:02:26 -07:00
committed by thomasclark
parent d5a509c7e7
commit cb56c9a144
425 changed files with 38450 additions and 335 deletions

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.gazebosim</groupId>
<artifactId>JavaGazebo</artifactId>
<packaging>jar</packaging>
<version>0.1.0-SNAPSHOT</version>
<profiles>
<profile>
<id>docline-java8-disable</id>
<activation>
<jdk>[1.8,</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>2.5.0</version>
</dependency>
<!-- TODO: Add unit tests -->
<!-- <dependency> -->
<!-- <groupId>junit</groupId> -->
<!-- <artifactId>junit</artifactId> -->
<!-- <version>4.11</version> -->
<!-- </dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,453 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: frc_gazebo_plugin/msgs/bool.proto
package gazebo.msgs;
public final class GzBool {
private GzBool() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface BoolOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required bool data = 1;
/**
* <code>required bool data = 1;</code>
*/
boolean hasData();
/**
* <code>required bool data = 1;</code>
*/
boolean getData();
}
/**
* Protobuf type {@code gazebo.msgs.Bool}
*/
public static final class Bool extends
com.google.protobuf.GeneratedMessage
implements BoolOrBuilder {
// Use Bool.newBuilder() to construct.
private Bool(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Bool(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Bool defaultInstance;
public static Bool getDefaultInstance() {
return defaultInstance;
}
public Bool getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Bool(
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 8: {
bitField0_ |= 0x00000001;
data_ = input.readBool();
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.GzBool.internal_static_gazebo_msgs_Bool_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzBool.internal_static_gazebo_msgs_Bool_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzBool.Bool.class, gazebo.msgs.GzBool.Bool.Builder.class);
}
public static com.google.protobuf.Parser<Bool> PARSER =
new com.google.protobuf.AbstractParser<Bool>() {
public Bool parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Bool(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Bool> getParserForType() {
return PARSER;
}
private int bitField0_;
// required bool data = 1;
public static final int DATA_FIELD_NUMBER = 1;
private boolean data_;
/**
* <code>required bool data = 1;</code>
*/
public boolean hasData() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required bool data = 1;</code>
*/
public boolean getData() {
return data_;
}
private void initFields() {
data_ = false;
}
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.writeBool(1, data_);
}
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
.computeBoolSize(1, data_);
}
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.GzBool.Bool parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzBool.Bool 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.GzBool.Bool parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzBool.Bool parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gazebo.msgs.GzBool.Bool parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzBool.Bool parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzBool.Bool parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static gazebo.msgs.GzBool.Bool parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzBool.Bool parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzBool.Bool 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.GzBool.Bool 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.Bool}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements gazebo.msgs.GzBool.BoolOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.GzBool.internal_static_gazebo_msgs_Bool_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzBool.internal_static_gazebo_msgs_Bool_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzBool.Bool.class, gazebo.msgs.GzBool.Bool.Builder.class);
}
// Construct using gazebo.msgs.GzBool.Bool.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_ = false;
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return gazebo.msgs.GzBool.internal_static_gazebo_msgs_Bool_descriptor;
}
public gazebo.msgs.GzBool.Bool getDefaultInstanceForType() {
return gazebo.msgs.GzBool.Bool.getDefaultInstance();
}
public gazebo.msgs.GzBool.Bool build() {
gazebo.msgs.GzBool.Bool result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public gazebo.msgs.GzBool.Bool buildPartial() {
gazebo.msgs.GzBool.Bool result = new gazebo.msgs.GzBool.Bool(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.GzBool.Bool) {
return mergeFrom((gazebo.msgs.GzBool.Bool)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(gazebo.msgs.GzBool.Bool other) {
if (other == gazebo.msgs.GzBool.Bool.getDefaultInstance()) return this;
if (other.hasData()) {
setData(other.getData());
}
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.GzBool.Bool parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (gazebo.msgs.GzBool.Bool) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required bool data = 1;
private boolean data_ ;
/**
* <code>required bool data = 1;</code>
*/
public boolean hasData() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required bool data = 1;</code>
*/
public boolean getData() {
return data_;
}
/**
* <code>required bool data = 1;</code>
*/
public Builder setData(boolean value) {
bitField0_ |= 0x00000001;
data_ = value;
onChanged();
return this;
}
/**
* <code>required bool data = 1;</code>
*/
public Builder clearData() {
bitField0_ = (bitField0_ & ~0x00000001);
data_ = false;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:gazebo.msgs.Bool)
}
static {
defaultInstance = new Bool(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:gazebo.msgs.Bool)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_gazebo_msgs_Bool_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_gazebo_msgs_Bool_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!frc_gazebo_plugin/msgs/bool.proto\022\013gaz" +
"ebo.msgs\"\024\n\004Bool\022\014\n\004data\030\001 \002(\010B\010B\006GzBool"
};
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_Bool_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_gazebo_msgs_Bool_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_gazebo_msgs_Bool_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)
}

View File

@@ -0,0 +1,645 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: frc_gazebo_plugin/msgs/driver-station.proto
package gazebo.msgs;
public final class GzDriverStation {
private GzDriverStation() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface DriverStationOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required bool enabled = 1;
/**
* <code>required bool enabled = 1;</code>
*/
boolean hasEnabled();
/**
* <code>required bool enabled = 1;</code>
*/
boolean getEnabled();
// required .gazebo.msgs.DriverStation.State state = 2;
/**
* <code>required .gazebo.msgs.DriverStation.State state = 2;</code>
*/
boolean hasState();
/**
* <code>required .gazebo.msgs.DriverStation.State state = 2;</code>
*/
gazebo.msgs.GzDriverStation.DriverStation.State getState();
}
/**
* Protobuf type {@code gazebo.msgs.DriverStation}
*/
public static final class DriverStation extends
com.google.protobuf.GeneratedMessage
implements DriverStationOrBuilder {
// Use DriverStation.newBuilder() to construct.
private DriverStation(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private DriverStation(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final DriverStation defaultInstance;
public static DriverStation getDefaultInstance() {
return defaultInstance;
}
public DriverStation getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DriverStation(
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 8: {
bitField0_ |= 0x00000001;
enabled_ = input.readBool();
break;
}
case 16: {
int rawValue = input.readEnum();
gazebo.msgs.GzDriverStation.DriverStation.State value = gazebo.msgs.GzDriverStation.DriverStation.State.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(2, rawValue);
} else {
bitField0_ |= 0x00000002;
state_ = value;
}
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.GzDriverStation.internal_static_gazebo_msgs_DriverStation_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzDriverStation.internal_static_gazebo_msgs_DriverStation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzDriverStation.DriverStation.class, gazebo.msgs.GzDriverStation.DriverStation.Builder.class);
}
public static com.google.protobuf.Parser<DriverStation> PARSER =
new com.google.protobuf.AbstractParser<DriverStation>() {
public DriverStation parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DriverStation(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<DriverStation> getParserForType() {
return PARSER;
}
/**
* Protobuf enum {@code gazebo.msgs.DriverStation.State}
*/
public enum State
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>AUTO = 0;</code>
*/
AUTO(0, 0),
/**
* <code>TELEOP = 1;</code>
*/
TELEOP(1, 1),
/**
* <code>TEST = 2;</code>
*/
TEST(2, 2),
;
/**
* <code>AUTO = 0;</code>
*/
public static final int AUTO_VALUE = 0;
/**
* <code>TELEOP = 1;</code>
*/
public static final int TELEOP_VALUE = 1;
/**
* <code>TEST = 2;</code>
*/
public static final int TEST_VALUE = 2;
public final int getNumber() { return value; }
public static State valueOf(int value) {
switch (value) {
case 0: return AUTO;
case 1: return TELEOP;
case 2: return TEST;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<State>
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap<State>
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<State>() {
public State findValueByNumber(int number) {
return State.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return gazebo.msgs.GzDriverStation.DriverStation.getDescriptor().getEnumTypes().get(0);
}
private static final State[] VALUES = values();
public static State valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private State(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:gazebo.msgs.DriverStation.State)
}
private int bitField0_;
// required bool enabled = 1;
public static final int ENABLED_FIELD_NUMBER = 1;
private boolean enabled_;
/**
* <code>required bool enabled = 1;</code>
*/
public boolean hasEnabled() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required bool enabled = 1;</code>
*/
public boolean getEnabled() {
return enabled_;
}
// required .gazebo.msgs.DriverStation.State state = 2;
public static final int STATE_FIELD_NUMBER = 2;
private gazebo.msgs.GzDriverStation.DriverStation.State state_;
/**
* <code>required .gazebo.msgs.DriverStation.State state = 2;</code>
*/
public boolean hasState() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required .gazebo.msgs.DriverStation.State state = 2;</code>
*/
public gazebo.msgs.GzDriverStation.DriverStation.State getState() {
return state_;
}
private void initFields() {
enabled_ = false;
state_ = gazebo.msgs.GzDriverStation.DriverStation.State.AUTO;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasEnabled()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasState()) {
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.writeBool(1, enabled_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeEnum(2, state_.getNumber());
}
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
.computeBoolSize(1, enabled_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, state_.getNumber());
}
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.GzDriverStation.DriverStation parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzDriverStation.DriverStation 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.GzDriverStation.DriverStation parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzDriverStation.DriverStation parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gazebo.msgs.GzDriverStation.DriverStation parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzDriverStation.DriverStation parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzDriverStation.DriverStation parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static gazebo.msgs.GzDriverStation.DriverStation parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzDriverStation.DriverStation parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzDriverStation.DriverStation 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.GzDriverStation.DriverStation 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.DriverStation}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements gazebo.msgs.GzDriverStation.DriverStationOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.GzDriverStation.internal_static_gazebo_msgs_DriverStation_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzDriverStation.internal_static_gazebo_msgs_DriverStation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzDriverStation.DriverStation.class, gazebo.msgs.GzDriverStation.DriverStation.Builder.class);
}
// Construct using gazebo.msgs.GzDriveStation.DriverStation.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();
enabled_ = false;
bitField0_ = (bitField0_ & ~0x00000001);
state_ = gazebo.msgs.GzDriverStation.DriverStation.State.AUTO;
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return gazebo.msgs.GzDriverStation.internal_static_gazebo_msgs_DriverStation_descriptor;
}
public gazebo.msgs.GzDriverStation.DriverStation getDefaultInstanceForType() {
return gazebo.msgs.GzDriverStation.DriverStation.getDefaultInstance();
}
public gazebo.msgs.GzDriverStation.DriverStation build() {
gazebo.msgs.GzDriverStation.DriverStation result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public gazebo.msgs.GzDriverStation.DriverStation buildPartial() {
gazebo.msgs.GzDriverStation.DriverStation result = new gazebo.msgs.GzDriverStation.DriverStation(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.enabled_ = enabled_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.state_ = state_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof gazebo.msgs.GzDriverStation.DriverStation) {
return mergeFrom((gazebo.msgs.GzDriverStation.DriverStation)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(gazebo.msgs.GzDriverStation.DriverStation other) {
if (other == gazebo.msgs.GzDriverStation.DriverStation.getDefaultInstance()) return this;
if (other.hasEnabled()) {
setEnabled(other.getEnabled());
}
if (other.hasState()) {
setState(other.getState());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasEnabled()) {
return false;
}
if (!hasState()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
gazebo.msgs.GzDriverStation.DriverStation parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (gazebo.msgs.GzDriverStation.DriverStation) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required bool enabled = 1;
private boolean enabled_ ;
/**
* <code>required bool enabled = 1;</code>
*/
public boolean hasEnabled() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required bool enabled = 1;</code>
*/
public boolean getEnabled() {
return enabled_;
}
/**
* <code>required bool enabled = 1;</code>
*/
public Builder setEnabled(boolean value) {
bitField0_ |= 0x00000001;
enabled_ = value;
onChanged();
return this;
}
/**
* <code>required bool enabled = 1;</code>
*/
public Builder clearEnabled() {
bitField0_ = (bitField0_ & ~0x00000001);
enabled_ = false;
onChanged();
return this;
}
// required .gazebo.msgs.DriverStation.State state = 2;
private gazebo.msgs.GzDriverStation.DriverStation.State state_ = gazebo.msgs.GzDriverStation.DriverStation.State.AUTO;
/**
* <code>required .gazebo.msgs.DriverStation.State state = 2;</code>
*/
public boolean hasState() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required .gazebo.msgs.DriverStation.State state = 2;</code>
*/
public gazebo.msgs.GzDriverStation.DriverStation.State getState() {
return state_;
}
/**
* <code>required .gazebo.msgs.DriverStation.State state = 2;</code>
*/
public Builder setState(gazebo.msgs.GzDriverStation.DriverStation.State value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
state_ = value;
onChanged();
return this;
}
/**
* <code>required .gazebo.msgs.DriverStation.State state = 2;</code>
*/
public Builder clearState() {
bitField0_ = (bitField0_ & ~0x00000002);
state_ = gazebo.msgs.GzDriverStation.DriverStation.State.AUTO;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:gazebo.msgs.DriverStation)
}
static {
defaultInstance = new DriverStation(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:gazebo.msgs.DriverStation)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_gazebo_msgs_DriverStation_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_gazebo_msgs_DriverStation_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+frc_gazebo_plugin/msgs/driver-station." +
"proto\022\013gazebo.msgs\"z\n\rDriverStation\022\017\n\007e" +
"nabled\030\001 \002(\010\022/\n\005state\030\002 \002(\0162 .gazebo.msg" +
"s.DriverStation.State\"\'\n\005State\022\010\n\004AUTO\020\000" +
"\022\n\n\006TELEOP\020\001\022\010\n\004TEST\020\002B\020B\016GzDriveStation"
};
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_DriverStation_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_gazebo_msgs_DriverStation_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_gazebo_msgs_DriverStation_descriptor,
new java.lang.String[] { "Enabled", "State", });
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@@ -0,0 +1,453 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: msgs/float64.proto
package gazebo.msgs;
public final class GzFloat64 {
private GzFloat64() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface Float64OrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required double data = 1;
/**
* <code>required double data = 1;</code>
*/
boolean hasData();
/**
* <code>required double data = 1;</code>
*/
double getData();
}
/**
* Protobuf type {@code gazebo.msgs.Float64}
*/
public static final class Float64 extends
com.google.protobuf.GeneratedMessage
implements Float64OrBuilder {
// Use Float64.newBuilder() to construct.
private Float64(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Float64(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Float64 defaultInstance;
public static Float64 getDefaultInstance() {
return defaultInstance;
}
public Float64 getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Float64(
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 9: {
bitField0_ |= 0x00000001;
data_ = input.readDouble();
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.GzFloat64.internal_static_gazebo_msgs_Float64_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzFloat64.internal_static_gazebo_msgs_Float64_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzFloat64.Float64.class, gazebo.msgs.GzFloat64.Float64.Builder.class);
}
public static com.google.protobuf.Parser<Float64> PARSER =
new com.google.protobuf.AbstractParser<Float64>() {
public Float64 parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Float64(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Float64> getParserForType() {
return PARSER;
}
private int bitField0_;
// required double data = 1;
public static final int DATA_FIELD_NUMBER = 1;
private double data_;
/**
* <code>required double data = 1;</code>
*/
public boolean hasData() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required double data = 1;</code>
*/
public double getData() {
return data_;
}
private void initFields() {
data_ = 0D;
}
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.writeDouble(1, data_);
}
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
.computeDoubleSize(1, data_);
}
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.GzFloat64.Float64 parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzFloat64.Float64 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.GzFloat64.Float64 parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzFloat64.Float64 parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gazebo.msgs.GzFloat64.Float64 parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzFloat64.Float64 parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzFloat64.Float64 parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static gazebo.msgs.GzFloat64.Float64 parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzFloat64.Float64 parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzFloat64.Float64 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.GzFloat64.Float64 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.Float64}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements gazebo.msgs.GzFloat64.Float64OrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.GzFloat64.internal_static_gazebo_msgs_Float64_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzFloat64.internal_static_gazebo_msgs_Float64_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzFloat64.Float64.class, gazebo.msgs.GzFloat64.Float64.Builder.class);
}
// Construct using gazebo.msgs.GzFloat64.Float64.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_ = 0D;
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return gazebo.msgs.GzFloat64.internal_static_gazebo_msgs_Float64_descriptor;
}
public gazebo.msgs.GzFloat64.Float64 getDefaultInstanceForType() {
return gazebo.msgs.GzFloat64.Float64.getDefaultInstance();
}
public gazebo.msgs.GzFloat64.Float64 build() {
gazebo.msgs.GzFloat64.Float64 result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public gazebo.msgs.GzFloat64.Float64 buildPartial() {
gazebo.msgs.GzFloat64.Float64 result = new gazebo.msgs.GzFloat64.Float64(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.GzFloat64.Float64) {
return mergeFrom((gazebo.msgs.GzFloat64.Float64)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(gazebo.msgs.GzFloat64.Float64 other) {
if (other == gazebo.msgs.GzFloat64.Float64.getDefaultInstance()) return this;
if (other.hasData()) {
setData(other.getData());
}
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.GzFloat64.Float64 parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (gazebo.msgs.GzFloat64.Float64) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required double data = 1;
private double data_ ;
/**
* <code>required double data = 1;</code>
*/
public boolean hasData() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required double data = 1;</code>
*/
public double getData() {
return data_;
}
/**
* <code>required double data = 1;</code>
*/
public Builder setData(double value) {
bitField0_ |= 0x00000001;
data_ = value;
onChanged();
return this;
}
/**
* <code>required double data = 1;</code>
*/
public Builder clearData() {
bitField0_ = (bitField0_ & ~0x00000001);
data_ = 0D;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:gazebo.msgs.Float64)
}
static {
defaultInstance = new Float64(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:gazebo.msgs.Float64)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_gazebo_msgs_Float64_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_gazebo_msgs_Float64_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\022msgs/float64.proto\022\013gazebo.msgs\"\027\n\007Flo" +
"at64\022\014\n\004data\030\001 \002(\001B\013B\tGzFloat64"
};
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_Float64_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_gazebo_msgs_Float64_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_gazebo_msgs_Float64_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)
}

View File

@@ -0,0 +1,670 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: frc_gazebo_plugin/msgs/joystick.proto
package gazebo.msgs;
public final class GzJoystick {
private GzJoystick() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface JoystickOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// repeated double axes = 1;
/**
* <code>repeated double axes = 1;</code>
*/
java.util.List<java.lang.Double> getAxesList();
/**
* <code>repeated double axes = 1;</code>
*/
int getAxesCount();
/**
* <code>repeated double axes = 1;</code>
*/
double getAxes(int index);
// repeated bool buttons = 2;
/**
* <code>repeated bool buttons = 2;</code>
*/
java.util.List<java.lang.Boolean> getButtonsList();
/**
* <code>repeated bool buttons = 2;</code>
*/
int getButtonsCount();
/**
* <code>repeated bool buttons = 2;</code>
*/
boolean getButtons(int index);
}
/**
* Protobuf type {@code gazebo.msgs.Joystick}
*/
public static final class Joystick extends
com.google.protobuf.GeneratedMessage
implements JoystickOrBuilder {
// Use Joystick.newBuilder() to construct.
private Joystick(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Joystick(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Joystick defaultInstance;
public static Joystick getDefaultInstance() {
return defaultInstance;
}
public Joystick getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Joystick(
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 9: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
axes_ = new java.util.ArrayList<java.lang.Double>();
mutable_bitField0_ |= 0x00000001;
}
axes_.add(input.readDouble());
break;
}
case 10: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001) && input.getBytesUntilLimit() > 0) {
axes_ = new java.util.ArrayList<java.lang.Double>();
mutable_bitField0_ |= 0x00000001;
}
while (input.getBytesUntilLimit() > 0) {
axes_.add(input.readDouble());
}
input.popLimit(limit);
break;
}
case 16: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
buttons_ = new java.util.ArrayList<java.lang.Boolean>();
mutable_bitField0_ |= 0x00000002;
}
buttons_.add(input.readBool());
break;
}
case 18: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
buttons_ = new java.util.ArrayList<java.lang.Boolean>();
mutable_bitField0_ |= 0x00000002;
}
while (input.getBytesUntilLimit() > 0) {
buttons_.add(input.readBool());
}
input.popLimit(limit);
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 {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
axes_ = java.util.Collections.unmodifiableList(axes_);
}
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
buttons_ = java.util.Collections.unmodifiableList(buttons_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.GzJoystick.internal_static_gazebo_msgs_Joystick_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzJoystick.internal_static_gazebo_msgs_Joystick_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzJoystick.Joystick.class, gazebo.msgs.GzJoystick.Joystick.Builder.class);
}
public static com.google.protobuf.Parser<Joystick> PARSER =
new com.google.protobuf.AbstractParser<Joystick>() {
public Joystick parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Joystick(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Joystick> getParserForType() {
return PARSER;
}
// repeated double axes = 1;
public static final int AXES_FIELD_NUMBER = 1;
private java.util.List<java.lang.Double> axes_;
/**
* <code>repeated double axes = 1;</code>
*/
public java.util.List<java.lang.Double>
getAxesList() {
return axes_;
}
/**
* <code>repeated double axes = 1;</code>
*/
public int getAxesCount() {
return axes_.size();
}
/**
* <code>repeated double axes = 1;</code>
*/
public double getAxes(int index) {
return axes_.get(index);
}
// repeated bool buttons = 2;
public static final int BUTTONS_FIELD_NUMBER = 2;
private java.util.List<java.lang.Boolean> buttons_;
/**
* <code>repeated bool buttons = 2;</code>
*/
public java.util.List<java.lang.Boolean>
getButtonsList() {
return buttons_;
}
/**
* <code>repeated bool buttons = 2;</code>
*/
public int getButtonsCount() {
return buttons_.size();
}
/**
* <code>repeated bool buttons = 2;</code>
*/
public boolean getButtons(int index) {
return buttons_.get(index);
}
private void initFields() {
axes_ = java.util.Collections.emptyList();
buttons_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < axes_.size(); i++) {
output.writeDouble(1, axes_.get(i));
}
for (int i = 0; i < buttons_.size(); i++) {
output.writeBool(2, buttons_.get(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
dataSize = 8 * getAxesList().size();
size += dataSize;
size += 1 * getAxesList().size();
}
{
int dataSize = 0;
dataSize = 1 * getButtonsList().size();
size += dataSize;
size += 1 * getButtonsList().size();
}
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.GzJoystick.Joystick parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzJoystick.Joystick 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.GzJoystick.Joystick parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzJoystick.Joystick parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gazebo.msgs.GzJoystick.Joystick parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzJoystick.Joystick parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzJoystick.Joystick parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static gazebo.msgs.GzJoystick.Joystick parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzJoystick.Joystick parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzJoystick.Joystick 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.GzJoystick.Joystick 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.Joystick}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements gazebo.msgs.GzJoystick.JoystickOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.GzJoystick.internal_static_gazebo_msgs_Joystick_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzJoystick.internal_static_gazebo_msgs_Joystick_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzJoystick.Joystick.class, gazebo.msgs.GzJoystick.Joystick.Builder.class);
}
// Construct using gazebo.msgs.GzJoystick.Joystick.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();
axes_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
buttons_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return gazebo.msgs.GzJoystick.internal_static_gazebo_msgs_Joystick_descriptor;
}
public gazebo.msgs.GzJoystick.Joystick getDefaultInstanceForType() {
return gazebo.msgs.GzJoystick.Joystick.getDefaultInstance();
}
public gazebo.msgs.GzJoystick.Joystick build() {
gazebo.msgs.GzJoystick.Joystick result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public gazebo.msgs.GzJoystick.Joystick buildPartial() {
gazebo.msgs.GzJoystick.Joystick result = new gazebo.msgs.GzJoystick.Joystick(this);
int from_bitField0_ = bitField0_;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
axes_ = java.util.Collections.unmodifiableList(axes_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.axes_ = axes_;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
buttons_ = java.util.Collections.unmodifiableList(buttons_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.buttons_ = buttons_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof gazebo.msgs.GzJoystick.Joystick) {
return mergeFrom((gazebo.msgs.GzJoystick.Joystick)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(gazebo.msgs.GzJoystick.Joystick other) {
if (other == gazebo.msgs.GzJoystick.Joystick.getDefaultInstance()) return this;
if (!other.axes_.isEmpty()) {
if (axes_.isEmpty()) {
axes_ = other.axes_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureAxesIsMutable();
axes_.addAll(other.axes_);
}
onChanged();
}
if (!other.buttons_.isEmpty()) {
if (buttons_.isEmpty()) {
buttons_ = other.buttons_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureButtonsIsMutable();
buttons_.addAll(other.buttons_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
gazebo.msgs.GzJoystick.Joystick parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (gazebo.msgs.GzJoystick.Joystick) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// repeated double axes = 1;
private java.util.List<java.lang.Double> axes_ = java.util.Collections.emptyList();
private void ensureAxesIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
axes_ = new java.util.ArrayList<java.lang.Double>(axes_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated double axes = 1;</code>
*/
public java.util.List<java.lang.Double>
getAxesList() {
return java.util.Collections.unmodifiableList(axes_);
}
/**
* <code>repeated double axes = 1;</code>
*/
public int getAxesCount() {
return axes_.size();
}
/**
* <code>repeated double axes = 1;</code>
*/
public double getAxes(int index) {
return axes_.get(index);
}
/**
* <code>repeated double axes = 1;</code>
*/
public Builder setAxes(
int index, double value) {
ensureAxesIsMutable();
axes_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated double axes = 1;</code>
*/
public Builder addAxes(double value) {
ensureAxesIsMutable();
axes_.add(value);
onChanged();
return this;
}
/**
* <code>repeated double axes = 1;</code>
*/
public Builder addAllAxes(
java.lang.Iterable<? extends java.lang.Double> values) {
ensureAxesIsMutable();
super.addAll(values, axes_);
onChanged();
return this;
}
/**
* <code>repeated double axes = 1;</code>
*/
public Builder clearAxes() {
axes_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
// repeated bool buttons = 2;
private java.util.List<java.lang.Boolean> buttons_ = java.util.Collections.emptyList();
private void ensureButtonsIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
buttons_ = new java.util.ArrayList<java.lang.Boolean>(buttons_);
bitField0_ |= 0x00000002;
}
}
/**
* <code>repeated bool buttons = 2;</code>
*/
public java.util.List<java.lang.Boolean>
getButtonsList() {
return java.util.Collections.unmodifiableList(buttons_);
}
/**
* <code>repeated bool buttons = 2;</code>
*/
public int getButtonsCount() {
return buttons_.size();
}
/**
* <code>repeated bool buttons = 2;</code>
*/
public boolean getButtons(int index) {
return buttons_.get(index);
}
/**
* <code>repeated bool buttons = 2;</code>
*/
public Builder setButtons(
int index, boolean value) {
ensureButtonsIsMutable();
buttons_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated bool buttons = 2;</code>
*/
public Builder addButtons(boolean value) {
ensureButtonsIsMutable();
buttons_.add(value);
onChanged();
return this;
}
/**
* <code>repeated bool buttons = 2;</code>
*/
public Builder addAllButtons(
java.lang.Iterable<? extends java.lang.Boolean> values) {
ensureButtonsIsMutable();
super.addAll(values, buttons_);
onChanged();
return this;
}
/**
* <code>repeated bool buttons = 2;</code>
*/
public Builder clearButtons() {
buttons_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:gazebo.msgs.Joystick)
}
static {
defaultInstance = new Joystick(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:gazebo.msgs.Joystick)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_gazebo_msgs_Joystick_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_gazebo_msgs_Joystick_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%frc_gazebo_plugin/msgs/joystick.proto\022" +
"\013gazebo.msgs\")\n\010Joystick\022\014\n\004axes\030\001 \003(\001\022\017" +
"\n\007buttons\030\002 \003(\010B\014B\nGzJoystick"
};
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_Joystick_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_gazebo_msgs_Joystick_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_gazebo_msgs_Joystick_descriptor,
new java.lang.String[] { "Axes", "Buttons", });
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@@ -0,0 +1,831 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: packet.proto
package gazebo.msgs;
public final class GzPacket {
private GzPacket() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface PacketOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required .gazebo.msgs.Time stamp = 1;
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
boolean hasStamp();
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
gazebo.msgs.GzTime.Time getStamp();
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
gazebo.msgs.GzTime.TimeOrBuilder getStampOrBuilder();
// required string type = 2;
/**
* <code>required string type = 2;</code>
*/
boolean hasType();
/**
* <code>required string type = 2;</code>
*/
java.lang.String getType();
/**
* <code>required string type = 2;</code>
*/
com.google.protobuf.ByteString
getTypeBytes();
// required bytes serialized_data = 3;
/**
* <code>required bytes serialized_data = 3;</code>
*/
boolean hasSerializedData();
/**
* <code>required bytes serialized_data = 3;</code>
*/
com.google.protobuf.ByteString getSerializedData();
}
/**
* Protobuf type {@code gazebo.msgs.Packet}
*/
public static final class Packet extends
com.google.protobuf.GeneratedMessage
implements PacketOrBuilder {
// Use Packet.newBuilder() to construct.
private Packet(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Packet(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Packet defaultInstance;
public static Packet getDefaultInstance() {
return defaultInstance;
}
public Packet getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Packet(
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: {
gazebo.msgs.GzTime.Time.Builder subBuilder = null;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
subBuilder = stamp_.toBuilder();
}
stamp_ = input.readMessage(gazebo.msgs.GzTime.Time.PARSER, extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(stamp_);
stamp_ = subBuilder.buildPartial();
}
bitField0_ |= 0x00000001;
break;
}
case 18: {
bitField0_ |= 0x00000002;
type_ = input.readBytes();
break;
}
case 26: {
bitField0_ |= 0x00000004;
serializedData_ = 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.GzPacket.internal_static_gazebo_msgs_Packet_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzPacket.internal_static_gazebo_msgs_Packet_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzPacket.Packet.class, gazebo.msgs.GzPacket.Packet.Builder.class);
}
public static com.google.protobuf.Parser<Packet> PARSER =
new com.google.protobuf.AbstractParser<Packet>() {
public Packet parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Packet(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Packet> getParserForType() {
return PARSER;
}
private int bitField0_;
// required .gazebo.msgs.Time stamp = 1;
public static final int STAMP_FIELD_NUMBER = 1;
private gazebo.msgs.GzTime.Time stamp_;
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
public boolean hasStamp() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
public gazebo.msgs.GzTime.Time getStamp() {
return stamp_;
}
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
public gazebo.msgs.GzTime.TimeOrBuilder getStampOrBuilder() {
return stamp_;
}
// required string type = 2;
public static final int TYPE_FIELD_NUMBER = 2;
private java.lang.Object type_;
/**
* <code>required string type = 2;</code>
*/
public boolean hasType() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string type = 2;</code>
*/
public java.lang.String getType() {
java.lang.Object ref = type_;
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()) {
type_ = s;
}
return s;
}
}
/**
* <code>required string type = 2;</code>
*/
public com.google.protobuf.ByteString
getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// required bytes serialized_data = 3;
public static final int SERIALIZED_DATA_FIELD_NUMBER = 3;
private com.google.protobuf.ByteString serializedData_;
/**
* <code>required bytes serialized_data = 3;</code>
*/
public boolean hasSerializedData() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required bytes serialized_data = 3;</code>
*/
public com.google.protobuf.ByteString getSerializedData() {
return serializedData_;
}
private void initFields() {
stamp_ = gazebo.msgs.GzTime.Time.getDefaultInstance();
type_ = "";
serializedData_ = com.google.protobuf.ByteString.EMPTY;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasStamp()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasType()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasSerializedData()) {
memoizedIsInitialized = 0;
return false;
}
if (!getStamp().isInitialized()) {
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.writeMessage(1, stamp_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getTypeBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(3, serializedData_);
}
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
.computeMessageSize(1, stamp_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getTypeBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, serializedData_);
}
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.GzPacket.Packet parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzPacket.Packet 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.GzPacket.Packet parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzPacket.Packet parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gazebo.msgs.GzPacket.Packet parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzPacket.Packet parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzPacket.Packet parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static gazebo.msgs.GzPacket.Packet parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzPacket.Packet parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzPacket.Packet 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.GzPacket.Packet 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.Packet}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements gazebo.msgs.GzPacket.PacketOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.GzPacket.internal_static_gazebo_msgs_Packet_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzPacket.internal_static_gazebo_msgs_Packet_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzPacket.Packet.class, gazebo.msgs.GzPacket.Packet.Builder.class);
}
// Construct using gazebo.msgs.GzPacket.Packet.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getStampFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
if (stampBuilder_ == null) {
stamp_ = gazebo.msgs.GzTime.Time.getDefaultInstance();
} else {
stampBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
type_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
serializedData_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return gazebo.msgs.GzPacket.internal_static_gazebo_msgs_Packet_descriptor;
}
public gazebo.msgs.GzPacket.Packet getDefaultInstanceForType() {
return gazebo.msgs.GzPacket.Packet.getDefaultInstance();
}
public gazebo.msgs.GzPacket.Packet build() {
gazebo.msgs.GzPacket.Packet result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public gazebo.msgs.GzPacket.Packet buildPartial() {
gazebo.msgs.GzPacket.Packet result = new gazebo.msgs.GzPacket.Packet(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
if (stampBuilder_ == null) {
result.stamp_ = stamp_;
} else {
result.stamp_ = stampBuilder_.build();
}
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.type_ = type_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.serializedData_ = serializedData_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof gazebo.msgs.GzPacket.Packet) {
return mergeFrom((gazebo.msgs.GzPacket.Packet)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(gazebo.msgs.GzPacket.Packet other) {
if (other == gazebo.msgs.GzPacket.Packet.getDefaultInstance()) return this;
if (other.hasStamp()) {
mergeStamp(other.getStamp());
}
if (other.hasType()) {
bitField0_ |= 0x00000002;
type_ = other.type_;
onChanged();
}
if (other.hasSerializedData()) {
setSerializedData(other.getSerializedData());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasStamp()) {
return false;
}
if (!hasType()) {
return false;
}
if (!hasSerializedData()) {
return false;
}
if (!getStamp().isInitialized()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
gazebo.msgs.GzPacket.Packet parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (gazebo.msgs.GzPacket.Packet) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required .gazebo.msgs.Time stamp = 1;
private gazebo.msgs.GzTime.Time stamp_ = gazebo.msgs.GzTime.Time.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
gazebo.msgs.GzTime.Time, gazebo.msgs.GzTime.Time.Builder, gazebo.msgs.GzTime.TimeOrBuilder> stampBuilder_;
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
public boolean hasStamp() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
public gazebo.msgs.GzTime.Time getStamp() {
if (stampBuilder_ == null) {
return stamp_;
} else {
return stampBuilder_.getMessage();
}
}
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
public Builder setStamp(gazebo.msgs.GzTime.Time value) {
if (stampBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
stamp_ = value;
onChanged();
} else {
stampBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
public Builder setStamp(
gazebo.msgs.GzTime.Time.Builder builderForValue) {
if (stampBuilder_ == null) {
stamp_ = builderForValue.build();
onChanged();
} else {
stampBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
public Builder mergeStamp(gazebo.msgs.GzTime.Time value) {
if (stampBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001) &&
stamp_ != gazebo.msgs.GzTime.Time.getDefaultInstance()) {
stamp_ =
gazebo.msgs.GzTime.Time.newBuilder(stamp_).mergeFrom(value).buildPartial();
} else {
stamp_ = value;
}
onChanged();
} else {
stampBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000001;
return this;
}
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
public Builder clearStamp() {
if (stampBuilder_ == null) {
stamp_ = gazebo.msgs.GzTime.Time.getDefaultInstance();
onChanged();
} else {
stampBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
public gazebo.msgs.GzTime.Time.Builder getStampBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getStampFieldBuilder().getBuilder();
}
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
public gazebo.msgs.GzTime.TimeOrBuilder getStampOrBuilder() {
if (stampBuilder_ != null) {
return stampBuilder_.getMessageOrBuilder();
} else {
return stamp_;
}
}
/**
* <code>required .gazebo.msgs.Time stamp = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
gazebo.msgs.GzTime.Time, gazebo.msgs.GzTime.Time.Builder, gazebo.msgs.GzTime.TimeOrBuilder>
getStampFieldBuilder() {
if (stampBuilder_ == null) {
stampBuilder_ = new com.google.protobuf.SingleFieldBuilder<
gazebo.msgs.GzTime.Time, gazebo.msgs.GzTime.Time.Builder, gazebo.msgs.GzTime.TimeOrBuilder>(
stamp_,
getParentForChildren(),
isClean());
stamp_ = null;
}
return stampBuilder_;
}
// required string type = 2;
private java.lang.Object type_ = "";
/**
* <code>required string type = 2;</code>
*/
public boolean hasType() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required string type = 2;</code>
*/
public java.lang.String getType() {
java.lang.Object ref = type_;
if (!(ref instanceof java.lang.String)) {
java.lang.String s = ((com.google.protobuf.ByteString) ref)
.toStringUtf8();
type_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>required string type = 2;</code>
*/
public com.google.protobuf.ByteString
getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>required string type = 2;</code>
*/
public Builder setType(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
type_ = value;
onChanged();
return this;
}
/**
* <code>required string type = 2;</code>
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000002);
type_ = getDefaultInstance().getType();
onChanged();
return this;
}
/**
* <code>required string type = 2;</code>
*/
public Builder setTypeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
type_ = value;
onChanged();
return this;
}
// required bytes serialized_data = 3;
private com.google.protobuf.ByteString serializedData_ = com.google.protobuf.ByteString.EMPTY;
/**
* <code>required bytes serialized_data = 3;</code>
*/
public boolean hasSerializedData() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>required bytes serialized_data = 3;</code>
*/
public com.google.protobuf.ByteString getSerializedData() {
return serializedData_;
}
/**
* <code>required bytes serialized_data = 3;</code>
*/
public Builder setSerializedData(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
serializedData_ = value;
onChanged();
return this;
}
/**
* <code>required bytes serialized_data = 3;</code>
*/
public Builder clearSerializedData() {
bitField0_ = (bitField0_ & ~0x00000004);
serializedData_ = getDefaultInstance().getSerializedData();
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:gazebo.msgs.Packet)
}
static {
defaultInstance = new Packet(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:gazebo.msgs.Packet)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_gazebo_msgs_Packet_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_gazebo_msgs_Packet_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\014packet.proto\022\013gazebo.msgs\032\ntime.proto\"" +
"Q\n\006Packet\022 \n\005stamp\030\001 \002(\0132\021.gazebo.msgs.T" +
"ime\022\014\n\004type\030\002 \002(\t\022\027\n\017serialized_data\030\003 \002" +
"(\014B\nB\010GzPacket"
};
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_Packet_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_gazebo_msgs_Packet_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_gazebo_msgs_Packet_descriptor,
new java.lang.String[] { "Stamp", "Type", "SerializedData", });
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
gazebo.msgs.GzTime.getDescriptor(),
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}

View 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)
}

View File

@@ -0,0 +1,737 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: publishers.proto
package gazebo.msgs;
public final class GzPublishers {
private GzPublishers() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface PublishersOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// repeated .gazebo.msgs.Publish publisher = 1;
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
java.util.List<gazebo.msgs.GzPublish.Publish>
getPublisherList();
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
gazebo.msgs.GzPublish.Publish getPublisher(int index);
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
int getPublisherCount();
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
java.util.List<? extends gazebo.msgs.GzPublish.PublishOrBuilder>
getPublisherOrBuilderList();
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
gazebo.msgs.GzPublish.PublishOrBuilder getPublisherOrBuilder(
int index);
}
/**
* Protobuf type {@code gazebo.msgs.Publishers}
*/
public static final class Publishers extends
com.google.protobuf.GeneratedMessage
implements PublishersOrBuilder {
// Use Publishers.newBuilder() to construct.
private Publishers(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Publishers(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Publishers defaultInstance;
public static Publishers getDefaultInstance() {
return defaultInstance;
}
public Publishers getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Publishers(
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: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
publisher_ = new java.util.ArrayList<gazebo.msgs.GzPublish.Publish>();
mutable_bitField0_ |= 0x00000001;
}
publisher_.add(input.readMessage(gazebo.msgs.GzPublish.Publish.PARSER, extensionRegistry));
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 {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
publisher_ = java.util.Collections.unmodifiableList(publisher_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.GzPublishers.internal_static_gazebo_msgs_Publishers_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzPublishers.internal_static_gazebo_msgs_Publishers_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzPublishers.Publishers.class, gazebo.msgs.GzPublishers.Publishers.Builder.class);
}
public static com.google.protobuf.Parser<Publishers> PARSER =
new com.google.protobuf.AbstractParser<Publishers>() {
public Publishers parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Publishers(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Publishers> getParserForType() {
return PARSER;
}
// repeated .gazebo.msgs.Publish publisher = 1;
public static final int PUBLISHER_FIELD_NUMBER = 1;
private java.util.List<gazebo.msgs.GzPublish.Publish> publisher_;
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public java.util.List<gazebo.msgs.GzPublish.Publish> getPublisherList() {
return publisher_;
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public java.util.List<? extends gazebo.msgs.GzPublish.PublishOrBuilder>
getPublisherOrBuilderList() {
return publisher_;
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public int getPublisherCount() {
return publisher_.size();
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public gazebo.msgs.GzPublish.Publish getPublisher(int index) {
return publisher_.get(index);
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public gazebo.msgs.GzPublish.PublishOrBuilder getPublisherOrBuilder(
int index) {
return publisher_.get(index);
}
private void initFields() {
publisher_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
for (int i = 0; i < getPublisherCount(); i++) {
if (!getPublisher(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < publisher_.size(); i++) {
output.writeMessage(1, publisher_.get(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < publisher_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, publisher_.get(i));
}
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.GzPublishers.Publishers parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzPublishers.Publishers 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.GzPublishers.Publishers parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzPublishers.Publishers parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gazebo.msgs.GzPublishers.Publishers parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzPublishers.Publishers parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzPublishers.Publishers parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static gazebo.msgs.GzPublishers.Publishers parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzPublishers.Publishers parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzPublishers.Publishers 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.GzPublishers.Publishers 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.Publishers}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements gazebo.msgs.GzPublishers.PublishersOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.GzPublishers.internal_static_gazebo_msgs_Publishers_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzPublishers.internal_static_gazebo_msgs_Publishers_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzPublishers.Publishers.class, gazebo.msgs.GzPublishers.Publishers.Builder.class);
}
// Construct using gazebo.msgs.GzPublishers.Publishers.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getPublisherFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
if (publisherBuilder_ == null) {
publisher_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
publisherBuilder_.clear();
}
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return gazebo.msgs.GzPublishers.internal_static_gazebo_msgs_Publishers_descriptor;
}
public gazebo.msgs.GzPublishers.Publishers getDefaultInstanceForType() {
return gazebo.msgs.GzPublishers.Publishers.getDefaultInstance();
}
public gazebo.msgs.GzPublishers.Publishers build() {
gazebo.msgs.GzPublishers.Publishers result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public gazebo.msgs.GzPublishers.Publishers buildPartial() {
gazebo.msgs.GzPublishers.Publishers result = new gazebo.msgs.GzPublishers.Publishers(this);
int from_bitField0_ = bitField0_;
if (publisherBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001)) {
publisher_ = java.util.Collections.unmodifiableList(publisher_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.publisher_ = publisher_;
} else {
result.publisher_ = publisherBuilder_.build();
}
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof gazebo.msgs.GzPublishers.Publishers) {
return mergeFrom((gazebo.msgs.GzPublishers.Publishers)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(gazebo.msgs.GzPublishers.Publishers other) {
if (other == gazebo.msgs.GzPublishers.Publishers.getDefaultInstance()) return this;
if (publisherBuilder_ == null) {
if (!other.publisher_.isEmpty()) {
if (publisher_.isEmpty()) {
publisher_ = other.publisher_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensurePublisherIsMutable();
publisher_.addAll(other.publisher_);
}
onChanged();
}
} else {
if (!other.publisher_.isEmpty()) {
if (publisherBuilder_.isEmpty()) {
publisherBuilder_.dispose();
publisherBuilder_ = null;
publisher_ = other.publisher_;
bitField0_ = (bitField0_ & ~0x00000001);
publisherBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getPublisherFieldBuilder() : null;
} else {
publisherBuilder_.addAllMessages(other.publisher_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
for (int i = 0; i < getPublisherCount(); i++) {
if (!getPublisher(i).isInitialized()) {
return false;
}
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
gazebo.msgs.GzPublishers.Publishers parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (gazebo.msgs.GzPublishers.Publishers) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// repeated .gazebo.msgs.Publish publisher = 1;
private java.util.List<gazebo.msgs.GzPublish.Publish> publisher_ =
java.util.Collections.emptyList();
private void ensurePublisherIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
publisher_ = new java.util.ArrayList<gazebo.msgs.GzPublish.Publish>(publisher_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
gazebo.msgs.GzPublish.Publish, gazebo.msgs.GzPublish.Publish.Builder, gazebo.msgs.GzPublish.PublishOrBuilder> publisherBuilder_;
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public java.util.List<gazebo.msgs.GzPublish.Publish> getPublisherList() {
if (publisherBuilder_ == null) {
return java.util.Collections.unmodifiableList(publisher_);
} else {
return publisherBuilder_.getMessageList();
}
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public int getPublisherCount() {
if (publisherBuilder_ == null) {
return publisher_.size();
} else {
return publisherBuilder_.getCount();
}
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public gazebo.msgs.GzPublish.Publish getPublisher(int index) {
if (publisherBuilder_ == null) {
return publisher_.get(index);
} else {
return publisherBuilder_.getMessage(index);
}
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public Builder setPublisher(
int index, gazebo.msgs.GzPublish.Publish value) {
if (publisherBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePublisherIsMutable();
publisher_.set(index, value);
onChanged();
} else {
publisherBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public Builder setPublisher(
int index, gazebo.msgs.GzPublish.Publish.Builder builderForValue) {
if (publisherBuilder_ == null) {
ensurePublisherIsMutable();
publisher_.set(index, builderForValue.build());
onChanged();
} else {
publisherBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public Builder addPublisher(gazebo.msgs.GzPublish.Publish value) {
if (publisherBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePublisherIsMutable();
publisher_.add(value);
onChanged();
} else {
publisherBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public Builder addPublisher(
int index, gazebo.msgs.GzPublish.Publish value) {
if (publisherBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePublisherIsMutable();
publisher_.add(index, value);
onChanged();
} else {
publisherBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public Builder addPublisher(
gazebo.msgs.GzPublish.Publish.Builder builderForValue) {
if (publisherBuilder_ == null) {
ensurePublisherIsMutable();
publisher_.add(builderForValue.build());
onChanged();
} else {
publisherBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public Builder addPublisher(
int index, gazebo.msgs.GzPublish.Publish.Builder builderForValue) {
if (publisherBuilder_ == null) {
ensurePublisherIsMutable();
publisher_.add(index, builderForValue.build());
onChanged();
} else {
publisherBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public Builder addAllPublisher(
java.lang.Iterable<? extends gazebo.msgs.GzPublish.Publish> values) {
if (publisherBuilder_ == null) {
ensurePublisherIsMutable();
super.addAll(values, publisher_);
onChanged();
} else {
publisherBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public Builder clearPublisher() {
if (publisherBuilder_ == null) {
publisher_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
publisherBuilder_.clear();
}
return this;
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public Builder removePublisher(int index) {
if (publisherBuilder_ == null) {
ensurePublisherIsMutable();
publisher_.remove(index);
onChanged();
} else {
publisherBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public gazebo.msgs.GzPublish.Publish.Builder getPublisherBuilder(
int index) {
return getPublisherFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public gazebo.msgs.GzPublish.PublishOrBuilder getPublisherOrBuilder(
int index) {
if (publisherBuilder_ == null) {
return publisher_.get(index); } else {
return publisherBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public java.util.List<? extends gazebo.msgs.GzPublish.PublishOrBuilder>
getPublisherOrBuilderList() {
if (publisherBuilder_ != null) {
return publisherBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(publisher_);
}
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public gazebo.msgs.GzPublish.Publish.Builder addPublisherBuilder() {
return getPublisherFieldBuilder().addBuilder(
gazebo.msgs.GzPublish.Publish.getDefaultInstance());
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public gazebo.msgs.GzPublish.Publish.Builder addPublisherBuilder(
int index) {
return getPublisherFieldBuilder().addBuilder(
index, gazebo.msgs.GzPublish.Publish.getDefaultInstance());
}
/**
* <code>repeated .gazebo.msgs.Publish publisher = 1;</code>
*/
public java.util.List<gazebo.msgs.GzPublish.Publish.Builder>
getPublisherBuilderList() {
return getPublisherFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
gazebo.msgs.GzPublish.Publish, gazebo.msgs.GzPublish.Publish.Builder, gazebo.msgs.GzPublish.PublishOrBuilder>
getPublisherFieldBuilder() {
if (publisherBuilder_ == null) {
publisherBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
gazebo.msgs.GzPublish.Publish, gazebo.msgs.GzPublish.Publish.Builder, gazebo.msgs.GzPublish.PublishOrBuilder>(
publisher_,
((bitField0_ & 0x00000001) == 0x00000001),
getParentForChildren(),
isClean());
publisher_ = null;
}
return publisherBuilder_;
}
// @@protoc_insertion_point(builder_scope:gazebo.msgs.Publishers)
}
static {
defaultInstance = new Publishers(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:gazebo.msgs.Publishers)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_gazebo_msgs_Publishers_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_gazebo_msgs_Publishers_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\020publishers.proto\022\013gazebo.msgs\032\rpublish" +
".proto\"5\n\nPublishers\022\'\n\tpublisher\030\001 \003(\0132" +
"\024.gazebo.msgs.PublishB\016B\014GzPublishers"
};
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_Publishers_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_gazebo_msgs_Publishers_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_gazebo_msgs_Publishers_descriptor,
new java.lang.String[] { "Publisher", });
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
gazebo.msgs.GzPublish.getDescriptor(),
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@@ -0,0 +1,528 @@
// 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)
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,542 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: time.proto
package gazebo.msgs;
public final class GzTime {
private GzTime() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface TimeOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// required int32 sec = 1;
/**
* <code>required int32 sec = 1;</code>
*/
boolean hasSec();
/**
* <code>required int32 sec = 1;</code>
*/
int getSec();
// required int32 nsec = 2;
/**
* <code>required int32 nsec = 2;</code>
*/
boolean hasNsec();
/**
* <code>required int32 nsec = 2;</code>
*/
int getNsec();
}
/**
* Protobuf type {@code gazebo.msgs.Time}
*/
public static final class Time extends
com.google.protobuf.GeneratedMessage
implements TimeOrBuilder {
// Use Time.newBuilder() to construct.
private Time(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private Time(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final Time defaultInstance;
public static Time getDefaultInstance() {
return defaultInstance;
}
public Time getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Time(
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 8: {
bitField0_ |= 0x00000001;
sec_ = input.readInt32();
break;
}
case 16: {
bitField0_ |= 0x00000002;
nsec_ = input.readInt32();
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.GzTime.internal_static_gazebo_msgs_Time_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzTime.internal_static_gazebo_msgs_Time_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzTime.Time.class, gazebo.msgs.GzTime.Time.Builder.class);
}
public static com.google.protobuf.Parser<Time> PARSER =
new com.google.protobuf.AbstractParser<Time>() {
public Time parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Time(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<Time> getParserForType() {
return PARSER;
}
private int bitField0_;
// required int32 sec = 1;
public static final int SEC_FIELD_NUMBER = 1;
private int sec_;
/**
* <code>required int32 sec = 1;</code>
*/
public boolean hasSec() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required int32 sec = 1;</code>
*/
public int getSec() {
return sec_;
}
// required int32 nsec = 2;
public static final int NSEC_FIELD_NUMBER = 2;
private int nsec_;
/**
* <code>required int32 nsec = 2;</code>
*/
public boolean hasNsec() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required int32 nsec = 2;</code>
*/
public int getNsec() {
return nsec_;
}
private void initFields() {
sec_ = 0;
nsec_ = 0;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (!hasSec()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasNsec()) {
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.writeInt32(1, sec_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt32(2, nsec_);
}
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
.computeInt32Size(1, sec_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, nsec_);
}
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.GzTime.Time parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzTime.Time 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.GzTime.Time parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.GzTime.Time parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gazebo.msgs.GzTime.Time parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzTime.Time parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzTime.Time parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static gazebo.msgs.GzTime.Time parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static gazebo.msgs.GzTime.Time parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.GzTime.Time 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.GzTime.Time 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.Time}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements gazebo.msgs.GzTime.TimeOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.GzTime.internal_static_gazebo_msgs_Time_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.GzTime.internal_static_gazebo_msgs_Time_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.GzTime.Time.class, gazebo.msgs.GzTime.Time.Builder.class);
}
// Construct using gazebo.msgs.GzTime.Time.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();
sec_ = 0;
bitField0_ = (bitField0_ & ~0x00000001);
nsec_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return gazebo.msgs.GzTime.internal_static_gazebo_msgs_Time_descriptor;
}
public gazebo.msgs.GzTime.Time getDefaultInstanceForType() {
return gazebo.msgs.GzTime.Time.getDefaultInstance();
}
public gazebo.msgs.GzTime.Time build() {
gazebo.msgs.GzTime.Time result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public gazebo.msgs.GzTime.Time buildPartial() {
gazebo.msgs.GzTime.Time result = new gazebo.msgs.GzTime.Time(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.sec_ = sec_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.nsec_ = nsec_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof gazebo.msgs.GzTime.Time) {
return mergeFrom((gazebo.msgs.GzTime.Time)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(gazebo.msgs.GzTime.Time other) {
if (other == gazebo.msgs.GzTime.Time.getDefaultInstance()) return this;
if (other.hasSec()) {
setSec(other.getSec());
}
if (other.hasNsec()) {
setNsec(other.getNsec());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
if (!hasSec()) {
return false;
}
if (!hasNsec()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
gazebo.msgs.GzTime.Time parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (gazebo.msgs.GzTime.Time) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// required int32 sec = 1;
private int sec_ ;
/**
* <code>required int32 sec = 1;</code>
*/
public boolean hasSec() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>required int32 sec = 1;</code>
*/
public int getSec() {
return sec_;
}
/**
* <code>required int32 sec = 1;</code>
*/
public Builder setSec(int value) {
bitField0_ |= 0x00000001;
sec_ = value;
onChanged();
return this;
}
/**
* <code>required int32 sec = 1;</code>
*/
public Builder clearSec() {
bitField0_ = (bitField0_ & ~0x00000001);
sec_ = 0;
onChanged();
return this;
}
// required int32 nsec = 2;
private int nsec_ ;
/**
* <code>required int32 nsec = 2;</code>
*/
public boolean hasNsec() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>required int32 nsec = 2;</code>
*/
public int getNsec() {
return nsec_;
}
/**
* <code>required int32 nsec = 2;</code>
*/
public Builder setNsec(int value) {
bitField0_ |= 0x00000002;
nsec_ = value;
onChanged();
return this;
}
/**
* <code>required int32 nsec = 2;</code>
*/
public Builder clearNsec() {
bitField0_ = (bitField0_ & ~0x00000002);
nsec_ = 0;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:gazebo.msgs.Time)
}
static {
defaultInstance = new Time(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:gazebo.msgs.Time)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_gazebo_msgs_Time_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_gazebo_msgs_Time_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\ntime.proto\022\013gazebo.msgs\"!\n\004Time\022\013\n\003sec" +
"\030\001 \002(\005\022\014\n\004nsec\030\002 \002(\005B\010B\006GzTime"
};
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_Time_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_gazebo_msgs_Time_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_gazebo_msgs_Time_descriptor,
new java.lang.String[] { "Sec", "Nsec", });
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@@ -0,0 +1,546 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: string_v.proto
package gazebo.msgs;
public final class StringV {
private StringV() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface String_VOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// repeated string data = 1;
/**
* <code>repeated string data = 1;</code>
*/
java.util.List<java.lang.String>
getDataList();
/**
* <code>repeated string data = 1;</code>
*/
int getDataCount();
/**
* <code>repeated string data = 1;</code>
*/
java.lang.String getData(int index);
/**
* <code>repeated string data = 1;</code>
*/
com.google.protobuf.ByteString
getDataBytes(int index);
}
/**
* Protobuf type {@code gazebo.msgs.String_V}
*/
public static final class String_V extends
com.google.protobuf.GeneratedMessage
implements String_VOrBuilder {
// Use String_V.newBuilder() to construct.
private String_V(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private String_V(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final String_V defaultInstance;
public static String_V getDefaultInstance() {
return defaultInstance;
}
public String_V 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_V(
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: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
data_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
data_.add(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 {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
data_ = new com.google.protobuf.UnmodifiableLazyStringList(data_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.StringV.internal_static_gazebo_msgs_String_V_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.StringV.internal_static_gazebo_msgs_String_V_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.StringV.String_V.class, gazebo.msgs.StringV.String_V.Builder.class);
}
public static com.google.protobuf.Parser<String_V> PARSER =
new com.google.protobuf.AbstractParser<String_V>() {
public String_V parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new String_V(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<String_V> getParserForType() {
return PARSER;
}
// repeated string data = 1;
public static final int DATA_FIELD_NUMBER = 1;
private com.google.protobuf.LazyStringList data_;
/**
* <code>repeated string data = 1;</code>
*/
public java.util.List<java.lang.String>
getDataList() {
return data_;
}
/**
* <code>repeated string data = 1;</code>
*/
public int getDataCount() {
return data_.size();
}
/**
* <code>repeated string data = 1;</code>
*/
public java.lang.String getData(int index) {
return data_.get(index);
}
/**
* <code>repeated string data = 1;</code>
*/
public com.google.protobuf.ByteString
getDataBytes(int index) {
return data_.getByteString(index);
}
private void initFields() {
data_ = com.google.protobuf.LazyStringArrayList.EMPTY;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < data_.size(); i++) {
output.writeBytes(1, data_.getByteString(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < data_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(data_.getByteString(i));
}
size += dataSize;
size += 1 * getDataList().size();
}
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.StringV.String_V parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.StringV.String_V 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.StringV.String_V parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static gazebo.msgs.StringV.String_V parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static gazebo.msgs.StringV.String_V parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.StringV.String_V parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static gazebo.msgs.StringV.String_V parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static gazebo.msgs.StringV.String_V parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static gazebo.msgs.StringV.String_V parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static gazebo.msgs.StringV.String_V 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.StringV.String_V 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_V}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements gazebo.msgs.StringV.String_VOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return gazebo.msgs.StringV.internal_static_gazebo_msgs_String_V_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return gazebo.msgs.StringV.internal_static_gazebo_msgs_String_V_fieldAccessorTable
.ensureFieldAccessorsInitialized(
gazebo.msgs.StringV.String_V.class, gazebo.msgs.StringV.String_V.Builder.class);
}
// Construct using gazebo.msgs.StringV.String_V.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_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return gazebo.msgs.StringV.internal_static_gazebo_msgs_String_V_descriptor;
}
public gazebo.msgs.StringV.String_V getDefaultInstanceForType() {
return gazebo.msgs.StringV.String_V.getDefaultInstance();
}
public gazebo.msgs.StringV.String_V build() {
gazebo.msgs.StringV.String_V result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public gazebo.msgs.StringV.String_V buildPartial() {
gazebo.msgs.StringV.String_V result = new gazebo.msgs.StringV.String_V(this);
int from_bitField0_ = bitField0_;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
data_ = new com.google.protobuf.UnmodifiableLazyStringList(
data_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.data_ = data_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof gazebo.msgs.StringV.String_V) {
return mergeFrom((gazebo.msgs.StringV.String_V)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(gazebo.msgs.StringV.String_V other) {
if (other == gazebo.msgs.StringV.String_V.getDefaultInstance()) return this;
if (!other.data_.isEmpty()) {
if (data_.isEmpty()) {
data_ = other.data_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureDataIsMutable();
data_.addAll(other.data_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
gazebo.msgs.StringV.String_V parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (gazebo.msgs.StringV.String_V) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// repeated string data = 1;
private com.google.protobuf.LazyStringList data_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureDataIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
data_ = new com.google.protobuf.LazyStringArrayList(data_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated string data = 1;</code>
*/
public java.util.List<java.lang.String>
getDataList() {
return java.util.Collections.unmodifiableList(data_);
}
/**
* <code>repeated string data = 1;</code>
*/
public int getDataCount() {
return data_.size();
}
/**
* <code>repeated string data = 1;</code>
*/
public java.lang.String getData(int index) {
return data_.get(index);
}
/**
* <code>repeated string data = 1;</code>
*/
public com.google.protobuf.ByteString
getDataBytes(int index) {
return data_.getByteString(index);
}
/**
* <code>repeated string data = 1;</code>
*/
public Builder setData(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureDataIsMutable();
data_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated string data = 1;</code>
*/
public Builder addData(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureDataIsMutable();
data_.add(value);
onChanged();
return this;
}
/**
* <code>repeated string data = 1;</code>
*/
public Builder addAllData(
java.lang.Iterable<java.lang.String> values) {
ensureDataIsMutable();
super.addAll(values, data_);
onChanged();
return this;
}
/**
* <code>repeated string data = 1;</code>
*/
public Builder clearData() {
data_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* <code>repeated string data = 1;</code>
*/
public Builder addDataBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureDataIsMutable();
data_.add(value);
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:gazebo.msgs.String_V)
}
static {
defaultInstance = new String_V(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:gazebo.msgs.String_V)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_gazebo_msgs_String_V_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_gazebo_msgs_String_V_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\016string_v.proto\022\013gazebo.msgs\"\030\n\010String_" +
"V\022\014\n\004data\030\001 \003(\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_V_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_gazebo_msgs_String_V_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_gazebo_msgs_String_V_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)
}

View File

@@ -0,0 +1,135 @@
package org.gazebosim.transport;
import gazebo.msgs.GzPacket.Packet;
import gazebo.msgs.GzTime.Time;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.logging.Logger;
import com.google.protobuf.ByteString;
import com.google.protobuf.Message;
/**
* Manages a Gazebo protocol connection.
*
* This can connect to either the Gazebo server, or to a data
* publisher. Additionally, it can act as the TCP client, or as a
* server. In either case, it provides methods to read and write
* structured data on the socket.
*/
public class Connection {
private static int HEADER_SIZE = 8;
public String host;
public int port;
private Socket socket;
private ServerSocket ssocket;
private InputStream is;
private OutputStream os;
private static final Logger LOG = Logger.getLogger("Gazebo Transport");
public Connection() {
}
public void connect(String host, int port) throws UnknownHostException, IOException {
this.host = host;
this.port = port;
socket = new Socket(host, port);
is = socket.getInputStream();
os = socket.getOutputStream();
}
public void serve(final ServerCallback cb) throws IOException {
ssocket = new ServerSocket(0);
host = ssocket.getInetAddress().getHostAddress(); // TODO: get globally addressable name.
port = ssocket.getLocalPort();
new Thread(new Runnable() {
@Override public void run() {
LOG.config("Listening on "+host+":"+port);
while (true) {
Connection conn = new Connection();
try {
conn.socket = ssocket.accept();
conn.is = conn.socket.getInputStream();
conn.os = conn.socket.getOutputStream();
LOG.info("Handling connect from "+conn.socket.getInetAddress());
cb.handle(conn);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}).start();
}
public void close() throws IOException {
LOG.info("Closing connection");
if (socket != null) {
socket.close();
socket = null;
}
if (ssocket != null) {
ssocket.close();
ssocket = null;
}
}
public byte[] rawRead() throws IOException {
synchronized (is) {
// Figure out the message size
byte[] buff= new byte[HEADER_SIZE];
int n = is.read(buff);
if (n != HEADER_SIZE) {
LOG.severe("Only read "+n+" bytes instead of 8 for header.");
return null;
}
int size = Integer.parseInt(new String(buff), 16);
// Read in the actual message
buff = new byte[size];
n = is.read(buff);
if (n != size) {
throw new IOException("Failed to read whole message");
}
return buff;
}
}
public Packet read() throws IOException {
byte[] buff = rawRead();
if (buff == null) {
return null;
}
return Packet.parseFrom(buff);
}
public void write(Message msg) throws IOException {
ByteString data = msg.toByteString();
ByteString header = ByteString.copyFromUtf8(String.format("%08X", data.size()));
ByteString bytes = header.concat(data);
synchronized (os) {
os.write(bytes.toByteArray());
}
}
public void writePacket(String name, Message req) throws IOException {
long ms = System.currentTimeMillis();
Time t = Time.newBuilder().setSec((int) (ms / 1000)).setNsec((int) ((ms%1000)*1000)).build();
Packet pack = Packet.newBuilder().setType(name).setStamp(t)
.setSerializedData(req.toByteString()).build();
write(pack);
}
}

View File

@@ -0,0 +1,31 @@
package org.gazebosim.transport;
import gazebo.msgs.GzBool.Bool;
import gazebo.msgs.GzFloat64;
import gazebo.msgs.GzString;
public class Msgs {
public static GzString.String String() {
return GzString.String.getDefaultInstance();
}
public static GzString.String String(String s) {
return GzString.String.newBuilder().setData(s).build();
}
public static GzFloat64.Float64 Float64() {
return GzFloat64.Float64.getDefaultInstance();
}
public static GzFloat64.Float64 Float64(double d) {
return GzFloat64.Float64.newBuilder().setData(d).build();
}
public static Bool Bool() {
return Bool.getDefaultInstance();
}
public static Bool Bool(boolean b) {
return Bool.newBuilder().setData(b).build();
}
}

View File

@@ -0,0 +1,231 @@
package org.gazebosim.transport;
import gazebo.msgs.GzPacket.Packet;
import gazebo.msgs.GzPublish.Publish;
import gazebo.msgs.GzPublishers.Publishers;
import gazebo.msgs.GzString;
import gazebo.msgs.GzSubscribe.Subscribe;
import gazebo.msgs.StringV.String_V;
import java.io.IOException;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.logging.ConsoleHandler;
import java.util.logging.Formatter;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Message;
public class Node implements Runnable, ServerCallback {
private String name;
private Connection master;
private Connection server;
private List<String> namespaces;
private Map<String, PublisherRecord> publishers;
@SuppressWarnings("rawtypes")
private Map<String, Subscriber> subscriptions;
private static final Logger LOG = Logger.getLogger("Gazebo Transport");
public Node(String name) {
this.name = name;
namespaces = new LinkedList<>();
publishers = new HashMap<>();
subscriptions = new HashMap<>();
// Get rid of the excessive information
LOG.setLevel(Level.WARNING);
Handler[] handlers = LOG.getParent().getHandlers();
if (handlers[0] instanceof ConsoleHandler) {
((ConsoleHandler) handlers[0]).setFormatter(new Formatter() {
@Override public String format(LogRecord record) {
return String.format("%s|%s: %s\n", record.getLevel(), record.getLoggerName(), record.getMessage());
}
});
}
try {
master = new Connection();
master.connect("localhost", 11345);
server = new Connection();
server.serve(this);
initializeConnection();
} catch (SocketException e ) {
LOG.severe("Socket error: " + e);
return;
} catch (UnknownHostException e ) {
LOG.severe("Invalid Host");
return;
} catch (IOException e ) {
LOG.severe("I/O error: " + e);
LOG.severe(e.getStackTrace().toString());
return;
}
new Thread(this).start();
}
public <T extends Message> Publisher<T> advertise(String topic, T defaultMessage) {
topic = fixTopic(topic);
LOG.info("ADV "+topic);
String type = defaultMessage.getDescriptorForType().getFullName();
Publisher<T> pub = new Publisher<T>(topic, type, server.host, server.port);
publishers.put(topic, pub);
Publish req = Publish.newBuilder().setTopic(topic).setMsgType(type)
.setHost(server.host).setPort(server.port).build();
try {
master.writePacket("advertise", req);
} catch (IOException e) {
e.printStackTrace(); // FIXME: Shouldn't happen, should probably complain louder
}
return pub;
}
public <T extends Message> Subscriber<T>
subscribe(String topic, T defaultMessage, SubscriberCallback<T> cb) {
topic = fixTopic(topic);
LOG.info("SUB "+topic);
if (subscriptions.containsKey(topic)) {
throw new RuntimeException("Multiple subscribers for: "+topic);
}
String type = defaultMessage.getDescriptorForType().getFullName();
Subscribe req = Subscribe.newBuilder().setTopic(topic).setMsgType(type)
.setHost(server.host).setPort(server.port).setLatching(false).build();
try {
master.writePacket("subscribe", req);
} catch (IOException e) {
e.printStackTrace(); // FIXME: Shouldn't happen, should probably complain louder
}
Subscriber<T> s = new Subscriber<>(topic, type, cb, defaultMessage,
server.host, server.port);
subscriptions.put(topic, s);
for (PublisherRecord p : publishers.values()) {
if (p.getTopic().equals(topic)) {
s.connect(p);
}
}
return s;
}
@Override
public void run() {
try {
while (true) {
Packet packet = master.read();
if (packet == null) {
LOG.severe("Received null packet, shutting down connection to master.");
master.close();
return;
}
processPacket(packet);
}
} catch (IOException e ) {
LOG.severe("I/O error: " + e);
e.printStackTrace(); // FIXME: Log
}
}
private void initializeConnection() throws IOException {
Packet initData = master.read();
if (!initData.getType().equals("version_init")) {
throw new IOException("Expected 'version_init' packet, got '"+initData.getType()+"'.");
}
GzString.String version = GzString.String.parseFrom(initData.getSerializedData());
LOG.info("Version: "+version.getData()); // TODO: Check version
Packet namespaceData = master.read();
String_V ns = String_V.parseFrom(namespaceData.getSerializedData());
namespaces.addAll(ns.getDataList());
LOG.info(namespaces.toString());
Packet publisherData = master.read();
if (publisherData.getType().equals("publishers_init")) {
Publishers pubs = Publishers.parseFrom(publisherData.getSerializedData());
for (Publish pub : pubs.getPublisherList()) {
PublisherRecord record = new RemotePublisherRecord(pub);
publishers.put(record.getTopic(), record);
}
LOG.info(publishers.toString());
} else {
LOG.severe("No publisher data received.");
}
}
public void processPacket(Packet packet) throws InvalidProtocolBufferException {
if (packet.getType().equals("publisher_add")) {
PublisherRecord pub = new RemotePublisherRecord(Publish.parseFrom(packet.getSerializedData()));
if (pub.getHost().equals(server.host) && pub.getPort() == server.port) {
LOG.info("ACK "+pub.getTopic());
return; // This is us
}
LOG.info("New Publisher: "+pub.getTopic());
publishers.put(pub.getTopic(), pub);
} else if (packet.getType().equals("publisher_subscribe") ||
packet.getType().equals("publisher_advertise")) {
PublisherRecord pub = new RemotePublisherRecord(Publish.parseFrom(packet.getSerializedData()));
if (pub.getHost().equals(server.host) && pub.getPort() == server.port) {
LOG.info("Ignoring subscription request on (local) "+pub.getTopic());
return; // This is us
}
LOG.info("PUBSUB found for "+pub.getTopic());
subscriptions.get(pub.getTopic()).connect(pub);
} else if (packet.getType().equals("topic_namespace_add")) {
namespaces.add(GzString.String.parseFrom(packet.getSerializedData()).getData());
LOG.info("New Namespace: "+namespaces.get(namespaces.size()-1));
} else if (packet.getType().equals("unsubscribe")) {
Subscribe sub = Subscribe.parseFrom(packet.getSerializedData());
LOG.warning("Ignoring unsubscribe: "+sub);
} else {
LOG.warning("Can't handle "+packet.getType());
}
}
@Override
public void handle(Connection conn) throws IOException {
Packet msg = conn.read();
if (msg == null) {
LOG.severe("Read null message.");
return;
}
if (msg.getType().equals("sub")) {
Subscribe sub = Subscribe.parseFrom(msg.getSerializedData());
if (!publishers.containsKey(sub.getTopic())) {
LOG.severe("Subscription for unknown topic: "
+ sub.getTopic());
return;
}
PublisherRecord pub = publishers.get(sub.getTopic());
if (!pub.getMsgType().equals(sub.getMsgType())) {
LOG.severe(String.format("Message type mismatch requested=%d publishing=%s\n",
pub.getMsgType(), sub.getMsgType()));
return;
}
LOG.info("PUB " + sub.getTopic());
pub.connect(conn);
} else {
LOG.warning("Unknown message type: " + msg.getType());
}
}
private String fixTopic(String topic) {
return "/gazebo/" + name + "/" + topic;
}
}

View File

@@ -0,0 +1,74 @@
package org.gazebosim.transport;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import com.google.protobuf.Message;
public class Publisher<T extends Message> implements PublisherRecord {
private String topic, msgType;
private String localHost;
private int localPort;
private List<Connection> listeners;
private boolean latching = false;
private T lastMsg = null;
public Publisher(String topic, String msgType, String localHost, int localPort) {
this.topic = topic;
this.msgType = msgType;
this.localHost = localHost;
this.localPort = localPort;
listeners = new LinkedList<>();
}
public synchronized void publish(T msg) {
lastMsg = msg;
for (Connection listener : listeners) {
try {
listener.write(msg);
} catch (IOException e) {
try {
listener.close();
} catch (IOException e1) { /* Closing failed, probably not a big deal. */}
listeners.remove(listener);
}
}
}
@Override
public String getTopic() {
return topic;
}
@Override
public String getHost() {
return localHost;
}
@Override
public int getPort() {
return localPort;
}
@Override
public String getMsgType() {
return msgType;
}
@Override
public synchronized void connect(Connection conn) {
if (latching && lastMsg != null) {
try {
conn.write(lastMsg);
} catch (IOException e) {
return; // TODO: Log
}
}
listeners.add(conn);
}
public void setLatchMode(boolean b) {
latching = b;
}
}

View File

@@ -0,0 +1,9 @@
package org.gazebosim.transport;
public interface PublisherRecord {
String getTopic();
String getHost();
int getPort();
String getMsgType();
void connect(Connection conn);
}

View File

@@ -0,0 +1,40 @@
package org.gazebosim.transport;
import gazebo.msgs.GzPublish.Publish;
public class RemotePublisherRecord implements PublisherRecord {
private Publish pub;
public RemotePublisherRecord(Publish pub) {
this.pub = pub;
}
@Override
public String getTopic() {
return pub.getTopic();
}
@Override
public String getHost() {
return pub.getHost();
}
@Override
public int getPort() {
return pub.getPort();
}
@Override
public String getMsgType() {
return pub.getMsgType();
}
public String toString() {
return String.format("%s (%s) %s:%s", getTopic(), getMsgType(), getHost(), getPort());
}
@Override
public void connect(Connection conn) {
throw new RuntimeException("Someone thinks we're a remote server, can't connect.");
}
}

View File

@@ -0,0 +1,7 @@
package org.gazebosim.transport;
import java.io.IOException;
public interface ServerCallback {
void handle(Connection conn) throws IOException;
}

View File

@@ -0,0 +1,77 @@
package org.gazebosim.transport;
import gazebo.msgs.GzSubscribe.Subscribe;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Logger;
import com.google.protobuf.Message;
import com.google.protobuf.Parser;
public class Subscriber<T extends Message> {
private String topic, msgType;
private SubscriberCallback<T> cb;
private Parser<T> deserializer;
@SuppressWarnings("unused")
private String localHost;
@SuppressWarnings("unused")
private int localPort;
private List<Connection> connections;
private static final Logger LOG = Logger.getLogger("Gazebo Transport");
@SuppressWarnings("unchecked")
public Subscriber(String topic, String msgType, SubscriberCallback<T> cb,
T deserializer, String localHost, int localPort) {
this.topic = topic;
this.msgType = msgType;
this.cb = cb;
this.deserializer = (Parser<T>) deserializer.getParserForType();
this.localHost = localHost;
this.localPort = localPort;
connections = new LinkedList<>();
}
public void connect(final PublisherRecord pub) {
new Thread(new Runnable() {
@Override
public void run() {
handle_connect(pub);
}
}).start();
}
private void handle_connect(PublisherRecord pub) {
LOG.fine(String.format("CONN for %s from %s:%s\n", topic, pub.getHost(),
pub.getPort()));
Connection conn = new Connection();
try {
conn.connect(pub.getHost(), pub.getPort());
connections.add(conn);
Subscribe sub = Subscribe.newBuilder().setTopic(topic)
.setMsgType(msgType).setHost(pub.getHost())
.setPort(pub.getPort()).setLatching(false).build();
conn.writePacket("sub", sub);
while (true) {
byte[] data = conn.rawRead();
if (data == null) {
connections.remove(conn);
return;
}
T msg = deserializer.parseFrom(data);
cb.callback(msg);
}
} catch (IOException e) {
// FIXME: Connection lost, let's make sure it's closed and complain.
// Hopefully they the reconnect, maybe we should try to recover better?
try {
conn.close();
} catch (IOException e1) {
}
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,5 @@
package org.gazebosim.transport;
public interface SubscriberCallback<T> {
void callback(T msg);
}

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.wpi.first.wpilibj.simulation</groupId>
<artifactId>SimDS</artifactId>
<version>0.1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>edu.wpi.first.wpilibj.simulation.ds.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration />
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>docline-java8-disable</id>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

91
simulation/SimDS/pom.xml Normal file
View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.wpi.first.wpilibj.simulation</groupId>
<artifactId>SimDS</artifactId>
<packaging>jar</packaging>
<version>0.1.0-SNAPSHOT</version>
<profiles>
<profile>
<id>docline-java8-disable</id>
<activation>
<jdk>[1.8,</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>net.java.jinput</groupId>
<artifactId>jinput</artifactId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>org.gazebosim</groupId>
<artifactId>JavaGazebo</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<!-- TODO: Add unit tests -->
<!-- <dependency> -->
<!-- <groupId>junit</groupId> -->
<!-- <artifactId>junit</artifactId> -->
<!-- <version>4.11</version> -->
<!-- </dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>edu.wpi.first.wpilibj.simulation.ds.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<!-- put your configurations here -->
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,152 @@
package edu.wpi.first.wpilibj.simulation.ds;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionListener;
import java.util.List;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.DropMode;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import org.gazebosim.transport.Node;
import org.gazebosim.transport.Publisher;
import edu.wpi.first.wpilibj.simulation.ds.FakeJoystick;
import edu.wpi.first.wpilibj.simulation.ds.ISimJoystick;
import edu.wpi.first.wpilibj.simulation.ds.JoystickProvider;
import gazebo.msgs.GzDriverStation.DriverStation;
public class DS {
private JoystickProvider joystickProvider;
private JoystickList joysticks;
private JFrame mainframe;
private JPanel modePanel;
private ActionListener modeListener;
private ButtonGroup modes;
private JButton enable, refresh;
public enum State {
Disabled, Teleop, Autonomous, Test;
}
private boolean enabled = false;
private State state = State.Teleop;
private DriverStation.State protoState = DriverStation.State.TELEOP;
private Publisher<DriverStation> pub;
public DS(JoystickProvider joystickProvider) {
this.joystickProvider = joystickProvider;
mainframe = new JFrame();
mainframe.setTitle("FRC Simulation DriverStation");
mainframe.setLayout(new GridBagLayout());
GridBagConstraints constraints = new GridBagConstraints();
makeModeButtons(constraints);
mainframe.pack();
constraints.gridy = 1;
makeEnableButton(constraints);
constraints.gridx = 1;
constraints.gridy = 0;
makeJoystickUI(constraints);
mainframe.pack();
constraints.gridy = 1;
makeRefreshButton(constraints);
mainframe.pack();
mainframe.setVisible(true);
}
private void makeModeButtons(GridBagConstraints constraints) {
modePanel = new JPanel();
modePanel.setLayout(new BoxLayout(modePanel, BoxLayout.PAGE_AXIS));
modeListener = new ModeAction(this);
JRadioButton teleop = new JRadioButton("Teleop");
teleop.setActionCommand(State.Teleop.toString());
teleop.addActionListener(modeListener);
JRadioButton auto = new JRadioButton("Autonomous");
auto.setActionCommand(State.Autonomous.toString());
auto.addActionListener(modeListener);
JRadioButton test = new JRadioButton("Test");
test.setActionCommand(State.Test.toString());
test.addActionListener(modeListener);
teleop.setSelected(true);
modes = new ButtonGroup();
modes.add(teleop);
modes.add(auto);
modes.add(test);
modePanel.add(teleop);
modePanel.add(auto);
modePanel.add(test);
mainframe.add(modePanel, constraints);
}
private void makeEnableButton(GridBagConstraints constraints) {
enable = new JButton("Enable");
enable.addActionListener(new EnableAction(this));
enable.setPreferredSize(new Dimension(modePanel.getSize().width, 50));
mainframe.add(enable, constraints);
}
private void makeJoystickUI(GridBagConstraints constraints) {
joysticks = new JoystickList(joystickProvider);
mainframe.add(joysticks, constraints);
scanForJoysticks();
}
public void scanForJoysticks() {
joysticks.removeAll();
List<ISimJoystick> sticks = joystickProvider.scanForJoysticks();
while (sticks.size() < 4) {
sticks.add(new FakeJoystick());
}
joysticks.setListData(sticks);
}
private void makeRefreshButton(GridBagConstraints constraints) {
refresh = new JButton("Refresh Joysticks");
refresh.addActionListener(new RefreshAction(this));
refresh.setPreferredSize(new Dimension(joysticks.getSize().width, 50));
mainframe.add(refresh, constraints);
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
enable.setText(enabled ? "Disable" : "Enable");
}
public State getState() {
return enabled ? state : State.Disabled;
}
public void setState(State state) {
setEnabled(false);
this.state = state;
switch (state) {
case Autonomous: protoState = DriverStation.State.AUTO; break;
case Teleop: protoState = DriverStation.State.TELEOP; break;
case Test: protoState = DriverStation.State.TEST; break;
default: break;
}
}
public void toggleEnable() {
setEnabled(!enabled);
}
public void advertise(Node node) {
pub = node.advertise("ds/state", DriverStation.getDefaultInstance());
}
public void publish() {
pub.publish(DriverStation.newBuilder().setEnabled(enabled).setState(protoState).build());
}
}

View File

@@ -0,0 +1,18 @@
package edu.wpi.first.wpilibj.simulation.ds;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class EnableAction implements ActionListener {
private DS ds;
public EnableAction(DS ds) {
this.ds = ds;
}
@Override
public void actionPerformed(ActionEvent e) {
ds.toggleEnable();
}
}

View File

@@ -0,0 +1,19 @@
package edu.wpi.first.wpilibj.simulation.ds;
import org.gazebosim.transport.Node;
public class FakeJoystick implements ISimJoystick {
public String getName() {
return "Empty Joystick";
}
public String toString() {
return getName();
}
@Override public void advertise(Node node, int i) {}
@Override public void publish() {}
}

View File

@@ -0,0 +1,9 @@
package edu.wpi.first.wpilibj.simulation.ds;
import org.gazebosim.transport.Node;
public interface ISimJoystick {
String getName();
void advertise(Node node, int i);
void publish();
}

View File

@@ -0,0 +1,118 @@
package edu.wpi.first.wpilibj.simulation.ds;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.dnd.DragSource;
import java.awt.dnd.DragSourceDragEvent;
import java.awt.dnd.DragSourceDropEvent;
import java.awt.dnd.DragSourceEvent;
import java.awt.dnd.DragSourceListener;
import java.util.List;
import javax.swing.DropMode;
import javax.swing.JList;
import javax.swing.TransferHandler;
import edu.wpi.first.wpilibj.simulation.ds.ISimJoystick;
import edu.wpi.first.wpilibj.simulation.ds.JoystickProvider;
@SuppressWarnings("serial")
public class JoystickList extends JList<ISimJoystick> {
private JoystickProvider joystickProvider;
List<ISimJoystick> joysticks;
public JoystickList(JoystickProvider joystickProvider) {
super();
this.joystickProvider = joystickProvider;
setDragEnabled(true);
setDropMode(DropMode.INSERT);
setTransferHandler(new DropHandler(this));
new DragListener(this);
}
public void moveElement(int index, int dropTargetIndex) {
ISimJoystick move = joysticks.get(index);
joysticks.add(dropTargetIndex, move);
joysticks.remove(index < dropTargetIndex ? index : index + 1);
setListData(joysticks);
}
public void setListData(List<ISimJoystick> sticks) {
joysticks = sticks;
setListData(sticks.toArray(new ISimJoystick[0]));
joystickProvider.setJoysticks(sticks);
}
class DragListener implements DragSourceListener, DragGestureListener {
JoystickList list;
DragSource ds = new DragSource();
public DragListener(JoystickList list) {
this.list = list;
ds.createDefaultDragGestureRecognizer(
list, DnDConstants.ACTION_MOVE, this);
}
public void dragGestureRecognized(DragGestureEvent dge) {
StringSelection transferable = new StringSelection(
Integer.toString(list.getSelectedIndex()));
ds.startDrag(dge, DragSource.DefaultCopyDrop, transferable, this);
}
public void dragEnter(DragSourceDragEvent dsde) {}
public void dragExit(DragSourceEvent dse) {}
public void dragOver(DragSourceDragEvent dsde) {}
public void dragDropEnd(DragSourceDropEvent dsde) {}
public void dropActionChanged(DragSourceDragEvent dsde) {}
}
class DropHandler extends TransferHandler {
JoystickList list;
public DropHandler(JoystickList list) {
this.list = list;
}
public boolean canImport(TransferHandler.TransferSupport support) {
if (!support.isDataFlavorSupported(DataFlavor.stringFlavor)) {
return false;
}
JList.DropLocation dl = (JList.DropLocation) support
.getDropLocation();
if (dl.getIndex() == -1) {
return false;
} else {
return true;
}
}
public boolean importData(TransferHandler.TransferSupport support) {
if (!canImport(support)) {
return false;
}
Transferable transferable = support.getTransferable();
String indexString;
try {
indexString = (String) transferable.getTransferData(DataFlavor.stringFlavor);
} catch (Exception e) {
return false;
}
int index = Integer.parseInt(indexString);
JList.DropLocation dl = (JList.DropLocation) support.getDropLocation();
int dropTargetIndex = dl.getIndex();
list.moveElement(index, dropTargetIndex);
return true;
}
}
}

View File

@@ -0,0 +1,44 @@
package edu.wpi.first.wpilibj.simulation.ds;
import java.util.ArrayList;
import java.util.List;
import edu.wpi.first.wpilibj.simulation.ds.ISimJoystick;
import edu.wpi.first.wpilibj.simulation.ds.SimJoystick;
import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;
public class JoystickProvider {
List<ISimJoystick> joysticks;
public JoystickProvider() {
scanForJoysticks();
}
public List<ISimJoystick> scanForJoysticks() {
List<ISimJoystick> foundControllers = new ArrayList<>();
Controller[] controllers = ControllerEnvironment.getDefaultEnvironment().getControllers();
for(int i = 0; i < controllers.length; i++){
Controller controller = controllers[i];
if (controller.getType() == Controller.Type.STICK
|| controller.getType() == Controller.Type.GAMEPAD
|| controller.getType() == Controller.Type.WHEEL
|| controller.getType() == Controller.Type.FINGERSTICK) {
foundControllers.add(new SimJoystick(controller));
}
}
joysticks = foundControllers;
return foundControllers;
}
public List<ISimJoystick> getJoysticks() {
return joysticks;
}
public void setJoysticks(List<ISimJoystick> joysticks) {
this.joysticks = joysticks;
}
}

View File

@@ -0,0 +1,29 @@
package edu.wpi.first.wpilibj.simulation.ds;
import org.gazebosim.transport.Node;
public class Main {
public static void main(String args[]) {
Node node = new Node("frc");
JoystickProvider provider = new JoystickProvider();
@SuppressWarnings("unused")
DS ds = new DS(provider);
ds.advertise(node);
while (true) {
ds.publish();
for (int i = 0; i < provider.getJoysticks().size(); i++) {
ISimJoystick joystick = provider.getJoysticks().get(i);
joystick.advertise(node, i+1);
joystick.publish();
}
try {
Thread.sleep(19);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}

View File

@@ -0,0 +1,18 @@
package edu.wpi.first.wpilibj.simulation.ds;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class ModeAction implements ActionListener {
private DS ds;
public ModeAction(DS ds) {
this.ds = ds;
}
@Override
public void actionPerformed(ActionEvent e) {
ds.setState(DS.State.valueOf(e.getActionCommand()));
}
}

View File

@@ -0,0 +1,18 @@
package edu.wpi.first.wpilibj.simulation.ds;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class RefreshAction implements ActionListener {
private DS ds;
public RefreshAction(DS ds) {
this.ds = ds;
}
@Override
public void actionPerformed(ActionEvent arg0) {
ds.scanForJoysticks();
}
}

View File

@@ -0,0 +1,69 @@
package edu.wpi.first.wpilibj.simulation.ds;
import gazebo.msgs.GzJoystick.Joystick;
import java.util.ArrayList;
import java.util.List;
import org.gazebosim.transport.Node;
import org.gazebosim.transport.Publisher;
import net.java.games.input.Component;
import net.java.games.input.Controller;
public class SimJoystick implements ISimJoystick {
private Controller controller;
private List<Component> axes, buttons;
private Publisher<Joystick> pub = null;
private int prevI = -1; private Node prevNode = null;
public SimJoystick(Controller controller) {
this.controller = controller;
axes = new ArrayList<>();
buttons = new ArrayList<>();
for(Component c : controller.getComponents()) {
if (c.getIdentifier() instanceof Component.Identifier.Axis) {
axes.add(c);
} else if (c.getIdentifier() instanceof Component.Identifier.Button) {
buttons.add(c);
}
}
}
@Override
public String getName() {
return controller.getName();
}
@Override
public String toString() {
return getName();
}
@Override
public void advertise(Node node, int i) {
if (pub == null) {
// I'm good
} else if (prevI != i || prevNode != node) {
// TODO: pub.close();
} else {
return; // No change
}
pub = node.advertise("ds/joysticks/"+i, Joystick.getDefaultInstance());
prevNode = node;
prevI = i;
}
@Override
public void publish() {
controller.poll();
Joystick.Builder builder = Joystick.newBuilder();
for (Component a : axes) {
builder.addAxes(a.getPollData());
}
for (Component b : buttons) {
builder.addButtons(b.getPollData() > 0.5);
}
pub.publish(builder.build());
}
}

42
simulation/debs/.gitignore vendored Normal file
View File

@@ -0,0 +1,42 @@
# General
*.log
build/
screensteps/
trash/
# TMP
*/*/debian/files
*/*/models/
*/*/worlds
*/*/plugins/
*/*/features/
*/*/src/
*/*/devel/
*/*/.*
*/*/include/
*/*/msgs/
# General Build Artifacts
*.dsc
*.deb
*.orig.tar.gz
*.debian.tar.gz
*.changes
*.build
*.substvars
*/*/debian/*/DEBIAN/
# Specific Build Artifacts
frcsim-gazebo-plugins/frcsim-gazebo-plugins/debian/frcsim-gazebo-plugins/
frcsim-gazebo-models/frcsim-gazebo-models/debian/frcsim-gazebo-models/
frcsim-eclipse-plugins/frcsim-eclipse-plugins/debian/frcsim-eclipse-plugins/
frcsim-eclipse-toolchain-plugin/frcsim-eclipse-toolchain-plugin/debian/frcsim-eclipse-toolchain-plugin/
frcsim/frcsim/debian/frcsim/
frcsim-libwpilibsim-cpp/frcsim-libwpilibsim-cpp/debian/frcsim-libwpilibsim-cpp/
frcsim-libwpilibsim-cpp/frcsim-libwpilibsim-cpp/Makefile
frcsim-libwpilibsim-cpp/frcsim-libwpilibsim-cpp/CMakeLists.txt
# Generated Repository
repository/db/
repository/dists/

102
simulation/debs/Makefile Normal file
View File

@@ -0,0 +1,102 @@
codename=trusty
allwpilib=../..
version=0.1
package-version=1
gazebo-plugins-version=$(version)
gazebo-plugins-package-version=$(gazebo-plugins-version)-$(package-version)
gazebo-models-version=$(version)
gazebo-models-package-version=$(gazebo-models-version)-$(package-version)
eclipse-plugins-version=$(version)
eclipse-plugins-package-version=$(eclipse-plugins-version)-$(package-version)
eclipse-toolchain-version=$(version)
eclipse-toolchain-package-version=$(eclipse-toolchain-version)-$(package-version)
libwpilibsim-version=$(version)
libwpilibsim-package-version=$(libwpilibsim-version)-$(package-version)
frcsim-version=$(version)
frcsim-package-version=$(frcsim-version)-$(package-version)
all: debs update-repository
allwpilib:
cd $(allwpilib) && mvn -T 8 clean package -Dwith-eclipse-plugins -DskipTests -DskipIT
orig: clean
cd frcsim-gazebo-plugins && tar --exclude="./debian" -czvf \
frcsim-gazebo-plugins_${gazebo-plugins-version}.orig.tar.gz frcsim-gazebo-plugins
cd frcsim-gazebo-models && tar --exclude="./debian" -czvf \
frcsim-gazebo-models_${gazebo-models-version}.orig.tar.gz frcsim-gazebo-models
cd frcsim-eclipse-plugins && tar --exclude="./debian" -czvf \
frcsim-eclipse-plugins_${eclipse-plugins-version}.orig.tar.gz frcsim-eclipse-plugins
cd frcsim-eclipse-toolchain-plugin && tar --exclude="./debian" -czvf \
frcsim-eclipse-toolchain-plugin_${eclipse-toolchain-version}.orig.tar.gz frcsim-eclipse-toolchain-plugin
cd frcsim-libwpilibsim-cpp && tar --exclude="./debian" -czvf \
frcsim-libwpilibsim-cpp_${libwpilibsim-version}.orig.tar.gz frcsim-libwpilibsim-cpp
cd frcsim && tar --exclude="./debian" -czvf \
frcsim_${frcsim-version}.orig.tar.gz frcsim
debs:
cd frcsim-gazebo-plugins/frcsim-gazebo-plugins && debuild -us -uc -iamd64
cd frcsim-gazebo-models/frcsim-gazebo-models && debuild -us -uc
cd frcsim-eclipse-plugins/frcsim-eclipse-plugins && debuild -us -uc
cd frcsim-eclipse-toolchain-plugin/frcsim-eclipse-toolchain-plugin && debuild -us -uc
cd frcsim-libwpilibsim-cpp/frcsim-libwpilibsim-cpp && debuild -us -uc
cd frcsim/frcsim && debuild -us -uc
update-repository: clean-repository
cd repository && reprepro includedeb $(codename) ../frcsim-gazebo-plugins/frcsim-gazebo-plugins_$(gazebo-plugins-package-version)_amd64.deb
cd repository && reprepro includedeb $(codename) ../frcsim-gazebo-models/frcsim-gazebo-models_$(gazebo-models-package-version)_all.deb
cd repository && reprepro includedeb $(codename) ../frcsim-eclipse-plugins/frcsim-eclipse-plugins_$(eclipse-plugins-package-version)_all.deb
cd repository && reprepro includedeb $(codename) ../frcsim-eclipse-toolchain-plugin/frcsim-eclipse-toolchain-plugin_$(eclipse-toolchain-package-version)_all.deb
cd repository && reprepro includedeb $(codename) ../frcsim-libwpilibsim-cpp/frcsim-libwpilibsim-cpp_$(libwpilibsim-package-version)_amd64.deb
cd repository && reprepro includedeb $(codename) ../frcsim/frcsim_$(frcsim-package-version)_all.deb
clean-repository:
cd repository && reprepro remove $(codename) frcsim-gazebo-plugins
cd repository && reprepro remove $(codename) frcsim-gazebo-models
cd repository && reprepro remove $(codename) frcsim-eclipse-plugins
cd repository && reprepro remove $(codename) frcsim-eclipse-toolchain-plugin
cd repository && reprepro remove $(codename) frcsim-libwpilibsim-cpp
cd repository && reprepro remove $(codename) frcsim
clean:
cd frcsim-gazebo-plugins/frcsim-gazebo-plugins && debuild clean
cd frcsim-gazebo-models/frcsim-gazebo-models && debuild clean
cd frcsim-eclipse-plugins/frcsim-eclipse-plugins && debuild clean
cd frcsim-eclipse-toolchain-plugin/frcsim-eclipse-toolchain-plugin && debuild clean
cd frcsim-libwpilibsim-cpp/frcsim-libwpilibsim-cpp && debuild clean
cd frcsim/frcsim && debuild clean
rm -f frcsim-gazebo-plugins/frcsim-gazebo-plugins_$(gazebo-plugins-package-version).orig.tar.gz
rm -f frcsim-gazebo-models/frcsim-gazebo-models_$(gazebo-models-package-version).orig.tar.gz
rm -f frcsim-eclipse-plugins/frcsim-eclipse-plugins_$(eclipse-plugins-package-version).orig.tar.gz
rm -f frcsim-eclipse-toolchain-plugin/frcsim-eclipse-toolchain-plugin_$(eclipse-toolchain-package-version).orig.tar.gz
rm -f frcsim-libwpilib-cpp/frcsim-libwpilib-cpp_$(libwpilibsim-version).orig.tar.gz
rm -f frcsim/frcsim_$(frcsim-package-version).orig.tar.gz
pull: pull-gazebo-plugins pull-eclipse-plugins pull-libwpilibsim-cpp orig
pull-gazebo-plugins:
cp -rf -t frcsim-gazebo-plugins/frcsim-gazebo-plugins/ $(allwpilib)/simulation/frc_gazebo_plugin/*
echo Increment version?
pull-eclipse-plugins:
rm -rf frcsim-eclipse-plugins/frcsim-eclipse-plugins/plugins
rm -rf frcsim-eclipse-plugins/frcsim-eclipse-plugins/features
mkdir -p frcsim-eclipse-plugins/frcsim-eclipse-plugins/plugins
mkdir -p frcsim-eclipse-plugins/frcsim-eclipse-plugins/features
cp $(allwpilib)/eclipse-plugins/edu.wpi.first.wpilib.plugins.updatesite/target/site/plugins/edu.wpi.first.wpilib.plugins.java_* frcsim-eclipse-plugins/frcsim-eclipse-plugins/plugins
cp $(allwpilib)/eclipse-plugins/edu.wpi.first.wpilib.plugins.updatesite/target/site/plugins/edu.wpi.first.wpilib.plugins.cpp_* frcsim-eclipse-plugins/frcsim-eclipse-plugins/plugins
cp $(allwpilib)/eclipse-plugins/edu.wpi.first.wpilib.plugins.updatesite/target/site/plugins/edu.wpi.first.wpilib.plugins.core_* frcsim-eclipse-plugins/frcsim-eclipse-plugins/plugins
cp $(allwpilib)/eclipse-plugins/edu.wpi.first.wpilib.plugins.updatesite/target/site/features/edu.wpi.first.wpilib.plugins.java.feature_* frcsim-eclipse-plugins/frcsim-eclipse-plugins/features
cp $(allwpilib)/eclipse-plugins/edu.wpi.first.wpilib.plugins.updatesite/target/site/features/edu.wpi.first.wpilib.plugins.cpp.feature_* frcsim-eclipse-plugins/frcsim-eclipse-plugins/features
cp $(allwpilib)/eclipse-plugins/edu.wpi.first.wpilib.plugins.updatesite/target/site/features/edu.wpi.first.wpilib.plugins.core.feature_* frcsim-eclipse-plugins/frcsim-eclipse-plugins/features
echo Increment version?
pull-libwpilibsim-cpp:
cp -rf -t frcsim-libwpilibsim-cpp/frcsim-libwpilibsim-cpp/ $(allwpilib)/wpilibc/wpilibC++Sim/*
echo Increment version?
deploy:
rsync -r -v -C -p repository/ adhenning@ccc.wpi.edu:public_html/frcsim/

View File

@@ -0,0 +1,20 @@
* Setting up apt-repository
: sudo apt-get install reprepro
http://kaivanov.blogspot.com/2012/08/creating-apt-repository-with-reprepro.html
** One-Time
- Get signing key
: gpg --armor --output frcsim.key --export
** To build and add debs
: make
: rsync -r repository/ adhenning@ccc.wpi.edu:public_html/frcsim # Syncs repo
** To use
: sudo nano /etc/apt/sources.list.d/frcsim-latest.list
: deb http://users.wpi.edu/~adhenning/frcsim raring main
: deb-src http://users.wpi.edu/~adhenning/frcsim raring main
: curl -H GET users.wpi.edu/~adhenning/frcsim.key | sudo apt-key add -
: sudo apt-get update
: sudo apt-get install frcsim

View File

@@ -0,0 +1,16 @@
prefix = /usr
eclipsedir = $(prefix)/share/eclipse/dropins/frcsim
plugindir = $(eclipsedir)/plugins
featuredir = $(eclipsedir)/features
all: clean
sh ./genfeatures.sh
clean:
rm -rf build
install: all
mkdir -p $(DESTDIR)$(plugindir)
mkdir -p $(DESTDIR)$(featuredir)
install plugins/** $(DESTDIR)$(plugindir)
cp -r build/features/** $(DESTDIR)$(featuredir)

View File

@@ -0,0 +1,5 @@
frcsim-eclipse-plugins (0.1-1) trusty; urgency=low
* Initial release.
-- Alex Henning <alex@thoriumrobotics.com> Wed, 14 May 2014 21:04:27 -0400

View File

@@ -0,0 +1,13 @@
Source: frcsim-eclipse-plugins
Maintainer: Alex Henning <alex@thoriumrobotics.com>
Section: misc
Priority: optional
Standards-Version: 3.9.4
Build-Depends: debhelper (>= 9)
Package: frcsim-eclipse-plugins
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, eclipse, eclipse-jdt, eclipse-cdt, eclipse-rse, eclipse-cdt-launch-remote, frcsim-eclipse-toolchain-plugin, g++, libwebkitgtk-1.0-0, frcsim-libwpilibsim-cpp
Description: FRC plugin for developing code for RoboRIO and WPILibSim.
This plugin allows the usage of eclipse for development of WPILib
robot code for the RoboRIO and simulation in gazebo.

View File

@@ -0,0 +1,25 @@
Copyright
Copyright (c) 2009 FIRST
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the FIRST nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,3 @@
#!/usr/bin/make -f
%:
dh $@

View File

@@ -0,0 +1,8 @@
mkdir -p build/zips/features
mkdir -p build/features
for i in features/*.jar; do
echo $i
cp $i build/zips/$i.zip;
mkdir build/$i
unzip build/zips/$i.zip -d build/$i
done

View File

@@ -0,0 +1 @@
0.1.1

View File

@@ -0,0 +1,16 @@
prefix = /usr
eclipsedir = $(prefix)/share/eclipse/dropins/frcsim
plugindir = $(eclipsedir)/plugins
featuredir = $(eclipsedir)/features
all: clean
sh ./genfeatures.sh
clean:
rm -rf build
install: all
mkdir -p $(DESTDIR)$(plugindir)
mkdir -p $(DESTDIR)$(featuredir)
install plugins/** $(DESTDIR)$(plugindir)
cp -r build/features/** $(DESTDIR)$(featuredir)

View File

@@ -0,0 +1,5 @@
frcsim-eclipse-toolchain-plugin (0.1-1) trusty; urgency=low
* Initial release.
-- Alex Henning <alex@thoriumrobotics.com> Wed, 14 May 2014 21:04:27 -0400

View File

@@ -0,0 +1,13 @@
Source: frcsim-eclipse-toolchain-plugin
Maintainer: Alex Henning <alex@thoriumrobotics.com>
Section: misc
Priority: optional
Standards-Version: 3.9.4
Build-Depends: debhelper (>= 9)
Package: frcsim-eclipse-toolchain-plugin
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, eclipse, eclipse-jdt, eclipse-cdt
Description: FRC plugin for developing code for RoboRIO and WPILibSim.
This plugin allows the usage of eclipse for development of WPILib
robot code for the RoboRIO and simulation in gazebo.

View File

@@ -0,0 +1,25 @@
Copyright
Copyright (c) 2009 FIRST
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the FIRST nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,3 @@
#!/usr/bin/make -f
%:
dh $@

View File

@@ -0,0 +1,8 @@
mkdir -p build/zips/features
mkdir -p build/features
for i in features/*.jar; do
echo $i
cp $i build/zips/$i.zip;
mkdir build/$i
unzip build/zips/$i.zip -d build/$i
done

View File

@@ -0,0 +1,16 @@
prefix = /usr
frcsimdir = $(prefix)/share/frcsim
modeldir = $(frcsimdir)/models
worlddir = $(frcsimdir)/worlds
all:
echo Should download files
clean:
echo Cleaning
install: all
mkdir -p $(DESTDIR)$(modeldir)
mkdir -p $(DESTDIR)$(worlddir)
cp -r models/** $(DESTDIR)$(modeldir)
cp -r worlds/** $(DESTDIR)$(worlddir)

View File

@@ -0,0 +1,5 @@
frcsim-gazebo-models (0.1-1) trusty; urgency=low
* Initial release.
-- Alex Henning <alex@thoriumrobotics.com> Wed, 14 May 2014 17:13:26 -0400

View File

@@ -0,0 +1,13 @@
Source: frcsim-gazebo-models
Maintainer: Alex Henning <alex@thoriumrobotics.com>
Section: misc
Priority: optional
Standards-Version: 3.9.4
Build-Depends: debhelper (>= 9)
Package: frcsim-gazebo-models
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, frcsim-gazebo-plugins
Description: FRC models that can be used in Gazebo.
Models that can be used in Gazebo to simulate FRC-like
robots are controllable through WPILibSim (Java or C++)

View File

@@ -0,0 +1,25 @@
Copyright
Copyright (c) 2009 FIRST
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the FIRST nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,3 @@
#!/usr/bin/make -f
%:
dh $@

View File

@@ -0,0 +1 @@
3.0 (quilt)

View File

@@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 2.8.3)
project(frc_gazebo_plugin)
include (FindPkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(GAZEBO gazebo)
endif()
find_package(gazebo REQUIRED)
file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.cc)
include_directories(src ${Boost_INCLUDE_DIR} ${GAZEBO_INCLUDE_DIRS})
add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
link_directories(${GAZEBO_LIBRARY_DIRS})
target_link_libraries(${PROJECT_NAME} ${GAZEBO_LIBRARIES} tinyxml2)

View File

@@ -0,0 +1,15 @@
prefix = /usr
lib.dir = $(prefix)/lib
plugin.dir = $(lib.dir)/frcsim/plugins
build.dir = build
all:
mkdir -p $(build.dir)
cd ${build.dir} && cmake .. && make
clean:
rm -rf $(build.dir)
install: all
mkdir -p $(DESTDIR)$(plugin.dir)
install $(build.dir)/libfrc_gazebo_plugin.so $(DESTDIR)$(plugin.dir)

View File

@@ -0,0 +1 @@
protoc --cpp_out=src/ msgs/float64.proto

View File

@@ -0,0 +1,5 @@
frcsim-gazebo-plugins (0.1-1) trusty; urgency=low
* Initial release
-- Alex Henning <alex@thoriumrobotics.com> Wed, 14 May 2014 16:22:26 -0400

View File

@@ -0,0 +1,13 @@
Source: frcsim-gazebo-plugins
Maintainer: Alex Henning <alex@thoriumrobotics.com>
Section: misc
Priority: optional
Standards-Version: 3.9.4
Build-Depends: debhelper (>= 9), ros-indigo-ros-base, gazebo2, libtinyxml2-dev
Package: frcsim-gazebo-plugins
Architecture: i386 amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, gazebo2, libtinyxml2-dev
Description: FRC plugin for controlling robots in the gazebo plugin.
This plugin allows robots in gazebo to communicate with WPILib
programs and enables the control of the robots.

View File

@@ -0,0 +1,25 @@
Copyright
Copyright (c) 2009 FIRST
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the FIRST nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,3 @@
#!/usr/bin/make -f
%:
dh $@

View File

@@ -0,0 +1,15 @@
package gazebo.msgs;
/// \ingroup gazebo_msgs
/// \interface Float64
/// \brief A message for floating point data
/// \verbatim
option java_outer_classname = "GzFloat64";
message Float64
{
required double data = 1;
}
/// \endverbatim

View File

@@ -0,0 +1,5 @@
frcsim-libwpilibsim-cpp (0.1-1) trusty; urgency=low
* Initial release.
-- Alex Henning <alex@thoriumrobotics.com> Wed, 06 June 2014 21:04:27 -0400

View File

@@ -0,0 +1,13 @@
Source: frcsim-libwpilibsim-cpp
Maintainer: Alex Henning <alex@thoriumrobotics.com>
Section: misc
Priority: optional
Standards-Version: 3.9.4
Build-Depends: debhelper (>= 9)
Package: frcsim-libwpilibsim-cpp
Architecture: i386 amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, libboost-system-dev, libprotobuf-dev
Description: Installs `libWPILibSim.so`.
Install platform specific libWPILibSim library necessary to run C++
frcsim programs.

View File

@@ -0,0 +1,25 @@
Copyright
Copyright (c) 2009 FIRST
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the FIRST nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,9 @@
#!/usr/bin/make -f
%:
dh $@
override_dh_auto_build:
$(MAKE) allwpilib=../../../..
override_dh_auto_install:
$(MAKE) DESTDIR=$$(pwd)/debian/frcsim-libwpilibsim-cpp allwpilib=../../../.. install

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.wpi.first.wpilibc.simulation</groupId>
<artifactId>WPILibCSim</artifactId>
<version>0.1.0</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>zip-cpp-sim-includes</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<mkdir dir="${project.build.directory}/sim-includes/sim/include"/>
<copy todir="${project.build.directory}/sim-includes/sim/include">
<fileset dir="include"/>
<fileset dir="../../networktables/cpp/include"/>
<fileset dir="../../hal/include"/>
</copy>
<zip destfile="${project.build.directory}/${project.build.finalName}.zip"
basedir="${project.build.directory}/sim-includes" />
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>zip-cpp-includes</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/${project.build.finalName}.zip</file>
<type>zip</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,97 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.12 (GNU/Linux)
mQGiBEsnpscRBACyclffkMVkXXdtY2qTT2+B6HN4hBoUxBwZBULyHFuSP9lsB7wK
16Hl5ZTu+oy+GegzzFRrHWxBLN9i67T0plNkqDJhWUrmXR7xvX+dFc+Qrl+uPR0i
CY1NMnWwnFh01YtYb9NAlb3bLn8RLBH8Zo60i7wfwdW9Wi1mgzmUT/UI9wCg7y6R
VmF4RjNWJ2WRdL/jVeAB8H0D/0xfePoYWrSGzOp7+Vl+xYo5TdSrzohUUnly6xla
UIKwlBCG/jpQqKH17803GpkFyh5FxG1Db7VWsciDv7flcBLPtn75gU2fPHXL+gnv
r1eJ+ugQwCl4/8d4iJ5TMXmHQOW2Pd0U47OmbZYNNgtA+lXhF8n8+6w3GRhqubLF
/9b/A/4wH37bv1shLhdLpP+9WYHc8z9+jmStVUFdAGoD/n6vOpBX+GQYaEY5Y8RS
Wf0DFhMF6CFYNZ2ngDyvPt53M2jU7hrxXIfs/b5bLMqG2et9M/avdEWGUKTsC7wu
0zeGtD07r9EA3WDIhxN9QEGZAq5Q3NSbedMHIVE4Ynq7VNCdsrQ0SFBMSVAgKEhQ
IExpbnV4IEltYWdpbmcgYW5kIFByaW50aW5nKSA8aHBsaXBAaHAuY29tPohgBBMR
AgAgBQJLJ6bHAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQc9dwzaWQR7n4
dQCghZgIpxuTC+GhiQIO0dK9wTlbMmoAoOB252fEOvf73v8Ya8qmN1GlmYiXiJwE
EAECAAYFAk7UORAACgkQnsV5kCcUcIjUuAP8D2rK0KZyA0uHyap2BkF5U4wm6qQ3
p27K0hh50dZMIMSt3FH0TpW994jaoqBKqrHBk3U+/ZT4tD43hmaqc+XmnYNrNMRO
KBwkjEzKeKaOBXd1I5Tid0I2u1L6bl5IlQzujbWsn/5YbWypLlZhf3Hxg8uuHYu9
kiQLYM4jqIi0YgSJARwEEAECAAYFAk3NP24ACgkQd7E6jROY7coc8Af8DYe87G2u
OSSPGkebecci11oTX9mudvDCQkuTFBcGPlMnPl6bn5QcMjBxuAm2TO0mYlR0QcPU
vQ+tNypw4AZGfsgnvG1EsxSfTgiR6tD2KdIZD8GJw/GudmtUgF3sZkw1txLkk57u
YufHc9u56oMvntAaU7nisosE1rdqON9fLf+tqvMcrX2+8tDHobfimltC+J+F5dyx
Cnef+zB9/+dzAAjiunicNZ35zv9tKBh83kECPUpScpHjrXxAqdSHrNlnjGZdmiFB
0luSbPCIF8sYyLYb5W+Sw1t7WsZ1XRgq67gTV8Vw2o9jw10a/vclwFHeVEtius6g
Cj0CwkJ1uRuiLokCHAQQAQgABgUCUyRUlQAKCRAiOiyqVhRgQO6aEACMI+JH0ZVW
WxbaV5aNC+64kMIXRdOZEoRFoTW2i0B0yoLLjQbHnnt+wxTa18PXVYG8KZPzcLiD
TsZrt75cA+6xE1iu9HpTdJD08aiJE7EKV4tVZGpg65SkpU3HQ8X4YfGaT7jgutyK
66AUBYDXhxO0sx/sSsth0k3veUIaSwBncmP/S+/rguWhiU2d8MOtNtnCcTe9q7+y
n2KyRrhPlLVpJDAKeHTaULiUyLFCjHLHm84o6hiaoR3C/d/d+kC5g/ntPwXGP8vV
7W/Y3A8ZjhNjgVen3w1EgR/aCjHCHo3sry9Cs7IVb7kLdWhomSnwmYYLdbIXJbXe
IQRMMcYYt1gsia8s1tyK8rAGHCTCWebG6Y1sbNolG2peaTNrC9YnPwweT0TwcPzV
Pyj5+aZAwnnMQDajbxLmzmgjyybF+OkqFvDHEycYiM1v6TwAuw+Ols7/faK6XBIU
9O/YWwhLOULpM2P7Z7hn9u/xGfdM6O0xZyPiiQKlaBH7r8utvNM2BpsDIvbVYCuJ
YOyt4r1jhqf/EAkck2mEg7b55lEpJPjO6JQG3+OUuJHBpWtZFGKFBBP+vKvDURs7
cqk40m3laINIFyoUo0DaWdITdXD9rj90jNpYrVZKTqL9TsVuo2VcCBdYq1q8cNLy
GwRfhRlEfrL8wHHm5BF1bJ8lK3oWrU9yqLkCDQRLJ6bHEAgAhDv8Ifl/QKaJONb5
/qm8uWC70rlzXLm9YlUpbAcr/tvCkG271wzT4Sz/cHTvQ5s3yBsGq49Li7Z9IfVF
k5xKV0mdGyiZwmHOxmaVL3DcoyLkrOvYStqy3d/DEm9YaAWiAi42REVIXvmRsJce
87wCIIY/rLNbncKXOj3HTzWopqfnJPf/nkqYqwWbFkQxMmGfK9E84dLwjGRtwCWb
5uN/YLM3uSJrwLfsRZbmEQhzAJF2mIplwIqR3R7naruQdfyjad5EXOvKQ8P5MxUi
eGxHUlv90LuYCcW+MvVw0zIqchbdWGaz+LGCTRDAIyJZZzB6kLCuHn3TWPyUpPds
BI5jfwAECwf+Nl+UUqw0HPZP9kXYG0VED1wFxWEckgzLeF32kDQGIlNp0NbYcSbi
8xS56fFbpszA+LZrJgTZmnFRUwDCclma7punj3b8nM0gRtHvuLentmAhnQPIX8SW
DRwhBNIujSOxQrtjjw6oFyrMlYqpe73IUAAINzeCCwZXKDvOiTgm7oI/mI6fJiNr
c8NqNxhGS4Bzw/rexAhZngekMqR9Nglxk7EzUOqrffc6/Orq1fE2t/UNAOqVVfNX
5F2hiINXi1+ywhOYOJVfQ/xuil2FmI7txAc/7XmUcqxNwayjOzBKlVHIAcIyLMAT
w3yRVvh+gezGvUbE9HnyYHq7nO9dmenM7YhJBBgRAgAJBQJLJ6bHAhsMAAoJEHPX
cM2lkEe5pLMAnA/kDShHCzfV5loZcyX8M41tzSYDAJ4jUTgQV69+3QpJmsE3GoCk
sIYlMZkCDQRTdNZlARAAoxFGU8l2Ab8byV4UOZE1uVR+euj2oMcTcnspO7cALEEs
xxNWYOoSmQLZtpv5eDAZp1EW9SPAuWkZ0RMj+mhiHxTqU1EYTCUzVYo+3qjfVzds
6SVw566fM4E0X2n29ABOOBWQ9Y5RJivB5s1yTaPNptUBeitbJOc8oDfa9raqkvm0
1/MFLlmMNwEbsBgvgZnjbhNTJIVta/fHc2mGvSL/p1m8XZmIM+xh3XY7wo7aqhx8
v9QuAWr7SgzwKmHH7JyT76qBo07DnM6bIvQHV+grgFAeU9qATawFob7qqqmDDttu
ajzd8/k+x07MswR30qNj0ufahuq5ttjuhVHGptwhjYmZVuJWrxsEWCWT/WkZp6AL
76094revWr3KRzuEbw2LJWLOEo4ePQpj4gBmNl3dPi9Hs936si7QIr/AJWyhgpi+
Kc4Dz8qA6elJ1T0gdaPPppK8n+ErNoBVJn0D5m1iUS3u7aSoyaTtlTjDeZgZYXAh
AX4uVNJl/4CwgPBBlpwJ+KpCcaQfA5P8Zgmdmp8rZfjfHmMWs4+CVgyEHUPD3NEY
0wlbwBNUW+ruqkaB/k8HkXfJF5hCAjUjmHeYXjeUfNr3qzmmivzXe/9PwJ2ldBRc
LTSMt7RuBGuE0wyFoTNQgbnmIySIWI+t+huu/7fGIp2hb53OMukk20plkLKXyyUA
EQEAAbQnQWxleCBIZW5uaW5nIDxhbGV4QHRob3JpdW1yb2JvdGljcy5jb20+iQI4
BBMBAgAiBQJTdNZlAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRDFiL18
E/NeP2mTD/4w8iqmfxlEGlFA0MpcmYk3TKaUUR7iBNdxEIS/3ed35G8tlttrZoTm
AqDsyZGTzDgbcwYa9Brrz+SRx3JSCa0mkhnMuXkwjVRR+31UsYlK3sVEUW8OAMtZ
QMVTfoGke1SX7QrTUIIBQmWeARiIoarAuWfCeVVHMng2ytIDbrFBtaKNTRjz4i47
an0Yh0V0GvZE/3lv2ZVdJyVR+bxTZp2ECPWQyY8838w7iqvGJTm0akBt43IcaseI
vlPDuhpzNYaK1yHeQ1yahMV8EYSBImUfJdhN5HGvNzM+NNpSGugqD7XB5edQEVKv
kCyd+QXEddmozzh3Ga2sIzK+Yj84WHFzBX9riAkwpY2GyEmAEShw2lAK4KZGhYFS
iUfeADy2rn7bpXIYp29fQA2xqGUQWgXi6Eii4eOOyFMJ6LxIeMtwMRhZ7tJmgD9y
6PnaczyiLyIk/zE32KkgSsKUvrlIYE+gFayleYPFmgl7UtmvnFcqLZUZsB3FfjyN
DdKT3g2qMSjsGh7B5jd5HbH+kEJV87opNyMtcnCZ1kcsA2p8a1FDpw847NDwg/o1
q9JCEh7oA4lqUR5S/MhRkfUhGLlqXoi+FCgYJcG/jBejr04CKTI7dx6ndJisUuBU
PU9pdJz6KF8YM2AiCGvvFWecuWsaF+frEpYspsxS+O7tzr+3zMxJobkCDQRTdNZl
ARAA1j8K1g58SdeQpXY0NUJSMEGXE5Ct5cIsxTa+y/+7c4M832nU5NKmeBIH6RDu
nmtGHH7Sb9qQgCxgeFv+67DDquo8F5Ej9pSY0mTEh5s3buKm6KZ/4am3J9wIa6mZ
2SC4A4kk27YzVaTbX5pA3mXYzVlN5c9YnqFX0NgFbtIMd3dMyLqPcZab3SWMwLw/
e7rGZx3W3VuGAi+JiwNNTo9Bw7GhEgo/GmXct5Ja7mCz+WYZs5nRZs28NSvTgg51
2FfbgMmGn56m9/dmkB9Tw7gmxCoIYmYHP4MPJcERHWqRfjEHNlVmnOUgPenYxrX1
kY9ckf6QujmuFKIDxElDIusq1e7c46iBsfxuaV4C7O1exxg3k5zKiX4CcSly3cwq
RgpdYvghFr5zwNkSF+hTHmS0IxT0TNf7W8VCw4kOd7JtNp+tUK86EGdPfiv741lE
Z+n+6ZT1p1NXWkmdBgyagnpMsZvRmIdCCRJe2L7XYUZiofhe5hsk4g4I9b9drLuq
qEqQTbVI3lHDbCGBnAlPdtM24Ex1dhzkhxy940J8lWUo9c7JHxHoOscgw5m+OjHu
oaIDlqByWLzaCgauu8O4nkhPoBEUP2cT2UrXfiq0eX8ruJunBNPk9Md1ThvhA37k
LD7vRWziSJnN5NiuH0QVVE8/CnVB9pKPM+aSgx2XoW26f5kAEQEAAYkCHwQYAQIA
CQUCU3TWZQIbDAAKCRDFiL18E/NeP2dTD/48LSf37o78JfbR0myAeHP1PcURzySq
Yl8C87k8au5CQ8L4vep+1u6p8DSrstBs3DrdP/FIv60mZkW4ZMC46b90aJ5UrFBu
cF9EzObISrPK5LsbHK+4U8aS5x4fyPtimOX7xEbIEiN/FBNkRpzRrLBzczFrkTvS
TA5Kq/254Bmlw0JwUtmP2jcg9Yw3azSx6k/lDj2E6Oj0z+lBYZune7xr2HsUutbD
FBfsPgjGqxJkUZNP5nl0KQrd46CWetCsTTyRiVKLNUHKrmCqOVG6W2YfXuJ4ShLZ
v+hJIxveSP1kyEOO0UrlZJQZv4eDAI+nK8aoARqso9+uWZsclsGkUPTmzU9ZjTZm
x7Jt2slEgWw3Mchqig12gBC6wdTBeF8gR1id+bHgP0qpyjF2E+Ze/ULEQuJGM6nC
KtXcplh3eKyywkCtZ/8x2xDf/jtVtvgbE7i/A54oGc3gLJBmI2K7NujtREMWhLZp
LvuKYiiopx66VbzJL9YyEeTwvFClj2vM2iK2WS7MGfN3w/imZVvTb6/EtbB/4fO7
YkQrGND+afvIlCNNc3+MhJ+eCDFy4cp7cAZDlo62mLDEVDGLbfw8qM+2xeykZC4k
zw+otJrT+FR5O9y55RmX7mSWiyRC83mvL8fYEX2XUkkIH3IWxqM5OkZAi1EPqpo7
XIx1Fz1wKp+hXQ==
=rBdy
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -0,0 +1,12 @@
prefix = /usr
bindir = $(prefix)/bin
all:
echo Should download files
clean:
echo Cleaning
install: all
mkdir -p $(DESTDIR)$(bindir)
install frcsim $(DESTDIR)$(bindir)/frcsim

View File

@@ -0,0 +1,5 @@
frcsim (0.1-1) trusty; urgency=low
* Initial release.
-- Alex Henning <alex@thoriumrobotics.com> Wed, 14 May 2014 21:04:27 -0400

View File

@@ -0,0 +1 @@
9

View File

@@ -0,0 +1,15 @@
Source: frcsim
Maintainer: Alex Henning <alex@thoriumrobotics.com>
Section: misc
Priority: optional
Standards-Version: 3.9.4
Build-Depends: debhelper (>= 9)
Package: frcsim
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, frcsim-gazebo-plugins, frcsim-gazebo-models, frcsim-eclipse-plugins
Description: Installs everything necessary for FRC simulation with Gazebo.
Package that installs everything necessary for FRC Simulation, including
the gazebo plugin, gazebo models, eclipse-plugins and a wrapper script
around Gazebo. This enables support for development of FRC robots with
simulation.

View File

@@ -0,0 +1,25 @@
Copyright
Copyright (c) 2009 FIRST
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the FIRST nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,3 @@
#!/usr/bin/make -f
%:
dh $@

View File

@@ -0,0 +1 @@
3.0 (quilt)

View File

@@ -0,0 +1,4 @@
#!/bin/bash
export GAZEBO_PLUGIN_PATH="${GAZEBO_PLUGIN_PATH}:/usr/lib/frcsim/plugins"
export GAZEBO_MODEL_PATH="${GAZEBO_MODEL_PATH}:/usr/share/frcsim/models"
gazebo $@

30
simulation/debs/install.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
function install-frcsim {
# Add Gazebo Repository and Key
echo "deb http://packages.osrfoundation.org/gazebo/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-latest.list
wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -
# Add FRCSim Repository and Key
echo "deb http://users.wpi.edu/~adhenning/frcsim `lsb_release -cs` main" > /etc/apt/sources.list.d/frcsim-latest.list
wget users.wpi.edu/~adhenning/frcsim.key -O - | apt-key add -
# Update and install frcsim and its dependencies
apt-get update
apt-get install -y frcsim
# Done
python -c "raw_input(\"Installation Finished (Hit enter to exit) \")"
}
if [ "$1" == "ROOT" ]
then
install-frcsim
elif [ "$1" == "INSTALLER" ]
then
SUDO_ASKPASS=/usr/bin/ssh-askpass sudo bash -c "$0 ROOT"
else
gnome-terminal --window --hide-menubar --title "FRCSim Installer" -e "$0 INSTALLER"
fi

View File

@@ -0,0 +1,12 @@
Origin: users.wpi.edu
Label: FRCSim
Codename: trusty
Architectures: i386 amd64 source
Components: main
Description: Repository for simulating FRC robots using WPILibSim and the Gazebo simualtor.
SignWith: yes
DebOverride: override.trusty
DscOverride: override.trusty
DebIndices: Packages Release . .gz
UDebIndices: Packages . .gz
DscIndices: Sources Release . .gz

View File

@@ -0,0 +1,3 @@
verbose
ask-passphrase
basedir .

View File

@@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 2.8.3)
project(frc_gazebo_plugin)
include (FindPkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(GAZEBO gazebo)
endif()
find_package(gazebo REQUIRED)
file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.cc)
include_directories(src ${Boost_INCLUDE_DIR} ${GAZEBO_INCLUDE_DIRS})
add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
link_directories(${GAZEBO_LIBRARY_DIRS})
target_link_libraries(${PROJECT_NAME} ${GAZEBO_LIBRARIES} tinyxml2)

View File

@@ -0,0 +1,15 @@
prefix = /usr
lib.dir = $(prefix)/lib
plugin.dir = $(lib.dir)/frcsim/plugins
build.dir = build
all:
mkdir -p $(build.dir)
cd ${build.dir} && cmake .. && make
clean:
rm -rf $(build.dir)
install: all
mkdir -p $(DESTDIR)$(plugin.dir)
install $(build.dir)/libfrc_gazebo_plugin.so $(DESTDIR)$(plugin.dir)

View File

@@ -0,0 +1 @@
protoc --cpp_out=src/ msgs/float64.proto

View File

@@ -0,0 +1,15 @@
package gazebo.msgs;
/// \ingroup gazebo_msgs
/// \interface Bool
/// \brief A message for boolean data
/// \verbatim
option java_outer_classname = "GzBool";
message Bool
{
required bool data = 1;
}
/// \endverbatim

View File

@@ -0,0 +1,21 @@
package gazebo.msgs;
/// \ingroup gazebo_msgs
/// \interface DriverStation
/// \brief A message for DriverStation data
/// \verbatim
option java_outer_classname = "GzDriverStation";
message DriverStation
{
required bool enabled = 1;
enum State {
AUTO = 0;
TELEOP = 1;
TEST = 2;
}
required State state = 2;
}
/// \endverbatim

View File

@@ -0,0 +1,15 @@
package gazebo.msgs;
/// \ingroup gazebo_msgs
/// \interface Float64
/// \brief A message for floating point data
/// \verbatim
option java_outer_classname = "GzFloat64";
message Float64
{
required double data = 1;
}
/// \endverbatim

View File

@@ -0,0 +1,16 @@
package gazebo.msgs;
/// \ingroup gazebo_msgs
/// \interface Joystick
/// \brief A message for joystick data
/// \verbatim
option java_outer_classname = "GzJoystick";
message Joystick
{
repeated double axes = 1;
repeated bool buttons = 2;
}
/// \endverbatim

View File

@@ -0,0 +1,65 @@
#include "FRCPlugin.h"
#include <gazebo/physics/Model.hh>
#include <gazebo/physics/Link.hh>
#include <gazebo/physics/Joint.hh>
#include <gazebo/physics/PhysicsEngine.hh>
#include <gazebo/sensors/sensors.hh>
#include <gazebo/transport/transport.hh>
#include <gazebo/msgs/msgs.hh>
#include <string.h>
#include <boost/lexical_cast.hpp>
#include "RobotMapParser.h"
#include "components/Motor.h"
#include "components/Potentiometer.h"
#include "components/Encoder.h"
using namespace gazebo;
GZ_REGISTER_MODEL_PLUGIN(FRCPlugin)
FRCPlugin::FRCPlugin() {}
FRCPlugin::~FRCPlugin() {}
void FRCPlugin::Load(physics::ModelPtr _model, sdf::ElementPtr _sdf) {
model = _model;
// Create robot components from RobotMap
if (_sdf->HasElement("robotmap")) {
std::string robotmap = common::SystemPaths::Instance()->FindFileURI(_sdf->Get<std::string>("robotmap"));
std::cout << "Loading RobotMap: " << robotmap << std::endl;
RobotMapParser map("simulator", robotmap, model);
map.parse(components);
} else {
std::cerr << "No RobotMap specified this robot cannnot be controlled." << std::endl;
}
// Connect to Gazebo transport for messaging
gzNode = transport::NodePtr(new transport::Node());
gzNode->Init("frc");
for (int i = 0; i < components.size(); i++) {
components[i]->connect(gzNode);
}
enabled = false;
sub = gzNode->Subscribe("~/ds/state", &FRCPlugin::dsCallback, this);
// Connect to the world update event.
// This will trigger the Update function every Gazebo iteration
updateConn = event::Events::ConnectWorldUpdateBegin(boost::bind(&FRCPlugin::Update, this, _1));
}
// Update all RobotComponents
void FRCPlugin::Update(const common::UpdateInfo &_info) {
for (int i = 0; i < components.size(); i++) {
components[i]->update(enabled);
}
}
void FRCPlugin::dsCallback(const msgs::ConstDriverStationPtr &msg) {
enabled = msg->enabled();
}

Some files were not shown because too many files have changed in this diff Show More