HydraDemoPlugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2015 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 _SPHERE_HYDRADEMO_PLUGIN_HH_
19 #define _SPHERE_HYDRADEMO_PLUGIN_HH_
20 
21 #include <boost/thread/mutex.hpp>
22 #include "gazebo/physics/physics.hh"
23 #include "gazebo/msgs/msgs.hh"
25 #include "gazebo/common/Plugin.hh"
26 #include "gazebo/common/Events.hh"
27 
28 namespace gazebo
29 {
31  {
33  public: HydraDemoPlugin();
34 
36  public: virtual ~HydraDemoPlugin();
37 
38  // Documentation Inherited.
39  public: void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf);
40 
43  private: void Update(const common::UpdateInfo &_info);
44 
47  private: void OnHydra(ConstHydraPtr &_msg);
48 
50  private: physics::WorldPtr world;
51 
53  private: physics::ModelPtr model;
54 
56  private: transport::NodePtr node;
57 
59  private: transport::SubscriberPtr hydraSub;
60 
62  private: event::ConnectionPtr updateConnection;
63 
65  private: boost::mutex msgMutex;
66 
68  private: boost::shared_ptr<const gazebo::msgs::Hydra> hydraMsgPtr;
69  };
70 }
71 #endif
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:147
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:84
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
Forward declarations for transport.
Information for use in an update event.
Definition: UpdateInfo.hh:30
Definition: HydraDemoPlugin.hh:30
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:80
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
A plugin with access to physics::Model.
Definition: Plugin.hh:245
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:66