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,3 @@
#include "simulation/MainNode.h"
MainNode* MainNode::instance = NULL;

View File

@@ -0,0 +1,22 @@
/*
* SimDigitalInput.cpp
*
* Created on: May 28, 2014
* Author: alex
*/
#include "simulation/SimDigitalInput.h"
#include "simulation/MainNode.h"
SimDigitalInput::SimDigitalInput(std::string topic) {
sub = MainNode::Subscribe("~/simulator/"+topic, &SimDigitalInput::callback, this);
std::cout << "Initialized ~/simulator/"+topic << std::endl;
}
bool SimDigitalInput::Get() {
return value;
}
void SimDigitalInput::callback(const msgs::ConstBoolPtr &msg) {
value = msg->data();
}

View File

@@ -0,0 +1,52 @@
#include "simulation/SimEncoder.h"
#include "simulation/MainNode.h"
SimEncoder::SimEncoder(std::string topic) {
commandPub = MainNode::Advertise<msgs::GzString>("~/simulator/"+topic+"/control");
posSub = MainNode::Subscribe("~/simulator/"+topic+"/position",
&SimEncoder::positionCallback, this);
velSub = MainNode::Subscribe("~/simulator/"+topic+"/velocity",
&SimEncoder::velocityCallback, this);
commandPub->WaitForConnection();
std::cout << "Initialized ~/simulator/"+topic << std::endl;
}
void SimEncoder::Reset() {
sendCommand("reset");
}
void SimEncoder::Start() {
sendCommand("start");
}
void SimEncoder::Stop() {
sendCommand("stop");
}
double SimEncoder::GetPosition() {
return position;
}
double SimEncoder::GetVelocity() {
return velocity;
}
void SimEncoder::sendCommand(std::string cmd) {
msgs::GzString msg;
msg.set_data(cmd);
commandPub->Publish(msg);
}
void SimEncoder::positionCallback(const msgs::ConstFloat64Ptr &msg) {
position = msg->data();
}
void SimEncoder::velocityCallback(const msgs::ConstFloat64Ptr &msg) {
velocity = msg->data();
}

View File

@@ -0,0 +1,22 @@
/*
* SimSpeedController.cpp
*
* Created on: May 28, 2014
* Author: alex
*/
#include "simulation/SimFloatInput.h"
#include "simulation/MainNode.h"
SimFloatInput::SimFloatInput(std::string topic) {
sub = MainNode::Subscribe("~/simulator/"+topic, &SimFloatInput::callback, this);
std::cout << "Initialized ~/simulator/"+topic << std::endl;
}
double SimFloatInput::Get() {
return value;
}
void SimFloatInput::callback(const msgs::ConstFloat64Ptr &msg) {
value = msg->data();
}

View File

@@ -0,0 +1,44 @@
#include "simulation/SimGyro.h"
#include "simulation/MainNode.h"
SimGyro::SimGyro(std::string topic) {
commandPub = MainNode::Advertise<msgs::GzString>("~/simulator/"+topic+"/control");
posSub = MainNode::Subscribe("~/simulator/"+topic+"/position",
&SimGyro::positionCallback, this);
velSub = MainNode::Subscribe("~/simulator/"+topic+"/velocity",
&SimGyro::velocityCallback, this);
commandPub->WaitForConnection();
std::cout << "Initialized ~/simulator/"+topic << std::endl;
}
void SimGyro::Reset() {
sendCommand("reset");
}
double SimGyro::GetAngle() {
return position;
}
double SimGyro::GetVelocity() {
return velocity;
}
void SimGyro::sendCommand(std::string cmd) {
msgs::GzString msg;
msg.set_data(cmd);
commandPub->Publish(msg);
}
void SimGyro::positionCallback(const msgs::ConstFloat64Ptr &msg) {
position = msg->data();
}
void SimGyro::velocityCallback(const msgs::ConstFloat64Ptr &msg) {
velocity = msg->data();
}

View File

@@ -0,0 +1,39 @@
/*
* SimSpeedController.cpp
*
* Created on: May 28, 2014
* Author: alex
*/
#include "simulation/SimSpeedController.h"
#include "simulation/MainNode.h"
SimSpeedController::SimSpeedController(std::string topic) {
pub = MainNode::Advertise<msgs::Float64>("~/simulator/"+topic);
std::cout << "Initialized ~/simulator/"+topic << std::endl;
}
void SimSpeedController::Set(float speed, uint8_t syncGroup) {
Set(speed);
}
void SimSpeedController::Set(float speed) {
msgs::Float64 msg;
msg.set_data(speed);
pub->Publish(msg);
}
float SimSpeedController::Get() {
return speed;
}
void SimSpeedController::Disable() {
Set(0);
}
void SimSpeedController::PIDWrite(float output) {
Set(output);
}

View File

@@ -0,0 +1,310 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: msgs/bool.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "simulation/msgs/bool.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* Bool_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Bool_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_msgs_2fbool_2eproto() {
protobuf_AddDesc_msgs_2fbool_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"msgs/bool.proto");
GOOGLE_CHECK(file != NULL);
Bool_descriptor_ = file->message_type(0);
static const int Bool_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Bool, data_),
};
Bool_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
Bool_descriptor_,
Bool::default_instance_,
Bool_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Bool, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Bool, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Bool));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_msgs_2fbool_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Bool_descriptor_, &Bool::default_instance());
}
} // namespace
void protobuf_ShutdownFile_msgs_2fbool_2eproto() {
delete Bool::default_instance_;
delete Bool_reflection_;
}
void protobuf_AddDesc_msgs_2fbool_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\017msgs/bool.proto\022\013gazebo.msgs\"\024\n\004Bool\022\014"
"\n\004data\030\001 \002(\010B\010B\006GzBool", 62);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"msgs/bool.proto", &protobuf_RegisterTypes);
Bool::default_instance_ = new Bool();
Bool::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_msgs_2fbool_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_msgs_2fbool_2eproto {
StaticDescriptorInitializer_msgs_2fbool_2eproto() {
protobuf_AddDesc_msgs_2fbool_2eproto();
}
} static_descriptor_initializer_msgs_2fbool_2eproto_;
// ===================================================================
#ifndef _MSC_VER
const int Bool::kDataFieldNumber;
#endif // !_MSC_VER
Bool::Bool()
: ::google::protobuf::Message() {
SharedCtor();
}
void Bool::InitAsDefaultInstance() {
}
Bool::Bool(const Bool& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void Bool::SharedCtor() {
_cached_size_ = 0;
data_ = false;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
Bool::~Bool() {
SharedDtor();
}
void Bool::SharedDtor() {
if (this != default_instance_) {
}
}
void Bool::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Bool::descriptor() {
protobuf_AssignDescriptorsOnce();
return Bool_descriptor_;
}
const Bool& Bool::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_msgs_2fbool_2eproto();
return *default_instance_;
}
Bool* Bool::default_instance_ = NULL;
Bool* Bool::New() const {
return new Bool;
}
void Bool::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
data_ = false;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Bool::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)) {
// required bool data = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &data_)));
set_has_data();
} else {
goto handle_uninterpreted;
}
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 Bool::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required bool data = 1;
if (has_data()) {
::google::protobuf::internal::WireFormatLite::WriteBool(1, this->data(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* Bool::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required bool data = 1;
if (has_data()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->data(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int Bool::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required bool data = 1;
if (has_data()) {
total_size += 1 + 1;
}
}
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 Bool::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const Bool* source =
::google::protobuf::internal::dynamic_cast_if_available<const Bool*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Bool::MergeFrom(const Bool& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_data()) {
set_data(from.data());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void Bool::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Bool::CopyFrom(const Bool& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Bool::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void Bool::Swap(Bool* other) {
if (other != this) {
std::swap(data_, other->data_);
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 Bool::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Bool_descriptor_;
metadata.reflection = Bool_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace msgs
} // namespace gazebo
// @@protoc_insertion_point(global_scope)

View File

@@ -0,0 +1,385 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: msgs/driver-station.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "simulation/msgs/driver-station.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* DriverStation_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
DriverStation_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* DriverStation_State_descriptor_ = NULL;
} // namespace
void protobuf_AssignDesc_msgs_2fdriver_2dstation_2eproto() {
protobuf_AddDesc_msgs_2fdriver_2dstation_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"msgs/driver-station.proto");
GOOGLE_CHECK(file != NULL);
DriverStation_descriptor_ = file->message_type(0);
static const int DriverStation_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DriverStation, enabled_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DriverStation, state_),
};
DriverStation_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
DriverStation_descriptor_,
DriverStation::default_instance_,
DriverStation_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DriverStation, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DriverStation, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(DriverStation));
DriverStation_State_descriptor_ = DriverStation_descriptor_->enum_type(0);
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_msgs_2fdriver_2dstation_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
DriverStation_descriptor_, &DriverStation::default_instance());
}
} // namespace
void protobuf_ShutdownFile_msgs_2fdriver_2dstation_2eproto() {
delete DriverStation::default_instance_;
delete DriverStation_reflection_;
}
void protobuf_AddDesc_msgs_2fdriver_2dstation_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\031msgs/driver-station.proto\022\013gazebo.msgs"
"\"z\n\rDriverStation\022\017\n\007enabled\030\001 \002(\010\022/\n\005st"
"ate\030\002 \002(\0162 .gazebo.msgs.DriverStation.St"
"ate\"\'\n\005State\022\010\n\004AUTO\020\000\022\n\n\006TELEOP\020\001\022\010\n\004TE"
"ST\020\002B\021B\017GzDriverStation", 183);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"msgs/driver-station.proto", &protobuf_RegisterTypes);
DriverStation::default_instance_ = new DriverStation();
DriverStation::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_msgs_2fdriver_2dstation_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_msgs_2fdriver_2dstation_2eproto {
StaticDescriptorInitializer_msgs_2fdriver_2dstation_2eproto() {
protobuf_AddDesc_msgs_2fdriver_2dstation_2eproto();
}
} static_descriptor_initializer_msgs_2fdriver_2dstation_2eproto_;
// ===================================================================
const ::google::protobuf::EnumDescriptor* DriverStation_State_descriptor() {
protobuf_AssignDescriptorsOnce();
return DriverStation_State_descriptor_;
}
bool DriverStation_State_IsValid(int value) {
switch(value) {
case 0:
case 1:
case 2:
return true;
default:
return false;
}
}
#ifndef _MSC_VER
const DriverStation_State DriverStation::AUTO;
const DriverStation_State DriverStation::TELEOP;
const DriverStation_State DriverStation::TEST;
const DriverStation_State DriverStation::State_MIN;
const DriverStation_State DriverStation::State_MAX;
const int DriverStation::State_ARRAYSIZE;
#endif // _MSC_VER
#ifndef _MSC_VER
const int DriverStation::kEnabledFieldNumber;
const int DriverStation::kStateFieldNumber;
#endif // !_MSC_VER
DriverStation::DriverStation()
: ::google::protobuf::Message() {
SharedCtor();
}
void DriverStation::InitAsDefaultInstance() {
}
DriverStation::DriverStation(const DriverStation& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void DriverStation::SharedCtor() {
_cached_size_ = 0;
enabled_ = false;
state_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
DriverStation::~DriverStation() {
SharedDtor();
}
void DriverStation::SharedDtor() {
if (this != default_instance_) {
}
}
void DriverStation::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* DriverStation::descriptor() {
protobuf_AssignDescriptorsOnce();
return DriverStation_descriptor_;
}
const DriverStation& DriverStation::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_msgs_2fdriver_2dstation_2eproto();
return *default_instance_;
}
DriverStation* DriverStation::default_instance_ = NULL;
DriverStation* DriverStation::New() const {
return new DriverStation;
}
void DriverStation::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
enabled_ = false;
state_ = 0;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool DriverStation::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)) {
// required bool enabled = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &enabled_)));
set_has_enabled();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_state;
break;
}
// required .gazebo.msgs.DriverStation.State state = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_state:
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::gazebo::msgs::DriverStation_State_IsValid(value)) {
set_state(static_cast< ::gazebo::msgs::DriverStation_State >(value));
} else {
mutable_unknown_fields()->AddVarint(2, value);
}
} else {
goto handle_uninterpreted;
}
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 DriverStation::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required bool enabled = 1;
if (has_enabled()) {
::google::protobuf::internal::WireFormatLite::WriteBool(1, this->enabled(), output);
}
// required .gazebo.msgs.DriverStation.State state = 2;
if (has_state()) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
2, this->state(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* DriverStation::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required bool enabled = 1;
if (has_enabled()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->enabled(), target);
}
// required .gazebo.msgs.DriverStation.State state = 2;
if (has_state()) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
2, this->state(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int DriverStation::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required bool enabled = 1;
if (has_enabled()) {
total_size += 1 + 1;
}
// required .gazebo.msgs.DriverStation.State state = 2;
if (has_state()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->state());
}
}
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 DriverStation::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const DriverStation* source =
::google::protobuf::internal::dynamic_cast_if_available<const DriverStation*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void DriverStation::MergeFrom(const DriverStation& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_enabled()) {
set_enabled(from.enabled());
}
if (from.has_state()) {
set_state(from.state());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void DriverStation::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void DriverStation::CopyFrom(const DriverStation& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool DriverStation::IsInitialized() const {
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
return true;
}
void DriverStation::Swap(DriverStation* other) {
if (other != this) {
std::swap(enabled_, other->enabled_);
std::swap(state_, other->state_);
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 DriverStation::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = DriverStation_descriptor_;
metadata.reflection = DriverStation_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace msgs
} // namespace gazebo
// @@protoc_insertion_point(global_scope)

View File

@@ -0,0 +1,310 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: msgs/float64.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "simulation/msgs/float64.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* Float64_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Float64_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_msgs_2ffloat64_2eproto() {
protobuf_AddDesc_msgs_2ffloat64_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"msgs/float64.proto");
GOOGLE_CHECK(file != NULL);
Float64_descriptor_ = file->message_type(0);
static const int Float64_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Float64, data_),
};
Float64_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
Float64_descriptor_,
Float64::default_instance_,
Float64_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Float64, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Float64, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Float64));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_msgs_2ffloat64_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Float64_descriptor_, &Float64::default_instance());
}
} // namespace
void protobuf_ShutdownFile_msgs_2ffloat64_2eproto() {
delete Float64::default_instance_;
delete Float64_reflection_;
}
void protobuf_AddDesc_msgs_2ffloat64_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\022msgs/float64.proto\022\013gazebo.msgs\"\027\n\007Flo"
"at64\022\014\n\004data\030\001 \002(\001B\013B\tGzFloat64", 71);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"msgs/float64.proto", &protobuf_RegisterTypes);
Float64::default_instance_ = new Float64();
Float64::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_msgs_2ffloat64_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_msgs_2ffloat64_2eproto {
StaticDescriptorInitializer_msgs_2ffloat64_2eproto() {
protobuf_AddDesc_msgs_2ffloat64_2eproto();
}
} static_descriptor_initializer_msgs_2ffloat64_2eproto_;
// ===================================================================
#ifndef _MSC_VER
const int Float64::kDataFieldNumber;
#endif // !_MSC_VER
Float64::Float64()
: ::google::protobuf::Message() {
SharedCtor();
}
void Float64::InitAsDefaultInstance() {
}
Float64::Float64(const Float64& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void Float64::SharedCtor() {
_cached_size_ = 0;
data_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
Float64::~Float64() {
SharedDtor();
}
void Float64::SharedDtor() {
if (this != default_instance_) {
}
}
void Float64::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Float64::descriptor() {
protobuf_AssignDescriptorsOnce();
return Float64_descriptor_;
}
const Float64& Float64::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_msgs_2ffloat64_2eproto();
return *default_instance_;
}
Float64* Float64::default_instance_ = NULL;
Float64* Float64::New() const {
return new Float64;
}
void Float64::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
data_ = 0;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Float64::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)) {
// required double data = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
input, &data_)));
set_has_data();
} else {
goto handle_uninterpreted;
}
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 Float64::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// required double data = 1;
if (has_data()) {
::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->data(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* Float64::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// required double data = 1;
if (has_data()) {
target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->data(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int Float64::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required double data = 1;
if (has_data()) {
total_size += 1 + 8;
}
}
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 Float64::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const Float64* source =
::google::protobuf::internal::dynamic_cast_if_available<const Float64*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Float64::MergeFrom(const Float64& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_data()) {
set_data(from.data());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void Float64::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Float64::CopyFrom(const Float64& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Float64::IsInitialized() const {
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
return true;
}
void Float64::Swap(Float64* other) {
if (other != this) {
std::swap(data_, other->data_);
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 Float64::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Float64_descriptor_;
metadata.reflection = Float64_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace msgs
} // namespace gazebo
// @@protoc_insertion_point(global_scope)

View File

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