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,53 @@
#ifndef _SIM_MAIN_NODE_H
#define _SIM_MAIN_NODE_H
#include <gazebo/transport/transport.hh>
#include "simulation/msgs/msgs.h"
using namespace gazebo;
class MainNode {
public:
static MainNode* GetInstance() {
if (instance == NULL) {
instance = new MainNode();
}
return instance;
}
template<typename M>
static transport::PublisherPtr Advertise(const std::string &topic,
unsigned int _queueLimit = 10,
bool _latch = false) {
return GetInstance()->main->Advertise<M>(topic, _queueLimit, _latch);
}
template<typename M, typename T>
static transport::SubscriberPtr Subscribe(const std::string &topic,
void(T::*fp)(const boost::shared_ptr<M const> &), T *obj,
bool _latching = false) {
return GetInstance()->main->Subscribe(topic, fp, obj, _latching);
}
template<typename M>
static transport::SubscriberPtr Subscribe(const std::string &topic,
void(*fp)(const boost::shared_ptr<M const> &),
bool _latching = false) {
return GetInstance()->main->Subscribe(topic, fp, _latching);
}
transport::NodePtr main;
private:
static MainNode* instance;
MainNode() {
gazebo::transport::init();
main = transport::NodePtr(new transport::Node());
main->Init("frc");
gazebo::transport::run();
}
};
#endif

View File

@@ -0,0 +1,26 @@
#ifndef _SIM_DIGITAL_INPUT_H
#define _SIM_DIGITAL_INPUT_H
#include "simulation/msgs/msgs.h"
#include <gazebo/transport/transport.hh>
using namespace gazebo;
class SimDigitalInput {
public:
SimDigitalInput(std::string topic);
/**
* @return The value of the potentiometer.
*/
bool Get();
private:
bool value;
transport::SubscriberPtr sub;
void callback(const msgs::ConstBoolPtr &msg);
};
#endif

View File

@@ -0,0 +1,31 @@
#ifndef _SIM_ENCODER_H
#define _SIM_ENCODER_H
#include "simulation/msgs/msgs.h"
#include <gazebo/transport/transport.hh>
using namespace gazebo;
class SimEncoder {
public:
SimEncoder(std::string topic);
void Reset();
void Start();
void Stop();
double GetPosition();
double GetVelocity();
private:
void sendCommand(std::string cmd);
double position, velocity;
transport::SubscriberPtr posSub, velSub;
transport::PublisherPtr commandPub;
void positionCallback(const msgs::ConstFloat64Ptr &msg);
void velocityCallback(const msgs::ConstFloat64Ptr &msg);
};
#endif

View File

@@ -0,0 +1,26 @@
#ifndef _SIM_FLOAT_INPUT_H
#define _SIM_FLOAT_INPUT_H
#include "simulation/msgs/msgs.h"
#include <gazebo/transport/transport.hh>
using namespace gazebo;
class SimFloatInput {
public:
SimFloatInput(std::string topic);
/**
* @return The value of the potentiometer.
*/
double Get();
private:
double value;
transport::SubscriberPtr sub;
void callback(const msgs::ConstFloat64Ptr &msg);
};
#endif

View File

@@ -0,0 +1,29 @@
#ifndef _SIM_GYRO_H
#define _SIM_GYRO_H
#include "simulation/msgs/msgs.h"
#include <gazebo/transport/transport.hh>
using namespace gazebo;
class SimGyro {
public:
SimGyro(std::string topic);
void Reset();
double GetAngle();
double GetVelocity();
private:
void sendCommand(std::string cmd);
double position, velocity;
transport::SubscriberPtr posSub, velSub;
transport::PublisherPtr commandPub;
void positionCallback(const msgs::ConstFloat64Ptr &msg);
void velocityCallback(const msgs::ConstFloat64Ptr &msg);
};
#endif

View File

@@ -0,0 +1,67 @@
#ifndef _SIM_SPEED_CONTROLLER_H
#define _SIM_SPEED_CONTROLLER_H
#include <gazebo/transport/transport.hh>
#include "SpeedController.h"
using namespace gazebo;
class SimSpeedController : public SpeedController {
private:
transport::PublisherPtr pub;
float speed;
public:
/**
* Constructor that assumes the default digital module.
*
* @param channel The PWM channel on the digital module that the Victor is attached to.
*/
SimSpeedController(std::string topic);
/**
* Set the PWM value.
*
* @deprecated For compatibility with CANJaguar
*
* The PWM value is set using a range of -1.0 to 1.0, appropriately
* scaling the value for the FPGA.
*
* @param speed The speed to set. Value should be between -1.0 and 1.0.
* @param syncGroup The update group to add this Set() to, pending UpdateSyncGroup(). If 0, update immediately.
*/
void Set(float speed, uint8_t syncGroup);
/**
* Set the PWM value.
*
* The PWM value is set using a range of -1.0 to 1.0, appropriately
* scaling the value for the FPGA.
*
* @param speed The speed value between -1.0 and 1.0 to set.
*/
void Set(float speed);
/**
* Get the recently set value of the PWM.
*
* @return The most recently set value for the PWM between -1.0 and 1.0.
*/
float Get();
/**
* Disable the speed controller
*/
void Disable();
/**
* Write out the PID value as seen in the PIDOutput base object.
*
* @param output Write out the PWM value as was found in the PIDController
*/
void PIDWrite(float output);
};
#endif

View File

@@ -0,0 +1,167 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: msgs/bool.proto
#ifndef PROTOBUF_msgs_2fbool_2eproto__INCLUDED
#define PROTOBUF_msgs_2fbool_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2005000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
namespace gazebo {
namespace msgs {
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_msgs_2fbool_2eproto();
void protobuf_AssignDesc_msgs_2fbool_2eproto();
void protobuf_ShutdownFile_msgs_2fbool_2eproto();
class Bool;
// ===================================================================
class Bool : public ::google::protobuf::Message {
public:
Bool();
virtual ~Bool();
Bool(const Bool& from);
inline Bool& operator=(const Bool& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const Bool& default_instance();
void Swap(Bool* other);
// implements Message ----------------------------------------------
Bool* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Bool& from);
void MergeFrom(const Bool& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required bool data = 1;
inline bool has_data() const;
inline void clear_data();
static const int kDataFieldNumber = 1;
inline bool data() const;
inline void set_data(bool value);
// @@protoc_insertion_point(class_scope:gazebo.msgs.Bool)
private:
inline void set_has_data();
inline void clear_has_data();
::google::protobuf::UnknownFieldSet _unknown_fields_;
bool data_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
friend void protobuf_AddDesc_msgs_2fbool_2eproto();
friend void protobuf_AssignDesc_msgs_2fbool_2eproto();
friend void protobuf_ShutdownFile_msgs_2fbool_2eproto();
void InitAsDefaultInstance();
static Bool* default_instance_;
};
// ===================================================================
// ===================================================================
// Bool
// required bool data = 1;
inline bool Bool::has_data() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Bool::set_has_data() {
_has_bits_[0] |= 0x00000001u;
}
inline void Bool::clear_has_data() {
_has_bits_[0] &= ~0x00000001u;
}
inline void Bool::clear_data() {
data_ = false;
clear_has_data();
}
inline bool Bool::data() const {
return data_;
}
inline void Bool::set_data(bool value) {
set_has_data();
data_ = value;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace msgs
} // namespace gazebo
#ifndef SWIG
namespace google {
namespace protobuf {
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_msgs_2fbool_2eproto__INCLUDED

View File

@@ -0,0 +1,250 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: msgs/driver-station.proto
#ifndef PROTOBUF_msgs_2fdriver_2dstation_2eproto__INCLUDED
#define PROTOBUF_msgs_2fdriver_2dstation_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2005000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
namespace gazebo {
namespace msgs {
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_msgs_2fdriver_2dstation_2eproto();
void protobuf_AssignDesc_msgs_2fdriver_2dstation_2eproto();
void protobuf_ShutdownFile_msgs_2fdriver_2dstation_2eproto();
class DriverStation;
enum DriverStation_State {
DriverStation_State_AUTO = 0,
DriverStation_State_TELEOP = 1,
DriverStation_State_TEST = 2
};
bool DriverStation_State_IsValid(int value);
const DriverStation_State DriverStation_State_State_MIN = DriverStation_State_AUTO;
const DriverStation_State DriverStation_State_State_MAX = DriverStation_State_TEST;
const int DriverStation_State_State_ARRAYSIZE = DriverStation_State_State_MAX + 1;
const ::google::protobuf::EnumDescriptor* DriverStation_State_descriptor();
inline const ::std::string& DriverStation_State_Name(DriverStation_State value) {
return ::google::protobuf::internal::NameOfEnum(
DriverStation_State_descriptor(), value);
}
inline bool DriverStation_State_Parse(
const ::std::string& name, DriverStation_State* value) {
return ::google::protobuf::internal::ParseNamedEnum<DriverStation_State>(
DriverStation_State_descriptor(), name, value);
}
// ===================================================================
class DriverStation : public ::google::protobuf::Message {
public:
DriverStation();
virtual ~DriverStation();
DriverStation(const DriverStation& from);
inline DriverStation& operator=(const DriverStation& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const DriverStation& default_instance();
void Swap(DriverStation* other);
// implements Message ----------------------------------------------
DriverStation* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const DriverStation& from);
void MergeFrom(const DriverStation& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef DriverStation_State State;
static const State AUTO = DriverStation_State_AUTO;
static const State TELEOP = DriverStation_State_TELEOP;
static const State TEST = DriverStation_State_TEST;
static inline bool State_IsValid(int value) {
return DriverStation_State_IsValid(value);
}
static const State State_MIN =
DriverStation_State_State_MIN;
static const State State_MAX =
DriverStation_State_State_MAX;
static const int State_ARRAYSIZE =
DriverStation_State_State_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
State_descriptor() {
return DriverStation_State_descriptor();
}
static inline const ::std::string& State_Name(State value) {
return DriverStation_State_Name(value);
}
static inline bool State_Parse(const ::std::string& name,
State* value) {
return DriverStation_State_Parse(name, value);
}
// accessors -------------------------------------------------------
// required bool enabled = 1;
inline bool has_enabled() const;
inline void clear_enabled();
static const int kEnabledFieldNumber = 1;
inline bool enabled() const;
inline void set_enabled(bool value);
// required .gazebo.msgs.DriverStation.State state = 2;
inline bool has_state() const;
inline void clear_state();
static const int kStateFieldNumber = 2;
inline ::gazebo::msgs::DriverStation_State state() const;
inline void set_state(::gazebo::msgs::DriverStation_State value);
// @@protoc_insertion_point(class_scope:gazebo.msgs.DriverStation)
private:
inline void set_has_enabled();
inline void clear_has_enabled();
inline void set_has_state();
inline void clear_has_state();
::google::protobuf::UnknownFieldSet _unknown_fields_;
bool enabled_;
int state_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
friend void protobuf_AddDesc_msgs_2fdriver_2dstation_2eproto();
friend void protobuf_AssignDesc_msgs_2fdriver_2dstation_2eproto();
friend void protobuf_ShutdownFile_msgs_2fdriver_2dstation_2eproto();
void InitAsDefaultInstance();
static DriverStation* default_instance_;
};
// ===================================================================
// ===================================================================
// DriverStation
// required bool enabled = 1;
inline bool DriverStation::has_enabled() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void DriverStation::set_has_enabled() {
_has_bits_[0] |= 0x00000001u;
}
inline void DriverStation::clear_has_enabled() {
_has_bits_[0] &= ~0x00000001u;
}
inline void DriverStation::clear_enabled() {
enabled_ = false;
clear_has_enabled();
}
inline bool DriverStation::enabled() const {
return enabled_;
}
inline void DriverStation::set_enabled(bool value) {
set_has_enabled();
enabled_ = value;
}
// required .gazebo.msgs.DriverStation.State state = 2;
inline bool DriverStation::has_state() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void DriverStation::set_has_state() {
_has_bits_[0] |= 0x00000002u;
}
inline void DriverStation::clear_has_state() {
_has_bits_[0] &= ~0x00000002u;
}
inline void DriverStation::clear_state() {
state_ = 0;
clear_has_state();
}
inline ::gazebo::msgs::DriverStation_State DriverStation::state() const {
return static_cast< ::gazebo::msgs::DriverStation_State >(state_);
}
inline void DriverStation::set_state(::gazebo::msgs::DriverStation_State value) {
assert(::gazebo::msgs::DriverStation_State_IsValid(value));
set_has_state();
state_ = value;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace msgs
} // namespace gazebo
#ifndef SWIG
namespace google {
namespace protobuf {
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::gazebo::msgs::DriverStation_State>() {
return ::gazebo::msgs::DriverStation_State_descriptor();
}
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_msgs_2fdriver_2dstation_2eproto__INCLUDED

View File

@@ -0,0 +1,167 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: msgs/float64.proto
#ifndef PROTOBUF_msgs_2ffloat64_2eproto__INCLUDED
#define PROTOBUF_msgs_2ffloat64_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2005000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
namespace gazebo {
namespace msgs {
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_msgs_2ffloat64_2eproto();
void protobuf_AssignDesc_msgs_2ffloat64_2eproto();
void protobuf_ShutdownFile_msgs_2ffloat64_2eproto();
class Float64;
// ===================================================================
class Float64 : public ::google::protobuf::Message {
public:
Float64();
virtual ~Float64();
Float64(const Float64& from);
inline Float64& operator=(const Float64& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const Float64& default_instance();
void Swap(Float64* other);
// implements Message ----------------------------------------------
Float64* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Float64& from);
void MergeFrom(const Float64& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required double data = 1;
inline bool has_data() const;
inline void clear_data();
static const int kDataFieldNumber = 1;
inline double data() const;
inline void set_data(double value);
// @@protoc_insertion_point(class_scope:gazebo.msgs.Float64)
private:
inline void set_has_data();
inline void clear_has_data();
::google::protobuf::UnknownFieldSet _unknown_fields_;
double data_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
friend void protobuf_AddDesc_msgs_2ffloat64_2eproto();
friend void protobuf_AssignDesc_msgs_2ffloat64_2eproto();
friend void protobuf_ShutdownFile_msgs_2ffloat64_2eproto();
void InitAsDefaultInstance();
static Float64* default_instance_;
};
// ===================================================================
// ===================================================================
// Float64
// required double data = 1;
inline bool Float64::has_data() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Float64::set_has_data() {
_has_bits_[0] |= 0x00000001u;
}
inline void Float64::clear_has_data() {
_has_bits_[0] &= ~0x00000001u;
}
inline void Float64::clear_data() {
data_ = 0;
clear_has_data();
}
inline double Float64::data() const {
return data_;
}
inline void Float64::set_data(double value) {
set_has_data();
data_ = value;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace msgs
} // namespace gazebo
#ifndef SWIG
namespace google {
namespace protobuf {
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_msgs_2ffloat64_2eproto__INCLUDED

View File

@@ -0,0 +1,211 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: msgs/joystick.proto
#ifndef PROTOBUF_msgs_2fjoystick_2eproto__INCLUDED
#define PROTOBUF_msgs_2fjoystick_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2005000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
namespace gazebo {
namespace msgs {
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_msgs_2fjoystick_2eproto();
void protobuf_AssignDesc_msgs_2fjoystick_2eproto();
void protobuf_ShutdownFile_msgs_2fjoystick_2eproto();
class Joystick;
// ===================================================================
class Joystick : public ::google::protobuf::Message {
public:
Joystick();
virtual ~Joystick();
Joystick(const Joystick& from);
inline Joystick& operator=(const Joystick& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const Joystick& default_instance();
void Swap(Joystick* other);
// implements Message ----------------------------------------------
Joystick* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Joystick& from);
void MergeFrom(const Joystick& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// repeated double axes = 1;
inline int axes_size() const;
inline void clear_axes();
static const int kAxesFieldNumber = 1;
inline double axes(int index) const;
inline void set_axes(int index, double value);
inline void add_axes(double value);
inline const ::google::protobuf::RepeatedField< double >&
axes() const;
inline ::google::protobuf::RepeatedField< double >*
mutable_axes();
// repeated bool buttons = 2;
inline int buttons_size() const;
inline void clear_buttons();
static const int kButtonsFieldNumber = 2;
inline bool buttons(int index) const;
inline void set_buttons(int index, bool value);
inline void add_buttons(bool value);
inline const ::google::protobuf::RepeatedField< bool >&
buttons() const;
inline ::google::protobuf::RepeatedField< bool >*
mutable_buttons();
// @@protoc_insertion_point(class_scope:gazebo.msgs.Joystick)
private:
::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::RepeatedField< double > axes_;
::google::protobuf::RepeatedField< bool > buttons_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
friend void protobuf_AddDesc_msgs_2fjoystick_2eproto();
friend void protobuf_AssignDesc_msgs_2fjoystick_2eproto();
friend void protobuf_ShutdownFile_msgs_2fjoystick_2eproto();
void InitAsDefaultInstance();
static Joystick* default_instance_;
};
// ===================================================================
// ===================================================================
// Joystick
// repeated double axes = 1;
inline int Joystick::axes_size() const {
return axes_.size();
}
inline void Joystick::clear_axes() {
axes_.Clear();
}
inline double Joystick::axes(int index) const {
return axes_.Get(index);
}
inline void Joystick::set_axes(int index, double value) {
axes_.Set(index, value);
}
inline void Joystick::add_axes(double value) {
axes_.Add(value);
}
inline const ::google::protobuf::RepeatedField< double >&
Joystick::axes() const {
return axes_;
}
inline ::google::protobuf::RepeatedField< double >*
Joystick::mutable_axes() {
return &axes_;
}
// repeated bool buttons = 2;
inline int Joystick::buttons_size() const {
return buttons_.size();
}
inline void Joystick::clear_buttons() {
buttons_.Clear();
}
inline bool Joystick::buttons(int index) const {
return buttons_.Get(index);
}
inline void Joystick::set_buttons(int index, bool value) {
buttons_.Set(index, value);
}
inline void Joystick::add_buttons(bool value) {
buttons_.Add(value);
}
inline const ::google::protobuf::RepeatedField< bool >&
Joystick::buttons() const {
return buttons_;
}
inline ::google::protobuf::RepeatedField< bool >*
Joystick::mutable_buttons() {
return &buttons_;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace msgs
} // namespace gazebo
#ifndef SWIG
namespace google {
namespace protobuf {
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_msgs_2fjoystick_2eproto__INCLUDED

View File

@@ -0,0 +1,34 @@
#include "simulation/msgs/float64.pb.h"
#include "simulation/msgs/bool.pb.h"
#include "simulation/msgs/joystick.pb.h"
#include "simulation/msgs/driver-station.pb.h"
#include <gazebo/msgs/msgs.hh>
#include <boost/shared_ptr.hpp>
#ifndef _FRC_MSGS_H_
#define _FRC_MSGS_H_
namespace gazebo {
namespace msgs {
typedef GzString String;
typedef boost::shared_ptr< gazebo::msgs::String > StringPtr;
typedef const boost::shared_ptr< const gazebo::msgs::String > ConstStringPtr;
typedef boost::shared_ptr< msgs::Float64 > Float64Ptr;
typedef const boost::shared_ptr< const msgs::Float64 > ConstFloat64Ptr;
typedef boost::shared_ptr< msgs::Bool > BoolPtr;
typedef const boost::shared_ptr< const msgs::Bool > ConstBoolPtr;
typedef boost::shared_ptr< msgs::Joystick > JoystickPtr;
typedef const boost::shared_ptr< const msgs::Joystick > ConstJoystickPtr;
typedef boost::shared_ptr< msgs::DriverStation > DriverStationPtr;
typedef const boost::shared_ptr< const msgs::DriverStation > ConstDriverStationPtr;
}
}
#endif /* _FRC_MSGS_H_ */