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

A plugin that transmits a message when an in-region event occurs. More...

#include <OccupiedEventSource.hh>

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

Public Member Functions

 OccupiedEventSource (transport::PublisherPtr _pub, physics::WorldPtr _world, const std::map< std::string, RegionPtr > &_regions)
 
 ~OccupiedEventSource ()=default
 Destructor. More...
 
virtual void Load (const sdf::ElementPtr _sdf)
 Load from an sdf element (with possible configuration data) More...
 
- Public Member Functions inherited from gazebo::EventSource
 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...
 

Public Attributes

msgs::GzString msg
 String message that is transmitted when an event occurs. More...
 
transport::PublisherPtr msgPub
 Publisher that transmits the message when an event occurs. More...
 

Additional Inherited Members

- Protected Attributes inherited from gazebo::EventSource
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

A plugin that transmits a message when an in-region event occurs.

Events are specified in SDF. The following is example usage:

///    <plugin filename="libSimEventsPlugin.so" name="event_plugin">
///      <region>
///        <name>region1</name>
///        <volume>
///          <min>1.5 -1 0</min>
///          <max>2.5 1 1</max>
///        </volume>
///      </region>
///
///      <event>
///        <name>region1_event</name>
///        <type>occupied</type>
///        <topic>~/elevator</topic>
///        <region>region1</region>
///        <msg_data>0</msg_data>
///      </event>
///   </plugin>
/// 

Constructor & Destructor Documentation

gazebo::OccupiedEventSource::OccupiedEventSource ( transport::PublisherPtr  _pub,
physics::WorldPtr  _world,
const std::map< std::string, RegionPtr > &  _regions 
)
gazebo::OccupiedEventSource::~OccupiedEventSource ( )
default

Destructor.

Member Function Documentation

virtual void gazebo::OccupiedEventSource::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 from gazebo::EventSource.

Member Data Documentation

msgs::GzString gazebo::OccupiedEventSource::msg

String message that is transmitted when an event occurs.

transport::PublisherPtr gazebo::OccupiedEventSource::msgPub

Publisher that transmits the message when an event occurs.


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