00001 00029 #ifndef _SR_VIRTUAL_TACTILE_SENSOR_HPP_ 00030 #define _SR_VIRTUAL_TACTILE_SENSOR_HPP_ 00031 00032 #include <ros/ros.h> 00033 00034 #include <boost/thread.hpp> 00035 00036 #include "sr_tactile_sensors/sr_generic_tactile_sensor.hpp" 00037 00038 #include <sr_robot_msgs/joints_data.h> 00039 #include <sr_robot_msgs/joint.h> 00040 00041 namespace shadowrobot 00042 { 00043 class SrVirtualTactileSensor : public SrGenericTactileSensor 00044 { 00045 public: 00057 SrVirtualTactileSensor(std::string name, std::string touch_name); 00058 ~SrVirtualTactileSensor(); 00059 00060 protected: 00066 virtual double get_touch_data(); 00067 00068 private: 00069 ros::NodeHandle nh; 00070 boost::mutex touch_mutex; 00071 double touch_value; 00072 00076 std::vector<std::string> names_joints_linked; 00081 ros::Subscriber sub; 00090 void callback(const sr_robot_msgs::joints_dataConstPtr& msg); 00091 }; 00092 00093 class SrVirtualTactileSensorManager : public SrTactileSensorManager 00094 { 00095 public: 00096 SrVirtualTactileSensorManager(); 00097 ~SrVirtualTactileSensorManager(); 00098 }; 00099 } 00100 00101 /* For the emacs weenies in the crowd. 00102 Local Variables: 00103 c-basic-offset: 2 00104 End: 00105 */ 00106 00107 #endif