##

SimEventsPlugin.hh
Go to the documentation of this file.
/*
* Copyright (C) 2014 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.k *
*/
#ifndef GAZEBO_PLUGINS_SIMEVENTSPLUGIN_HH_
#define GAZEBO_PLUGINS_SIMEVENTSPLUGIN_HH_
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#include "SimEventsException.hh"
#include "SimStateEventSource.hh"
namespace gazebo
{
class SimEventsPlugin : public WorldPlugin
{
public: virtual ~SimEventsPlugin();
public: void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf);
public: void Init();
public: void Update();
private: void OnModelInfo(ConstModelPtr &_msg);
private: void OnRequest(ConstRequestPtr &_msg);
private: physics::WorldPtr world;
private: sdf::ElementPtr sdf;
private: std::map<std::string, RegionPtr> regions;
private: std::vector<EventSourcePtr> events;
private: transport::NodePtr node;
private: transport::PublisherPtr pub;
private: transport::SubscriberPtr spawnSub;
private: std::set<std::string> models;
private: transport::SubscriberPtr requestSub;
};
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::transport::PublisherPtr
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
gazebo::SimEventsPlugin::Update
void Update()
Called every simulation step.
gazebo::WorldPlugin
A plugin with access to physics::World. See reference.
Definition: Plugin.hh:278
gazebo::transport::SubscriberPtr
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
gazebo::transport::NodePtr
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
gazebo::SimEventsPlugin
Definition: SimEventsPlugin.hh:31
gazebo::SimEventsPlugin::Load
void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf)
Called when the world file is loaded.
gazebo::SimEventsPlugin::~SimEventsPlugin
virtual ~SimEventsPlugin()
Destrutor.
SimStateEventSource.hh
gazebo::physics::WorldPtr
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
SimEventsException.hh
gazebo::SimEventsPlugin::Init
void Init()
Called upon initialization.