18 #ifndef GAZEBO_PLUGINS_EVENTSOURCE_HH_
19 #define GAZEBO_PLUGINS_EVENTSOURCE_HH_
31 #include "gazebo/physics/physics.hh"
32 #include "gazebo/common/common.hh"
47 const std::string &_type,
56 public:
void Emit(
const std::string& _data)
const;
60 public:
virtual void Load(
const sdf::ElementPtr _sdf);
63 public:
virtual void Init();
71 protected: std::string
name;
74 protected: std::string
type;
95 public:
template<
typename T>
Forward declarations for transport.
The base class for emitting SimEvents.
Definition: EventSource.hh:41
bool active
True if the event source is active.
Definition: EventSource.hh:81
void Emit(const std::string &_data) const
emit an event with data to the internal publisher (and using the internal type)
physics::WorldPtr world
Pointer to the world.
Definition: EventSource.hh:77
virtual void Load(const sdf::ElementPtr _sdf)
Load from an sdf element (with possible configuration data)
virtual void Init()
Initialize the event.
std::string type
Type of event.
Definition: EventSource.hh:74
virtual bool IsActive() const
An event source can be used to enable other events.
std::string name
Name of the event.
Definition: EventSource.hh:71
virtual ~EventSource()
Destructor.
transport::PublisherPtr pub
a way to send messages to the other topics (to the REST)
Definition: EventSource.hh:84
EventSource(transport::PublisherPtr _pub, const std::string &_type, physics::WorldPtr _world)
Constructor.
Gazebo events to detect model creation/deletion.
Definition: EventSource.hh:91
static event::EventT< void(std::string, bool)> spawnModel
A model has been completed and uploaded onto the server.
Definition: EventSource.hh:101
static event::ConnectionPtr ConnectSpawnModel(T _subscriber)
Connect a callback to the spawn model event.
Definition: EventSource.hh:97
A class for event processing.
Definition: Event.hh:98
ConnectionPtr Connect(const std::function< T > &_subscriber)
Connect a callback to this event.
Definition: Event.hh:558
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
Forward declarations for the common classes.
Definition: Animation.hh:27
std::shared_ptr< EventSource > EventSourcePtr
Definition: EventSource.hh:87