##

SimStateEventSource.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.
*
*/
#ifndef GAZEBO_PLUGINS_SIMSTATEEVENTSOURCE_HH_
#define GAZEBO_PLUGINS_SIMSTATEEVENTSOURCE_HH_
#include "EventSource.hh"
namespace gazebo
{
class SimStateEventSource: public EventSource
{
public: SimStateEventSource(transport::PublisherPtr _pub,
physics::WorldPtr _world);
public: virtual ~SimStateEventSource();
public: virtual void Load(const sdf::ElementPtr _sdf);
public: virtual void OnUpdate(const common::UpdateInfo &_info);
public: void OnPause(bool _p);
private: bool hasPaused;
private: event::ConnectionPtr pauseConnection;
private: event::ConnectionPtr updateConnection;
private: common::Time simTime;
};
}
#endif
gazebo::SimStateEventSource
SimEvent that fires when the simulation is paused/resumed.
Definition: SimStateEventSource.hh:27
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::common::Time
A Time class, can be used to hold wall- or sim-time. stored as sec and nano-sec.
Definition: Time.hh:47
gazebo::transport::PublisherPtr
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
gazebo::SimStateEventSource::OnPause
void OnPause(bool _p)
Callback for the pause event.
EventSource.hh
gazebo::SimStateEventSource::OnUpdate
virtual void OnUpdate(const common::UpdateInfo &_info)
Update for every time step.
gazebo::SimStateEventSource::~SimStateEventSource
virtual ~SimStateEventSource()
Dtor.
gazebo::SimStateEventSource::SimStateEventSource
SimStateEventSource(transport::PublisherPtr _pub, physics::WorldPtr _world)
Constructor.
gazebo::event::ConnectionPtr
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
gazebo::SimStateEventSource::Load
virtual void Load(const sdf::ElementPtr _sdf)
Load the name of the event from the world file.
gazebo::EventSource
The base class for emitting SimEvents.
Definition: EventSource.hh:34
gazebo::physics::WorldPtr
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
gazebo::common::UpdateInfo
Information for use in an update event.
Definition: UpdateInfo.hh:30