Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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