SMORES Robot Platform Simulation
Modlab at Penn, ASL at Cornell
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
ContactPublisher.hh
1 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 // Author: Edward Yunkai Cui
3 // Description: This sensor pluginin is used to populate message when
4 // two models are close enough to connect, this messgae
5 // will eventually pass to the world plugin, the system
6 // monitor.
7 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8 #ifndef _GAZEBO_CONTACT_SENSOR_HH_
9 #define _GAZEBO_CONTACT_SENSOR_HH_
10 
11 #include <string>
12 
13 #include <gazebo/gazebo.hh>
14 #include <gazebo/sensors/sensors.hh>
15 
16 namespace gazebo
17 {
19 
20 class ContactSensor : public SensorPlugin
21 {
22  public:
24  ContactSensor();
28 
32  void Load(sensors::SensorPtr _sensor, sdf::ElementPtr _sdf);
34  void OnUpdate();
35 
36  private:
38  sensors::ContactSensorPtr parentSensor;
40  /* Connection that maintains a link between the contact sensor's
41  updated signal and the OnUpdate callback. */
42  event::ConnectionPtr updateConnection;
44  transport::PublisherPtr collisionPub;
45 }; // class ContactSensor
46 } // namespace gazebo
47 #endif
gazebo name space
Definition: system_gui.cc:41
This class will be used in automatically connection under magnetic force.
Definition: ContactPublisher.hh:20
void Load(sensors::SensorPtr _sensor, sdf::ElementPtr _sdf)
Load the sensor plugin.
Definition: ContactPublisher.cc:16
ContactSensor()
Constructor.
Definition: ContactPublisher.cc:7
~ContactSensor()
Destructor.
Definition: ContactPublisher.cc:10
void OnUpdate()
Callback that recieves the contact sensor's update signal.
Definition: ContactPublisher.cc:45