sr_generic_tactile_sensor.hpp
Go to the documentation of this file.
1 /*
2 * Copyright 2011 Shadow Robot Company Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 
30 #ifndef _SR_GENERIC_TACTILE_SENSOR_HPP_
31 #define _SR_GENERIC_TACTILE_SENSOR_HPP_
32 
33 #include <ros/ros.h>
34 
35 #include <boost/smart_ptr.hpp>
36 #include <string>
37 #include <vector>
38 
39 #include <std_msgs/Float64.h>
40 #include <XmlRpcValue.h>
41 #include <sr_robot_msgs/is_hand_occupied.h>
42 #include <sr_robot_msgs/which_fingers_are_touching.h>
43 
44 namespace shadowrobot
45 {
47 {
48 public:
49  SrGenericTactileSensor(std::string name, std::string touch_name);
50 
51  virtual ~SrGenericTactileSensor();
52 
58 
64  virtual double get_touch_data() = 0;
65 
66 private:
69  std::string touch_sensor_name;
70  std_msgs::Float64 msg_touch;
71 };
72 
74 {
75 public:
77 
79 
84  void publish_all();
85 
86 protected:
87  std::vector<boost::shared_ptr<SrGenericTactileSensor> > tactile_sensors;
90 
92  std::vector<double> is_hand_occupied_thresholds;
93 
106  bool is_hand_occupied_cb(sr_robot_msgs::is_hand_occupied::Request &req,
107  sr_robot_msgs::is_hand_occupied::Response &res);
108 
110 
121  bool which_fingers_are_touching_cb(sr_robot_msgs::which_fingers_are_touching::Request &req,
122  sr_robot_msgs::which_fingers_are_touching::Response &res);
123 
135  std::vector<std::vector<std::string> > get_all_names();
136 };
137 } // namespace shadowrobot
138 
139 
140 /* For the emacs weenies in the crowd.
141 Local Variables:
142  c-basic-offset: 2
143 End:
144 */
145 
146 #endif
std::vector< boost::shared_ptr< SrGenericTactileSensor > > tactile_sensors
SrGenericTactileSensor(std::string name, std::string touch_name)


sr_tactile_sensors
Author(s): Ugo Cupcic
autogenerated on Mon Feb 28 2022 23:52:14