SideContactPlugin.hh
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2012-2016 Open Source Robotics Foundation
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  *
00016 */
00017 /*
00018  * Desc: Plugin for monitoring the side of a ContactSensor
00019  * Author: Deanna Hood
00020  */
00021 #ifndef _GAZEBO_SIDE_CONTACT_PLUGIN_HH_
00022 #define _GAZEBO_SIDE_CONTACT_PLUGIN_HH_
00023 
00024 #include <gazebo/common/Plugin.hh>
00025 #include <gazebo/common/UpdateInfo.hh>
00026 #include <gazebo/sensors/sensors.hh>
00027 #include <gazebo/transport/Node.hh>
00028 #include <gazebo/transport/Publisher.hh>
00029 #include <gazebo/util/system.hh>
00030 
00031 namespace gazebo
00032 {
00035   class GAZEBO_VISIBLE SideContactPlugin : public ModelPlugin
00036   {
00038     public: SideContactPlugin();
00039 
00041     public: virtual ~SideContactPlugin();
00042 
00046     public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
00047 
00049     protected: virtual void OnContactsReceived(ConstContactsPtr& _msg);
00050 
00053     protected: virtual void OnUpdate(const common::UpdateInfo &_info);
00054 
00056     protected: event::ConnectionPtr updateConnection;
00057 
00059     protected: std::string contactSensorName;
00060 
00062     protected: std::string scopedContactSensorName;
00063 
00065     protected: sensors::ContactSensorPtr parentSensor;
00066 
00069     protected: ignition::math::Vector3d sideNormal;
00070 
00072     protected: physics::WorldPtr world;
00073 
00075     protected: physics::ModelPtr model;
00076 
00078     protected: transport::NodePtr node;
00079 
00081     protected: transport::SubscriberPtr contactSub;
00082 
00084     protected: msgs::Contacts newestContactsMsg;
00085 
00087     protected: mutable boost::mutex mutex;
00088 
00090     protected: bool newMsg;
00091 
00093     protected: std::string collisionName;
00094 
00096     protected: physics::LinkPtr parentLink;
00097 
00099     protected: std::set<physics::LinkPtr> contactingLinks;
00100 
00102     protected: std::set<physics::ModelPtr> contactingModels;
00103 
00106     protected: bool FindContactSensor();
00107 
00109     protected: virtual void CalculateContactingLinks();
00110 
00112     protected: virtual void CalculateContactingModels();
00113 
00114   };
00115 }
00116 #endif


osrf_gear
Author(s):
autogenerated on Mon Sep 5 2016 03:41:33