##

OccupiedEventSource.hh
Go to the documentation of this file.
/*
* Copyright (C) 2015 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_PLUGINS_EVENTS_OCCUPIEDEVENTSSOURCE_HH_
#define GAZEBO_PLUGINS_EVENTS_OCCUPIEDEVENTSSOURCE_HH_
#include <string>
#include <map>
#include <sdf/sdf.hh>
#include <gazebo/transport/TransportTypes.hh>
#include <gazebo/common/Plugin.hh>
#include <gazebo/util/system.hh>
#include "Region.hh"
#include "EventSource.hh"
namespace gazebo
{
//
class GAZEBO_VISIBLE OccupiedEventSource : public EventSource
{
// Documentation inherited
public: OccupiedEventSource(transport::PublisherPtr _pub,
physics::WorldPtr _world,
const std::map<std::string, RegionPtr> &_regions);
public: ~OccupiedEventSource() = default;
// Documentation inherited
public: virtual void Load(const sdf::ElementPtr _sdf);
private: void Update();
private: sdf::ElementPtr sdf;
private: std::map<std::string, RegionPtr> regions;
public: msgs::GzString msg;
public: transport::PublisherPtr msgPub;
private: event::ConnectionPtr updateConnection;
private: transport::NodePtr node;
private: std::string regionName;
};
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::transport::PublisherPtr
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
TransportTypes.hh
Forward declarations for transport.
Region.hh
system.hh
EventSource.hh
gazebo::transport::NodePtr
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
gazebo::OccupiedEventSource::msg
msgs::GzString msg
String message that is transmitted when an event occurs.
Definition: OccupiedEventSource.hh:81
gazebo::event::ConnectionPtr
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
gazebo::EventSource
The base class for emitting SimEvents.
Definition: EventSource.hh:34
gazebo::OccupiedEventSource::msgPub
transport::PublisherPtr msgPub
Publisher that transmits the message when an event occurs.
Definition: OccupiedEventSource.hh:84
gazebo::OccupiedEventSource
A plugin that transmits a message when an in-region event occurs.
Definition: OccupiedEventSource.hh:58
gazebo::physics::WorldPtr
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
Plugin.hh
GAZEBO_VISIBLE
#define GAZEBO_VISIBLE
Definition: system.hh:59