22 #ifndef _CONTACTSENSOR_HH_
23 #define _CONTACTSENSOR_HH_
60 public:
virtual void Load(
const std::string &_worldName,
61 sdf::ElementPtr _sdf);
65 public:
virtual void Load(
const std::string &_worldName);
68 public:
virtual void Init();
71 protected:
virtual bool UpdateImpl(
bool _force);
74 protected:
virtual void Fini();
78 public:
unsigned int GetCollisionCount()
const;
83 public: std::string GetCollisionName(
unsigned int _index)
const;
88 public:
unsigned int GetCollisionContactCount(
89 const std::string &_collisionName)
const;
129 public: msgs::Contacts GetContacts()
const;
134 public: std::map<std::string, physics::Contact> GetContacts(
135 const std::string &_collisionName);
138 public:
virtual bool IsActive();
141 private:
void OnContacts(ConstContactsPtr &_msg);
144 private: std::vector<std::string> collisions;
153 private:
mutable boost::mutex mutex;
156 private: msgs::Contacts contactsMsg;
158 typedef std::list<boost::shared_ptr<msgs::Contacts const> > ContactMsgs_L;
159 private: ContactMsgs_L incomingContacts;
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
Base class for sensors.
Definition: Sensor.hh:67
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48