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