$search
00001 """autogenerated by genmsg_py from which_fingers_are_touchingRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class which_fingers_are_touchingRequest(roslib.message.Message): 00007 _md5sum = "f0fd736c3daac04fcc02a89421c67ccd" 00008 _type = "sr_robot_msgs/which_fingers_are_touchingRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """ 00011 00012 00013 00014 float64[] force_thresholds 00015 00016 """ 00017 __slots__ = ['force_thresholds'] 00018 _slot_types = ['float64[]'] 00019 00020 def __init__(self, *args, **kwds): 00021 """ 00022 Constructor. Any message fields that are implicitly/explicitly 00023 set to None will be assigned a default value. The recommend 00024 use is keyword arguments as this is more robust to future message 00025 changes. You cannot mix in-order arguments and keyword arguments. 00026 00027 The available fields are: 00028 force_thresholds 00029 00030 @param args: complete set of field values, in .msg order 00031 @param kwds: use keyword arguments corresponding to message field names 00032 to set specific fields. 00033 """ 00034 if args or kwds: 00035 super(which_fingers_are_touchingRequest, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.force_thresholds is None: 00038 self.force_thresholds = [] 00039 else: 00040 self.force_thresholds = [] 00041 00042 def _get_types(self): 00043 """ 00044 internal API method 00045 """ 00046 return self._slot_types 00047 00048 def serialize(self, buff): 00049 """ 00050 serialize message into buffer 00051 @param buff: buffer 00052 @type buff: StringIO 00053 """ 00054 try: 00055 length = len(self.force_thresholds) 00056 buff.write(_struct_I.pack(length)) 00057 pattern = '<%sd'%length 00058 buff.write(struct.pack(pattern, *self.force_thresholds)) 00059 except struct.error as se: self._check_types(se) 00060 except TypeError as te: self._check_types(te) 00061 00062 def deserialize(self, str): 00063 """ 00064 unpack serialized message in str into this message instance 00065 @param str: byte array of serialized message 00066 @type str: str 00067 """ 00068 try: 00069 end = 0 00070 start = end 00071 end += 4 00072 (length,) = _struct_I.unpack(str[start:end]) 00073 pattern = '<%sd'%length 00074 start = end 00075 end += struct.calcsize(pattern) 00076 self.force_thresholds = struct.unpack(pattern, str[start:end]) 00077 return self 00078 except struct.error as e: 00079 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00080 00081 00082 def serialize_numpy(self, buff, numpy): 00083 """ 00084 serialize message with numpy array types into buffer 00085 @param buff: buffer 00086 @type buff: StringIO 00087 @param numpy: numpy python module 00088 @type numpy module 00089 """ 00090 try: 00091 length = len(self.force_thresholds) 00092 buff.write(_struct_I.pack(length)) 00093 pattern = '<%sd'%length 00094 buff.write(self.force_thresholds.tostring()) 00095 except struct.error as se: self._check_types(se) 00096 except TypeError as te: self._check_types(te) 00097 00098 def deserialize_numpy(self, str, numpy): 00099 """ 00100 unpack serialized message in str into this message instance using numpy for array types 00101 @param str: byte array of serialized message 00102 @type str: str 00103 @param numpy: numpy python module 00104 @type numpy: module 00105 """ 00106 try: 00107 end = 0 00108 start = end 00109 end += 4 00110 (length,) = _struct_I.unpack(str[start:end]) 00111 pattern = '<%sd'%length 00112 start = end 00113 end += struct.calcsize(pattern) 00114 self.force_thresholds = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00115 return self 00116 except struct.error as e: 00117 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00118 00119 _struct_I = roslib.message.struct_I 00120 """autogenerated by genmsg_py from which_fingers_are_touchingResponse.msg. Do not edit.""" 00121 import roslib.message 00122 import struct 00123 00124 00125 class which_fingers_are_touchingResponse(roslib.message.Message): 00126 _md5sum = "f9d8b7193733b8133389d5ada08e713d" 00127 _type = "sr_robot_msgs/which_fingers_are_touchingResponse" 00128 _has_header = False #flag to mark the presence of a Header object 00129 _full_text = """float64[] touch_forces 00130 00131 00132 00133 00134 00135 """ 00136 __slots__ = ['touch_forces'] 00137 _slot_types = ['float64[]'] 00138 00139 def __init__(self, *args, **kwds): 00140 """ 00141 Constructor. Any message fields that are implicitly/explicitly 00142 set to None will be assigned a default value. The recommend 00143 use is keyword arguments as this is more robust to future message 00144 changes. You cannot mix in-order arguments and keyword arguments. 00145 00146 The available fields are: 00147 touch_forces 00148 00149 @param args: complete set of field values, in .msg order 00150 @param kwds: use keyword arguments corresponding to message field names 00151 to set specific fields. 00152 """ 00153 if args or kwds: 00154 super(which_fingers_are_touchingResponse, self).__init__(*args, **kwds) 00155 #message fields cannot be None, assign default values for those that are 00156 if self.touch_forces is None: 00157 self.touch_forces = [] 00158 else: 00159 self.touch_forces = [] 00160 00161 def _get_types(self): 00162 """ 00163 internal API method 00164 """ 00165 return self._slot_types 00166 00167 def serialize(self, buff): 00168 """ 00169 serialize message into buffer 00170 @param buff: buffer 00171 @type buff: StringIO 00172 """ 00173 try: 00174 length = len(self.touch_forces) 00175 buff.write(_struct_I.pack(length)) 00176 pattern = '<%sd'%length 00177 buff.write(struct.pack(pattern, *self.touch_forces)) 00178 except struct.error as se: self._check_types(se) 00179 except TypeError as te: self._check_types(te) 00180 00181 def deserialize(self, str): 00182 """ 00183 unpack serialized message in str into this message instance 00184 @param str: byte array of serialized message 00185 @type str: str 00186 """ 00187 try: 00188 end = 0 00189 start = end 00190 end += 4 00191 (length,) = _struct_I.unpack(str[start:end]) 00192 pattern = '<%sd'%length 00193 start = end 00194 end += struct.calcsize(pattern) 00195 self.touch_forces = struct.unpack(pattern, str[start:end]) 00196 return self 00197 except struct.error as e: 00198 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00199 00200 00201 def serialize_numpy(self, buff, numpy): 00202 """ 00203 serialize message with numpy array types into buffer 00204 @param buff: buffer 00205 @type buff: StringIO 00206 @param numpy: numpy python module 00207 @type numpy module 00208 """ 00209 try: 00210 length = len(self.touch_forces) 00211 buff.write(_struct_I.pack(length)) 00212 pattern = '<%sd'%length 00213 buff.write(self.touch_forces.tostring()) 00214 except struct.error as se: self._check_types(se) 00215 except TypeError as te: self._check_types(te) 00216 00217 def deserialize_numpy(self, str, numpy): 00218 """ 00219 unpack serialized message in str into this message instance using numpy for array types 00220 @param str: byte array of serialized message 00221 @type str: str 00222 @param numpy: numpy python module 00223 @type numpy: module 00224 """ 00225 try: 00226 end = 0 00227 start = end 00228 end += 4 00229 (length,) = _struct_I.unpack(str[start:end]) 00230 pattern = '<%sd'%length 00231 start = end 00232 end += struct.calcsize(pattern) 00233 self.touch_forces = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00234 return self 00235 except struct.error as e: 00236 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00237 00238 _struct_I = roslib.message.struct_I 00239 class which_fingers_are_touching(roslib.message.ServiceDefinition): 00240 _type = 'sr_robot_msgs/which_fingers_are_touching' 00241 _md5sum = '5db90fdcbce6b7b34ac0a1f94863f7e2' 00242 _request_class = which_fingers_are_touchingRequest 00243 _response_class = which_fingers_are_touchingResponse