Public Member Functions | Protected Attributes | List of all members
gazebo::EventSource Class Reference

The base class for emitting SimEvents. More...

#include <EventSource.hh>

Inheritance diagram for gazebo::EventSource:
Inheritance graph
[legend]

Public Member Functions

 EventSource (transport::PublisherPtr _pub, const std::string &_type, physics::WorldPtr _world)
 Constructor. More...
 
virtual ~EventSource ()
 Destructor. More...
 
void Emit (const std::string &_data) const
 emit an event with data to the internal publisher (and using the internal type) More...
 
virtual void Init ()
 Initialize the event. More...
 
virtual bool IsActive () const
 An event source can be used to enable other events. More...
 
virtual void Load (const sdf::ElementPtr _sdf)
 Load from an sdf element (with possible configuration data) More...
 

Protected Attributes

bool active
 True if the event source is active. More...
 
std::string name
 Name of the event. More...
 
transport::PublisherPtr pub
 a way to send messages to the other topics (to the REST) More...
 
std::string type
 Type of event. More...
 
physics::WorldPtr world
 Pointer to the world. More...
 

Detailed Description

The base class for emitting SimEvents.

Constructor & Destructor Documentation

gazebo::EventSource::EventSource ( transport::PublisherPtr  _pub,
const std::string &  _type,
physics::WorldPtr  _world 
)

Constructor.

Parameters
[in]_pubthe publisher where the events are emitted
[in]_typethe type of event
[in]_worldPointer to the world (in order to get model refs, etc)
virtual gazebo::EventSource::~EventSource ( )
virtual

Destructor.

Member Function Documentation

void gazebo::EventSource::Emit ( const std::string &  _data) const

emit an event with data to the internal publisher (and using the internal type)

Parameters
[in]_datathe JSON data related to this event.
virtual void gazebo::EventSource::Init ( )
virtual

Initialize the event.

Reimplemented in gazebo::JointEventSource, and gazebo::InRegionEventSource.

virtual bool gazebo::EventSource::IsActive ( ) const
virtual

An event source can be used to enable other events.

Inactive events do not generate an message when Emit is called.

Returns
true if the event is active
virtual void gazebo::EventSource::Load ( const sdf::ElementPtr  _sdf)
virtual

Load from an sdf element (with possible configuration data)

Parameters
[in]_sdfthe sdf element for the event in the world file

Reimplemented in gazebo::JointEventSource, gazebo::OccupiedEventSource, gazebo::InRegionEventSource, gazebo::SimStateEventSource, and gazebo::ExistenceEventSource.

Member Data Documentation

bool gazebo::EventSource::active
protected

True if the event source is active.

Inactive event sources do not emit events

std::string gazebo::EventSource::name
protected

Name of the event.

transport::PublisherPtr gazebo::EventSource::pub
protected

a way to send messages to the other topics (to the REST)

std::string gazebo::EventSource::type
protected

Type of event.

physics::WorldPtr gazebo::EventSource::world
protected

Pointer to the world.


The documentation for this class was generated from the following file: