SideContactPlugin.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: Plugin for monitoring the side of a ContactSensor
19  * Author: Deanna Hood
20  */
21 #ifndef _GAZEBO_SIDE_CONTACT_PLUGIN_HH_
22 #define _GAZEBO_SIDE_CONTACT_PLUGIN_HH_
23 
24 #include <gazebo/common/Plugin.hh>
25 #include <gazebo/common/UpdateInfo.hh>
26 #include <gazebo/sensors/sensors.hh>
27 #include <gazebo/transport/Node.hh>
28 #include <gazebo/transport/Publisher.hh>
29 #include <gazebo/util/system.hh>
30 
31 namespace gazebo
32 {
35  class GAZEBO_VISIBLE SideContactPlugin : public ModelPlugin
36  {
38  public: SideContactPlugin();
39 
41  public: virtual ~SideContactPlugin();
42 
46  public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
47 
49  protected: virtual void OnContactsReceived(ConstContactsPtr& _msg);
50 
53  protected: virtual void OnUpdate(const common::UpdateInfo &_info);
54 
56  protected: event::ConnectionPtr updateConnection;
57 
59  protected: std::string contactSensorName;
60 
62  protected: std::string scopedContactSensorName;
63 
65  protected: sensors::ContactSensorPtr parentSensor;
66 
69  protected: ignition::math::Vector3d sideNormal;
70 
72  protected: physics::WorldPtr world;
73 
75  protected: physics::ModelPtr model;
76 
78  protected: transport::NodePtr node;
79 
81  protected: transport::SubscriberPtr contactSub;
82 
84  protected: msgs::Contacts newestContactsMsg;
85 
87  protected: mutable boost::mutex mutex;
88 
90  protected: bool newMsg;
91 
93  protected: std::string collisionName;
94 
96  protected: physics::LinkPtr parentLink;
97 
99  protected: std::set<physics::LinkPtr> contactingLinks;
100 
102  protected: std::set<physics::ModelPtr> contactingModels;
103 
106  protected: bool FindContactSensor();
107 
109  protected: virtual void CalculateContactingLinks();
110 
112  protected: virtual void CalculateContactingModels();
113 
114  };
115 }
116 #endif
boost::mutex mutex
Mutex for protecting contacts msg.
physics::WorldPtr world
Pointer to the world.
bool newMsg
Flag for new contacts message.
std::string collisionName
Name of the collision of the parent&#39;s link.
std::string contactSensorName
Name of the contact sensor.
std::set< physics::ModelPtr > contactingModels
Set of pointers to models that have collisions with the parent link&#39;s side.
transport::NodePtr node
Pointer to this node for publishing/subscribing.
A plugin for a model with a contact sensor that only monitors collisions on one of its sides...
std::set< physics::LinkPtr > contactingLinks
Set of pointers to links that have collisions with the parent link&#39;s side.
sensors::ContactSensorPtr parentSensor
Pointer to the contact sensor.
transport::SubscriberPtr contactSub
Subscriber for the contact topic.
event::ConnectionPtr updateConnection
Pointer to the update event connection.
physics::LinkPtr parentLink
Pointer to the sensor&#39;s parent&#39;s link.
physics::ModelPtr model
Pointer to the model.
std::string scopedContactSensorName
Scoped name of the contact sensor.
msgs::Contacts newestContactsMsg
Contacts msg received.
ignition::math::Vector3d sideNormal
The normal, in local frame, to the side that is to have contacts monitored (default (0...


osrf_gear
Author(s):
autogenerated on Wed Sep 7 2016 03:48:12