$search
00001 """autogenerated by genmsg_py from GetImgRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class GetImgRequest(roslib.message.Message): 00007 _md5sum = "77cd1e697fb96aaf550cf17b213846ac" 00008 _type = "srs_object_database_msgs/GetImgRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """ 00011 00012 00013 00014 int32[] model_ids 00015 00016 00017 string type 00018 00019 00020 """ 00021 __slots__ = ['model_ids','type'] 00022 _slot_types = ['int32[]','string'] 00023 00024 def __init__(self, *args, **kwds): 00025 """ 00026 Constructor. Any message fields that are implicitly/explicitly 00027 set to None will be assigned a default value. The recommend 00028 use is keyword arguments as this is more robust to future message 00029 changes. You cannot mix in-order arguments and keyword arguments. 00030 00031 The available fields are: 00032 model_ids,type 00033 00034 @param args: complete set of field values, in .msg order 00035 @param kwds: use keyword arguments corresponding to message field names 00036 to set specific fields. 00037 """ 00038 if args or kwds: 00039 super(GetImgRequest, self).__init__(*args, **kwds) 00040 #message fields cannot be None, assign default values for those that are 00041 if self.model_ids is None: 00042 self.model_ids = [] 00043 if self.type is None: 00044 self.type = '' 00045 else: 00046 self.model_ids = [] 00047 self.type = '' 00048 00049 def _get_types(self): 00050 """ 00051 internal API method 00052 """ 00053 return self._slot_types 00054 00055 def serialize(self, buff): 00056 """ 00057 serialize message into buffer 00058 @param buff: buffer 00059 @type buff: StringIO 00060 """ 00061 try: 00062 length = len(self.model_ids) 00063 buff.write(_struct_I.pack(length)) 00064 pattern = '<%si'%length 00065 buff.write(struct.pack(pattern, *self.model_ids)) 00066 _x = self.type 00067 length = len(_x) 00068 buff.write(struct.pack('<I%ss'%length, length, _x)) 00069 except struct.error as se: self._check_types(se) 00070 except TypeError as te: self._check_types(te) 00071 00072 def deserialize(self, str): 00073 """ 00074 unpack serialized message in str into this message instance 00075 @param str: byte array of serialized message 00076 @type str: str 00077 """ 00078 try: 00079 end = 0 00080 start = end 00081 end += 4 00082 (length,) = _struct_I.unpack(str[start:end]) 00083 pattern = '<%si'%length 00084 start = end 00085 end += struct.calcsize(pattern) 00086 self.model_ids = struct.unpack(pattern, str[start:end]) 00087 start = end 00088 end += 4 00089 (length,) = _struct_I.unpack(str[start:end]) 00090 start = end 00091 end += length 00092 self.type = str[start:end] 00093 return self 00094 except struct.error as e: 00095 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00096 00097 00098 def serialize_numpy(self, buff, numpy): 00099 """ 00100 serialize message with numpy array types into buffer 00101 @param buff: buffer 00102 @type buff: StringIO 00103 @param numpy: numpy python module 00104 @type numpy module 00105 """ 00106 try: 00107 length = len(self.model_ids) 00108 buff.write(_struct_I.pack(length)) 00109 pattern = '<%si'%length 00110 buff.write(self.model_ids.tostring()) 00111 _x = self.type 00112 length = len(_x) 00113 buff.write(struct.pack('<I%ss'%length, length, _x)) 00114 except struct.error as se: self._check_types(se) 00115 except TypeError as te: self._check_types(te) 00116 00117 def deserialize_numpy(self, str, numpy): 00118 """ 00119 unpack serialized message in str into this message instance using numpy for array types 00120 @param str: byte array of serialized message 00121 @type str: str 00122 @param numpy: numpy python module 00123 @type numpy: module 00124 """ 00125 try: 00126 end = 0 00127 start = end 00128 end += 4 00129 (length,) = _struct_I.unpack(str[start:end]) 00130 pattern = '<%si'%length 00131 start = end 00132 end += struct.calcsize(pattern) 00133 self.model_ids = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 00134 start = end 00135 end += 4 00136 (length,) = _struct_I.unpack(str[start:end]) 00137 start = end 00138 end += length 00139 self.type = str[start:end] 00140 return self 00141 except struct.error as e: 00142 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00143 00144 _struct_I = roslib.message.struct_I 00145 """autogenerated by genmsg_py from GetImgResponse.msg. Do not edit.""" 00146 import roslib.message 00147 import struct 00148 00149 import srs_object_database_msgs.msg 00150 import std_msgs.msg 00151 import sensor_msgs.msg 00152 00153 class GetImgResponse(roslib.message.Message): 00154 _md5sum = "f16e1f5f36fac921d1c918ee40af6ecb" 00155 _type = "srs_object_database_msgs/GetImgResponse" 00156 _has_header = False #flag to mark the presence of a Header object 00157 _full_text = """ 00158 00159 string return_response 00160 srs_object_database_msgs/img[] msg 00161 00162 00163 00164 ================================================================================ 00165 MSG: srs_object_database_msgs/img 00166 int32 objectId 00167 string description 00168 sensor_msgs/Image image 00169 ================================================================================ 00170 MSG: sensor_msgs/Image 00171 # This message contains an uncompressed image 00172 # (0, 0) is at top-left corner of image 00173 # 00174 00175 Header header # Header timestamp should be acquisition time of image 00176 # Header frame_id should be optical frame of camera 00177 # origin of frame should be optical center of cameara 00178 # +x should point to the right in the image 00179 # +y should point down in the image 00180 # +z should point into to plane of the image 00181 # If the frame_id here and the frame_id of the CameraInfo 00182 # message associated with the image conflict 00183 # the behavior is undefined 00184 00185 uint32 height # image height, that is, number of rows 00186 uint32 width # image width, that is, number of columns 00187 00188 # The legal values for encoding are in file src/image_encodings.cpp 00189 # If you want to standardize a new string format, join 00190 # ros-users@lists.sourceforge.net and send an email proposing a new encoding. 00191 00192 string encoding # Encoding of pixels -- channel meaning, ordering, size 00193 # taken from the list of strings in src/image_encodings.cpp 00194 00195 uint8 is_bigendian # is this data bigendian? 00196 uint32 step # Full row length in bytes 00197 uint8[] data # actual matrix data, size is (step * rows) 00198 00199 ================================================================================ 00200 MSG: std_msgs/Header 00201 # Standard metadata for higher-level stamped data types. 00202 # This is generally used to communicate timestamped data 00203 # in a particular coordinate frame. 00204 # 00205 # sequence ID: consecutively increasing ID 00206 uint32 seq 00207 #Two-integer timestamp that is expressed as: 00208 # * stamp.secs: seconds (stamp_secs) since epoch 00209 # * stamp.nsecs: nanoseconds since stamp_secs 00210 # time-handling sugar is provided by the client library 00211 time stamp 00212 #Frame this data is associated with 00213 # 0: no frame 00214 # 1: global frame 00215 string frame_id 00216 00217 """ 00218 __slots__ = ['return_response','msg'] 00219 _slot_types = ['string','srs_object_database_msgs/img[]'] 00220 00221 def __init__(self, *args, **kwds): 00222 """ 00223 Constructor. Any message fields that are implicitly/explicitly 00224 set to None will be assigned a default value. The recommend 00225 use is keyword arguments as this is more robust to future message 00226 changes. You cannot mix in-order arguments and keyword arguments. 00227 00228 The available fields are: 00229 return_response,msg 00230 00231 @param args: complete set of field values, in .msg order 00232 @param kwds: use keyword arguments corresponding to message field names 00233 to set specific fields. 00234 """ 00235 if args or kwds: 00236 super(GetImgResponse, self).__init__(*args, **kwds) 00237 #message fields cannot be None, assign default values for those that are 00238 if self.return_response is None: 00239 self.return_response = '' 00240 if self.msg is None: 00241 self.msg = [] 00242 else: 00243 self.return_response = '' 00244 self.msg = [] 00245 00246 def _get_types(self): 00247 """ 00248 internal API method 00249 """ 00250 return self._slot_types 00251 00252 def serialize(self, buff): 00253 """ 00254 serialize message into buffer 00255 @param buff: buffer 00256 @type buff: StringIO 00257 """ 00258 try: 00259 _x = self.return_response 00260 length = len(_x) 00261 buff.write(struct.pack('<I%ss'%length, length, _x)) 00262 length = len(self.msg) 00263 buff.write(_struct_I.pack(length)) 00264 for val1 in self.msg: 00265 buff.write(_struct_i.pack(val1.objectId)) 00266 _x = val1.description 00267 length = len(_x) 00268 buff.write(struct.pack('<I%ss'%length, length, _x)) 00269 _v1 = val1.image 00270 _v2 = _v1.header 00271 buff.write(_struct_I.pack(_v2.seq)) 00272 _v3 = _v2.stamp 00273 _x = _v3 00274 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00275 _x = _v2.frame_id 00276 length = len(_x) 00277 buff.write(struct.pack('<I%ss'%length, length, _x)) 00278 _x = _v1 00279 buff.write(_struct_2I.pack(_x.height, _x.width)) 00280 _x = _v1.encoding 00281 length = len(_x) 00282 buff.write(struct.pack('<I%ss'%length, length, _x)) 00283 _x = _v1 00284 buff.write(_struct_BI.pack(_x.is_bigendian, _x.step)) 00285 _x = _v1.data 00286 length = len(_x) 00287 # - if encoded as a list instead, serialize as bytes instead of string 00288 if type(_x) in [list, tuple]: 00289 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00290 else: 00291 buff.write(struct.pack('<I%ss'%length, length, _x)) 00292 except struct.error as se: self._check_types(se) 00293 except TypeError as te: self._check_types(te) 00294 00295 def deserialize(self, str): 00296 """ 00297 unpack serialized message in str into this message instance 00298 @param str: byte array of serialized message 00299 @type str: str 00300 """ 00301 try: 00302 end = 0 00303 start = end 00304 end += 4 00305 (length,) = _struct_I.unpack(str[start:end]) 00306 start = end 00307 end += length 00308 self.return_response = str[start:end] 00309 start = end 00310 end += 4 00311 (length,) = _struct_I.unpack(str[start:end]) 00312 self.msg = [] 00313 for i in range(0, length): 00314 val1 = srs_object_database_msgs.msg.img() 00315 start = end 00316 end += 4 00317 (val1.objectId,) = _struct_i.unpack(str[start:end]) 00318 start = end 00319 end += 4 00320 (length,) = _struct_I.unpack(str[start:end]) 00321 start = end 00322 end += length 00323 val1.description = str[start:end] 00324 _v4 = val1.image 00325 _v5 = _v4.header 00326 start = end 00327 end += 4 00328 (_v5.seq,) = _struct_I.unpack(str[start:end]) 00329 _v6 = _v5.stamp 00330 _x = _v6 00331 start = end 00332 end += 8 00333 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00334 start = end 00335 end += 4 00336 (length,) = _struct_I.unpack(str[start:end]) 00337 start = end 00338 end += length 00339 _v5.frame_id = str[start:end] 00340 _x = _v4 00341 start = end 00342 end += 8 00343 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00344 start = end 00345 end += 4 00346 (length,) = _struct_I.unpack(str[start:end]) 00347 start = end 00348 end += length 00349 _v4.encoding = str[start:end] 00350 _x = _v4 00351 start = end 00352 end += 5 00353 (_x.is_bigendian, _x.step,) = _struct_BI.unpack(str[start:end]) 00354 start = end 00355 end += 4 00356 (length,) = _struct_I.unpack(str[start:end]) 00357 start = end 00358 end += length 00359 _v4.data = str[start:end] 00360 self.msg.append(val1) 00361 return self 00362 except struct.error as e: 00363 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00364 00365 00366 def serialize_numpy(self, buff, numpy): 00367 """ 00368 serialize message with numpy array types into buffer 00369 @param buff: buffer 00370 @type buff: StringIO 00371 @param numpy: numpy python module 00372 @type numpy module 00373 """ 00374 try: 00375 _x = self.return_response 00376 length = len(_x) 00377 buff.write(struct.pack('<I%ss'%length, length, _x)) 00378 length = len(self.msg) 00379 buff.write(_struct_I.pack(length)) 00380 for val1 in self.msg: 00381 buff.write(_struct_i.pack(val1.objectId)) 00382 _x = val1.description 00383 length = len(_x) 00384 buff.write(struct.pack('<I%ss'%length, length, _x)) 00385 _v7 = val1.image 00386 _v8 = _v7.header 00387 buff.write(_struct_I.pack(_v8.seq)) 00388 _v9 = _v8.stamp 00389 _x = _v9 00390 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00391 _x = _v8.frame_id 00392 length = len(_x) 00393 buff.write(struct.pack('<I%ss'%length, length, _x)) 00394 _x = _v7 00395 buff.write(_struct_2I.pack(_x.height, _x.width)) 00396 _x = _v7.encoding 00397 length = len(_x) 00398 buff.write(struct.pack('<I%ss'%length, length, _x)) 00399 _x = _v7 00400 buff.write(_struct_BI.pack(_x.is_bigendian, _x.step)) 00401 _x = _v7.data 00402 length = len(_x) 00403 # - if encoded as a list instead, serialize as bytes instead of string 00404 if type(_x) in [list, tuple]: 00405 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00406 else: 00407 buff.write(struct.pack('<I%ss'%length, length, _x)) 00408 except struct.error as se: self._check_types(se) 00409 except TypeError as te: self._check_types(te) 00410 00411 def deserialize_numpy(self, str, numpy): 00412 """ 00413 unpack serialized message in str into this message instance using numpy for array types 00414 @param str: byte array of serialized message 00415 @type str: str 00416 @param numpy: numpy python module 00417 @type numpy: module 00418 """ 00419 try: 00420 end = 0 00421 start = end 00422 end += 4 00423 (length,) = _struct_I.unpack(str[start:end]) 00424 start = end 00425 end += length 00426 self.return_response = str[start:end] 00427 start = end 00428 end += 4 00429 (length,) = _struct_I.unpack(str[start:end]) 00430 self.msg = [] 00431 for i in range(0, length): 00432 val1 = srs_object_database_msgs.msg.img() 00433 start = end 00434 end += 4 00435 (val1.objectId,) = _struct_i.unpack(str[start:end]) 00436 start = end 00437 end += 4 00438 (length,) = _struct_I.unpack(str[start:end]) 00439 start = end 00440 end += length 00441 val1.description = str[start:end] 00442 _v10 = val1.image 00443 _v11 = _v10.header 00444 start = end 00445 end += 4 00446 (_v11.seq,) = _struct_I.unpack(str[start:end]) 00447 _v12 = _v11.stamp 00448 _x = _v12 00449 start = end 00450 end += 8 00451 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00452 start = end 00453 end += 4 00454 (length,) = _struct_I.unpack(str[start:end]) 00455 start = end 00456 end += length 00457 _v11.frame_id = str[start:end] 00458 _x = _v10 00459 start = end 00460 end += 8 00461 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00462 start = end 00463 end += 4 00464 (length,) = _struct_I.unpack(str[start:end]) 00465 start = end 00466 end += length 00467 _v10.encoding = str[start:end] 00468 _x = _v10 00469 start = end 00470 end += 5 00471 (_x.is_bigendian, _x.step,) = _struct_BI.unpack(str[start:end]) 00472 start = end 00473 end += 4 00474 (length,) = _struct_I.unpack(str[start:end]) 00475 start = end 00476 end += length 00477 _v10.data = str[start:end] 00478 self.msg.append(val1) 00479 return self 00480 except struct.error as e: 00481 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00482 00483 _struct_I = roslib.message.struct_I 00484 _struct_i = struct.Struct("<i") 00485 _struct_2I = struct.Struct("<2I") 00486 _struct_BI = struct.Struct("<BI") 00487 class GetImg(roslib.message.ServiceDefinition): 00488 _type = 'srs_object_database_msgs/GetImg' 00489 _md5sum = '537c22f986e5f0ba96c82f56b48af61b' 00490 _request_class = GetImgRequest 00491 _response_class = GetImgResponse