00001 00030 #ifndef _SR_GENERIC_TACTILE_SENSOR_HPP_ 00031 #define _SR_GENERIC_TACTILE_SENSOR_HPP_ 00032 00033 #include <ros/ros.h> 00034 00035 #include <boost/smart_ptr.hpp> 00036 #include <std_msgs/Float64.h> 00037 00038 namespace shadowrobot 00039 { 00040 class SrGenericTactileSensor 00041 { 00042 public: 00043 SrGenericTactileSensor(std::string name, std::string touch_name); 00044 ~SrGenericTactileSensor(); 00045 00050 void publish_current_values(); 00051 00052 protected: 00058 virtual double get_touch_data() = 0; 00059 00060 private: 00061 ros::Publisher touch_pub; 00062 ros::NodeHandle n_tilde; 00063 std::string touch_sensor_name; 00064 std_msgs::Float64 msg_touch; 00065 }; 00066 00067 class SrTactileSensorManager 00068 { 00069 public: 00070 SrTactileSensorManager(); 00071 ~SrTactileSensorManager(); 00072 00077 void publish_all(); 00078 00079 protected: 00080 std::vector<boost::shared_ptr<SrGenericTactileSensor> > tactile_sensors; 00081 ros::NodeHandle n_tilde; 00082 ros::Rate publish_rate; 00083 00095 std::vector<std::vector<std::string> > get_all_names(); 00096 }; 00097 } 00098 00099 00100 /* For the emacs weenies in the crowd. 00101 Local Variables: 00102 c-basic-offset: 2 00103 End: 00104 */ 00105 00106 #endif