Files
allwpilib/wpilibc/wpilibC++Sim/src/simulation/msgs/joystick.pb.cpp
Alex Henning cb56c9a144 Initial commit of the WPILib simulation support in an alpha quality state.
Fixes to deal with the switch to .hpp files in the HAL and other misc problems due to rebasing.

Added Omar's changes to the compressor interface

Fixes to make C++ plugin compile on linux.

Added import of the WPILibSim code from the graduate class. It shows up as wpilibJavaSim to follow the convention set by wpilibJava, wpilibJavaJNI and wpilibJavaFinal.

Fixed wpilibJavaSim artifactId to mirror the new convention.

Modified the build of the java plugin to pull in the simulation dependencies.

Added stacktrace printing.

Fixed support for creating projects.

Added support for the isReal() and isSimulation() methods along with the AnalogPotentiometer object to support simulating GearsBot.

Added support for a "WPILib Simulate" button.

Added GearsBot to the built in examples.

Added support for specifying the world file during project creation and switched the default from BluntObjectBot to GearsBot.

Removed unused import.

Added file browser for world files.

Added support for debugging in simulation.

Change simulate icon to be a Gazebo icon.

Switched over to the gazebo messaging system.

Updated location of default world file.

Reverted cmake change.

Fixed bug in WPILibJSim, added better logging and cleaned up code.

Made the frc_gazebo_plugin build using raw cmake instead of catkin, breaking the final ROS dependencies.

Added installation to frc_gazebo_plugin Makefile.

Fixed running of simulation to actually use frcsim.

Initial commit of simulation library for C++. Has the minimal subset of features necessary for having a Simple Robot run in teleoperated mode.

Added notes for generating protobuf messages.

Import of the debuild process into the main repository.

Moved frc_gazebo_plugin under simulation and removed the gazebo folder.

Updated the gazebo plugin to remove excessive printing and limit motor signal to [-1,1].

Updated WPILibJSim to support latching messages and to sleep for 20ms in iterative robot.

Reduced delay between starting frcsim and the users program to 1 second.

Updated GearsBot example.

Fixed a few minor issues for demoable state.

Added simulator support for Victors, Jaguars and Talons.

Added NetworkTables, SmartDashboard and LiveWindow to the simulator.

Added AnalogPotentiometer for simulation.

Added support for simulating encoders.

Added simulation support for Gyro.

Added IterativeRobot, Fixed Timers, Notifiers, PIDControllers and other minor fixes + cleanup.

Added RobotDrive support to simulation.

Separated out JavaGazebo so that SimDS will be able to reuse it.

Separated out SimDS into its own application..

Fixes so that the SimDS is distributed and runs properly for Java with the eclipse plugins.

Added DriverStation support to WPILibCSim

Cleanup of DriverStation, WaitUntilCommand and AnalogPotentiometer for WPILibCSim.

Cleanup of includes for WPILibCSim

Added AnalogPotentiometer to the real WPILibC.

Added AnalogPotentiometer to the real WPILibC.

Added GearsBot example to C++ eclipse plugin.

WPILibCSim fixes to work with launching from the plugin.

Package libwpilibsim in a deb file.

Added includes to plugin distribution.

Added support for external-limit-switches to Gazebo, Java and C++.

Added support for Gazebo Rangefinders and Analog channels to read their values in C++ and Java.

Added support for internal limit switches.

Updated GearsBot programs to use limit switches + range finders.

Added disabling of motors when robot is disabled to more closely mimic the real robot.

Fixes to deal with the switch to .hpp files in the HAL and other misc problems due to rebasing.

Change-Id: I624c5f4d0f28282616a7c92083575bf68adcdce2
2014-06-13 09:31:32 -04:00

359 lines
11 KiB
C++

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: msgs/joystick.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "simulation/msgs/joystick.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
namespace gazebo {
namespace msgs {
namespace {
const ::google::protobuf::Descriptor* Joystick_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Joystick_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_msgs_2fjoystick_2eproto() {
protobuf_AddDesc_msgs_2fjoystick_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"msgs/joystick.proto");
GOOGLE_CHECK(file != NULL);
Joystick_descriptor_ = file->message_type(0);
static const int Joystick_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Joystick, axes_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Joystick, buttons_),
};
Joystick_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
Joystick_descriptor_,
Joystick::default_instance_,
Joystick_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Joystick, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Joystick, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Joystick));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_msgs_2fjoystick_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Joystick_descriptor_, &Joystick::default_instance());
}
} // namespace
void protobuf_ShutdownFile_msgs_2fjoystick_2eproto() {
delete Joystick::default_instance_;
delete Joystick_reflection_;
}
void protobuf_AddDesc_msgs_2fjoystick_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\023msgs/joystick.proto\022\013gazebo.msgs\")\n\010Jo"
"ystick\022\014\n\004axes\030\001 \003(\001\022\017\n\007buttons\030\002 \003(\010B\014B"
"\nGzJoystick", 91);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"msgs/joystick.proto", &protobuf_RegisterTypes);
Joystick::default_instance_ = new Joystick();
Joystick::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_msgs_2fjoystick_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_msgs_2fjoystick_2eproto {
StaticDescriptorInitializer_msgs_2fjoystick_2eproto() {
protobuf_AddDesc_msgs_2fjoystick_2eproto();
}
} static_descriptor_initializer_msgs_2fjoystick_2eproto_;
// ===================================================================
#ifndef _MSC_VER
const int Joystick::kAxesFieldNumber;
const int Joystick::kButtonsFieldNumber;
#endif // !_MSC_VER
Joystick::Joystick()
: ::google::protobuf::Message() {
SharedCtor();
}
void Joystick::InitAsDefaultInstance() {
}
Joystick::Joystick(const Joystick& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void Joystick::SharedCtor() {
_cached_size_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
Joystick::~Joystick() {
SharedDtor();
}
void Joystick::SharedDtor() {
if (this != default_instance_) {
}
}
void Joystick::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Joystick::descriptor() {
protobuf_AssignDescriptorsOnce();
return Joystick_descriptor_;
}
const Joystick& Joystick::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_msgs_2fjoystick_2eproto();
return *default_instance_;
}
Joystick* Joystick::default_instance_ = NULL;
Joystick* Joystick::New() const {
return new Joystick;
}
void Joystick::Clear() {
axes_.Clear();
buttons_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Joystick::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// repeated double axes = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
parse_axes:
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
1, 9, input, this->mutable_axes())));
} else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
== ::google::protobuf::internal::WireFormatLite::
WIRETYPE_LENGTH_DELIMITED) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
input, this->mutable_axes())));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(9)) goto parse_axes;
if (input->ExpectTag(16)) goto parse_buttons;
break;
}
// repeated bool buttons = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_buttons:
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
1, 16, input, this->mutable_buttons())));
} else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
== ::google::protobuf::internal::WireFormatLite::
WIRETYPE_LENGTH_DELIMITED) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, this->mutable_buttons())));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_buttons;
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void Joystick::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// repeated double axes = 1;
for (int i = 0; i < this->axes_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteDouble(
1, this->axes(i), output);
}
// repeated bool buttons = 2;
for (int i = 0; i < this->buttons_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteBool(
2, this->buttons(i), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* Joystick::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// repeated double axes = 1;
for (int i = 0; i < this->axes_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteDoubleToArray(1, this->axes(i), target);
}
// repeated bool buttons = 2;
for (int i = 0; i < this->buttons_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteBoolToArray(2, this->buttons(i), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int Joystick::ByteSize() const {
int total_size = 0;
// repeated double axes = 1;
{
int data_size = 0;
data_size = 8 * this->axes_size();
total_size += 1 * this->axes_size() + data_size;
}
// repeated bool buttons = 2;
{
int data_size = 0;
data_size = 1 * this->buttons_size();
total_size += 1 * this->buttons_size() + data_size;
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void Joystick::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const Joystick* source =
::google::protobuf::internal::dynamic_cast_if_available<const Joystick*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Joystick::MergeFrom(const Joystick& from) {
GOOGLE_CHECK_NE(&from, this);
axes_.MergeFrom(from.axes_);
buttons_.MergeFrom(from.buttons_);
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void Joystick::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Joystick::CopyFrom(const Joystick& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Joystick::IsInitialized() const {
return true;
}
void Joystick::Swap(Joystick* other) {
if (other != this) {
axes_.Swap(&other->axes_);
buttons_.Swap(&other->buttons_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata Joystick::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Joystick_descriptor_;
metadata.reflection = Joystick_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace msgs
} // namespace gazebo
// @@protoc_insertion_point(global_scope)