InRegionEventSource.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 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_INREGIONEVENTSOURCE_HH_
19 #define GAZEBO_PLUGINS_INREGIONEVENTSOURCE_HH_
20 
21 #include <map>
22 #include <string>
23 #include <vector>
24 
25 #include "plugins/events/Region.hh"
27 
28 namespace gazebo
29 {
32  {
38  physics::WorldPtr _world,
39  const std::map<std::string, RegionPtr> &_regions);
40 
42  public: virtual void Init();
43 
45  public: void Update();
46 
48  public: void Info() const;
49 
53  public: virtual void Load(const sdf::ElementPtr _sdf);
54 
56  private: event::ConnectionPtr updateConnection;
57 
59  private: std::string modelName;
60 
63  private: physics::ModelPtr model;
64 
66  private: std::string regionName;
67 
69  private: RegionPtr region;
70 
72  private: const std::map<std::string, RegionPtr> &regions;
73 
75  private: bool isInside;
76  };
77 }
78 #endif
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:90
InRegionEventSource(transport::PublisherPtr _pub, physics::WorldPtr _world, const std::map< std::string, RegionPtr > &_regions)
Constructor.
virtual void Load(const sdf::ElementPtr _sdf)
Loads the full name of the model and the region from the world file.
void Update()
Called every simulation step.
Forward declarations for the common classes.
Definition: Animation.hh:26
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
The base class for emitting SimEvents.
Definition: EventSource.hh:34
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
void Info() const
Prints data about the event source to the log (useful for debug)
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:94
virtual void Init()
Initialize the event.
std::shared_ptr< Region > RegionPtr
Definition: Region.hh:64
The event generator class.
Definition: InRegionEventSource.hh:31