OccupiedEventSource.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef _GAZEBO_PLUGINS_EVENTS_OCCUPIED_EVENT_SOURCE_HH_
19 #define _GAZEBO_PLUGINS_EVENTS_OCCUPIED_EVENT_SOURCE_HH_
20 
21 #include <string>
22 #include <map>
23 
24 #include <sdf/sdf.hh>
25 
27 
28 #include <gazebo/common/Plugin.hh>
29 #include <gazebo/util/system.hh>
30 
31 #include "Region.hh"
32 #include "EventSource.hh"
33 
34 namespace gazebo
35 {
38  //
59  {
60  // Documentation inherited
62  physics::WorldPtr _world,
63  const std::map<std::string, RegionPtr> &_regions);
64 
66  public: ~OccupiedEventSource() = default;
67 
68  // Documentation inherited
69  public: virtual void Load(const sdf::ElementPtr _sdf);
70 
72  private: void Update();
73 
75  private: sdf::ElementPtr sdf;
76 
78  private: std::map<std::string, RegionPtr> regions;
79 
81  public: msgs::GzString msg;
82 
85 
87  private: event::ConnectionPtr updateConnection;
88 
90  private: transport::NodePtr node;
91 
93  private: std::string regionName;
94  };
95 }
96 #endif
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
Forward declarations for transport.
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
A plugin that transmits a message when an in-region event occurs.
Definition: OccupiedEventSource.hh:58
msgs::GzString msg
String message that is transmitted when an event occurs.
Definition: OccupiedEventSource.hh:81
The base class for emitting SimEvents.
Definition: EventSource.hh:39
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:153
transport::PublisherPtr msgPub
Publisher that transmits the message when an event occurs.
Definition: OccupiedEventSource.hh:84
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59