##

PressurePlugin.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 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.
*
*/
/*
* Desc: Pressure Sensor Plugin
* Author: Steve Peters
*/
#ifndef GAZEBO_PLUGINS_PRESSUREPLUGIN_HH_
#define GAZEBO_PLUGINS_PRESSUREPLUGIN_HH_
#include <map>
#include <string>
#include <ignition/transport/Node.hh>
#include <gazebo/common/Plugin.hh>
#include <gazebo/sensors/sensors.hh>
#include <gazebo/transport/transport.hh>
#include "gazebo/util/system.hh"
namespace gazebo
{
class GAZEBO_VISIBLE PressurePlugin : public SensorPlugin
{
public: PressurePlugin();
public: virtual ~PressurePlugin();
// Documentation inherited.
public: virtual void Load(sensors::SensorPtr _sensor, sdf::ElementPtr _sdf);
// Documentation inherited.
public: virtual void Init();
private: virtual void OnUpdate();
private: sensors::ContactSensorPtr parentSensor;
private: event::ConnectionPtr updateConnection;
private: transport::NodePtr node;
private: transport::PublisherPtr tactilePub;
private: std::string worldName;
private: std::string parentSensorName;
private: std::map<std::string, double> collisionNamesToArea;
// Place ignition::transport objects at the end of this file to
// guarantee they are destructed first.
private: ignition::transport::Node nodeIgn;
private: ignition::transport::Node::Publisher tactilePubIgn;
};
}
#endif
gazebo::sensors::SensorPtr
std::shared_ptr< Sensor > SensorPtr
Definition: SensorTypes.hh:64
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::transport::PublisherPtr
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
system.hh
gazebo::transport::NodePtr
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
gazebo::SensorPlugin
A plugin with access to physics::Sensor. See reference.
Definition: Plugin.hh:332
gazebo::event::ConnectionPtr
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::sensors::ContactSensorPtr
std::shared_ptr< ContactSensor > ContactSensorPtr
Definition: SensorTypes.hh:92
gazebo::PressurePlugin
A plugin for a tactile pressure sensor.
Definition: PressurePlugin.hh:42
Plugin.hh
GAZEBO_VISIBLE
#define GAZEBO_VISIBLE
Definition: system.hh:59