PressurePlugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-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  * Desc: Pressure Sensor Plugin
19  * Author: Steve Peters
20  */
21 #ifndef _GAZEBO_PRESSURE_PLUGIN_HH_
22 #define _GAZEBO_PRESSURE_PLUGIN_HH_
23 
24 #include <string>
25 #include <boost/unordered_map.hpp>
26 
27 #include <gazebo/common/Plugin.hh>
28 #include <gazebo/sensors/sensors.hh>
29 #include <gazebo/transport/transport.hh>
30 #include "gazebo/util/system.hh"
31 
32 namespace gazebo
33 {
41  {
43  public: PressurePlugin();
44 
46  public: virtual ~PressurePlugin();
47 
48  // Documentation inherited.
49  public: virtual void Load(sensors::SensorPtr _sensor, sdf::ElementPtr _sdf);
50 
51  // Documentation inherited.
52  public: virtual void Init();
53 
55  private: virtual void OnUpdate();
56 
58  private: sensors::ContactSensorPtr parentSensor;
59 
62  private: event::ConnectionPtr updateConnection;
63 
65  private: transport::NodePtr node;
66 
68  private: transport::PublisherPtr tactilePub;
69 
71  private: std::string worldName;
72 
74  private: std::string parentSensorName;
75 
77  private: boost::unordered_map<std::string, double> collisionNamesToArea;
78  };
79 }
80 #endif
std::shared_ptr< Sensor > SensorPtr
Definition: SensorTypes.hh:63
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
std::shared_ptr< ContactSensor > ContactSensorPtr
Definition: SensorTypes.hh:87
A plugin for a tactile pressure sensor.
Definition: PressurePlugin.hh:40
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:153
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
A plugin with access to physics::Sensor.
Definition: Plugin.hh:274
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59