$search
00001 """autogenerated by genmsg_py from GetGraspRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class GetGraspRequest(roslib.message.Message): 00007 _md5sum = "80afe6caba30c992d2e7ff6ff0e0d51e" 00008 _type = "srs_object_database_msgs/GetGraspRequest" 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 """ 00018 __slots__ = ['model_ids'] 00019 _slot_types = ['int32[]'] 00020 00021 def __init__(self, *args, **kwds): 00022 """ 00023 Constructor. Any message fields that are implicitly/explicitly 00024 set to None will be assigned a default value. The recommend 00025 use is keyword arguments as this is more robust to future message 00026 changes. You cannot mix in-order arguments and keyword arguments. 00027 00028 The available fields are: 00029 model_ids 00030 00031 @param args: complete set of field values, in .msg order 00032 @param kwds: use keyword arguments corresponding to message field names 00033 to set specific fields. 00034 """ 00035 if args or kwds: 00036 super(GetGraspRequest, self).__init__(*args, **kwds) 00037 #message fields cannot be None, assign default values for those that are 00038 if self.model_ids is None: 00039 self.model_ids = [] 00040 else: 00041 self.model_ids = [] 00042 00043 def _get_types(self): 00044 """ 00045 internal API method 00046 """ 00047 return self._slot_types 00048 00049 def serialize(self, buff): 00050 """ 00051 serialize message into buffer 00052 @param buff: buffer 00053 @type buff: StringIO 00054 """ 00055 try: 00056 length = len(self.model_ids) 00057 buff.write(_struct_I.pack(length)) 00058 pattern = '<%si'%length 00059 buff.write(struct.pack(pattern, *self.model_ids)) 00060 except struct.error as se: self._check_types(se) 00061 except TypeError as te: self._check_types(te) 00062 00063 def deserialize(self, str): 00064 """ 00065 unpack serialized message in str into this message instance 00066 @param str: byte array of serialized message 00067 @type str: str 00068 """ 00069 try: 00070 end = 0 00071 start = end 00072 end += 4 00073 (length,) = _struct_I.unpack(str[start:end]) 00074 pattern = '<%si'%length 00075 start = end 00076 end += struct.calcsize(pattern) 00077 self.model_ids = struct.unpack(pattern, str[start:end]) 00078 return self 00079 except struct.error as e: 00080 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00081 00082 00083 def serialize_numpy(self, buff, numpy): 00084 """ 00085 serialize message with numpy array types into buffer 00086 @param buff: buffer 00087 @type buff: StringIO 00088 @param numpy: numpy python module 00089 @type numpy module 00090 """ 00091 try: 00092 length = len(self.model_ids) 00093 buff.write(_struct_I.pack(length)) 00094 pattern = '<%si'%length 00095 buff.write(self.model_ids.tostring()) 00096 except struct.error as se: self._check_types(se) 00097 except TypeError as te: self._check_types(te) 00098 00099 def deserialize_numpy(self, str, numpy): 00100 """ 00101 unpack serialized message in str into this message instance using numpy for array types 00102 @param str: byte array of serialized message 00103 @type str: str 00104 @param numpy: numpy python module 00105 @type numpy: module 00106 """ 00107 try: 00108 end = 0 00109 start = end 00110 end += 4 00111 (length,) = _struct_I.unpack(str[start:end]) 00112 pattern = '<%si'%length 00113 start = end 00114 end += struct.calcsize(pattern) 00115 self.model_ids = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 00116 return self 00117 except struct.error as e: 00118 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00119 00120 _struct_I = roslib.message.struct_I 00121 """autogenerated by genmsg_py from GetGraspResponse.msg. Do not edit.""" 00122 import roslib.message 00123 import struct 00124 00125 import srs_object_database_msgs.msg 00126 00127 class GetGraspResponse(roslib.message.Message): 00128 _md5sum = "ceb53febd9683791f1b348a4d33610eb" 00129 _type = "srs_object_database_msgs/GetGraspResponse" 00130 _has_header = False #flag to mark the presence of a Header object 00131 _full_text = """ 00132 00133 string return_response 00134 00135 srs_object_database_msgs/grasp[] msg 00136 00137 00138 00139 00140 ================================================================================ 00141 MSG: srs_object_database_msgs/grasp 00142 int32 objectId 00143 string Objecttype 00144 string pose 00145 string fileDescription 00146 uint8[] bs 00147 int32 size 00148 00149 """ 00150 __slots__ = ['return_response','msg'] 00151 _slot_types = ['string','srs_object_database_msgs/grasp[]'] 00152 00153 def __init__(self, *args, **kwds): 00154 """ 00155 Constructor. Any message fields that are implicitly/explicitly 00156 set to None will be assigned a default value. The recommend 00157 use is keyword arguments as this is more robust to future message 00158 changes. You cannot mix in-order arguments and keyword arguments. 00159 00160 The available fields are: 00161 return_response,msg 00162 00163 @param args: complete set of field values, in .msg order 00164 @param kwds: use keyword arguments corresponding to message field names 00165 to set specific fields. 00166 """ 00167 if args or kwds: 00168 super(GetGraspResponse, self).__init__(*args, **kwds) 00169 #message fields cannot be None, assign default values for those that are 00170 if self.return_response is None: 00171 self.return_response = '' 00172 if self.msg is None: 00173 self.msg = [] 00174 else: 00175 self.return_response = '' 00176 self.msg = [] 00177 00178 def _get_types(self): 00179 """ 00180 internal API method 00181 """ 00182 return self._slot_types 00183 00184 def serialize(self, buff): 00185 """ 00186 serialize message into buffer 00187 @param buff: buffer 00188 @type buff: StringIO 00189 """ 00190 try: 00191 _x = self.return_response 00192 length = len(_x) 00193 buff.write(struct.pack('<I%ss'%length, length, _x)) 00194 length = len(self.msg) 00195 buff.write(_struct_I.pack(length)) 00196 for val1 in self.msg: 00197 buff.write(_struct_i.pack(val1.objectId)) 00198 _x = val1.Objecttype 00199 length = len(_x) 00200 buff.write(struct.pack('<I%ss'%length, length, _x)) 00201 _x = val1.pose 00202 length = len(_x) 00203 buff.write(struct.pack('<I%ss'%length, length, _x)) 00204 _x = val1.fileDescription 00205 length = len(_x) 00206 buff.write(struct.pack('<I%ss'%length, length, _x)) 00207 _x = val1.bs 00208 length = len(_x) 00209 # - if encoded as a list instead, serialize as bytes instead of string 00210 if type(_x) in [list, tuple]: 00211 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00212 else: 00213 buff.write(struct.pack('<I%ss'%length, length, _x)) 00214 buff.write(_struct_i.pack(val1.size)) 00215 except struct.error as se: self._check_types(se) 00216 except TypeError as te: self._check_types(te) 00217 00218 def deserialize(self, str): 00219 """ 00220 unpack serialized message in str into this message instance 00221 @param str: byte array of serialized message 00222 @type str: str 00223 """ 00224 try: 00225 end = 0 00226 start = end 00227 end += 4 00228 (length,) = _struct_I.unpack(str[start:end]) 00229 start = end 00230 end += length 00231 self.return_response = str[start:end] 00232 start = end 00233 end += 4 00234 (length,) = _struct_I.unpack(str[start:end]) 00235 self.msg = [] 00236 for i in range(0, length): 00237 val1 = srs_object_database_msgs.msg.grasp() 00238 start = end 00239 end += 4 00240 (val1.objectId,) = _struct_i.unpack(str[start:end]) 00241 start = end 00242 end += 4 00243 (length,) = _struct_I.unpack(str[start:end]) 00244 start = end 00245 end += length 00246 val1.Objecttype = str[start:end] 00247 start = end 00248 end += 4 00249 (length,) = _struct_I.unpack(str[start:end]) 00250 start = end 00251 end += length 00252 val1.pose = str[start:end] 00253 start = end 00254 end += 4 00255 (length,) = _struct_I.unpack(str[start:end]) 00256 start = end 00257 end += length 00258 val1.fileDescription = str[start:end] 00259 start = end 00260 end += 4 00261 (length,) = _struct_I.unpack(str[start:end]) 00262 start = end 00263 end += length 00264 val1.bs = str[start:end] 00265 start = end 00266 end += 4 00267 (val1.size,) = _struct_i.unpack(str[start:end]) 00268 self.msg.append(val1) 00269 return self 00270 except struct.error as e: 00271 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00272 00273 00274 def serialize_numpy(self, buff, numpy): 00275 """ 00276 serialize message with numpy array types into buffer 00277 @param buff: buffer 00278 @type buff: StringIO 00279 @param numpy: numpy python module 00280 @type numpy module 00281 """ 00282 try: 00283 _x = self.return_response 00284 length = len(_x) 00285 buff.write(struct.pack('<I%ss'%length, length, _x)) 00286 length = len(self.msg) 00287 buff.write(_struct_I.pack(length)) 00288 for val1 in self.msg: 00289 buff.write(_struct_i.pack(val1.objectId)) 00290 _x = val1.Objecttype 00291 length = len(_x) 00292 buff.write(struct.pack('<I%ss'%length, length, _x)) 00293 _x = val1.pose 00294 length = len(_x) 00295 buff.write(struct.pack('<I%ss'%length, length, _x)) 00296 _x = val1.fileDescription 00297 length = len(_x) 00298 buff.write(struct.pack('<I%ss'%length, length, _x)) 00299 _x = val1.bs 00300 length = len(_x) 00301 # - if encoded as a list instead, serialize as bytes instead of string 00302 if type(_x) in [list, tuple]: 00303 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00304 else: 00305 buff.write(struct.pack('<I%ss'%length, length, _x)) 00306 buff.write(_struct_i.pack(val1.size)) 00307 except struct.error as se: self._check_types(se) 00308 except TypeError as te: self._check_types(te) 00309 00310 def deserialize_numpy(self, str, numpy): 00311 """ 00312 unpack serialized message in str into this message instance using numpy for array types 00313 @param str: byte array of serialized message 00314 @type str: str 00315 @param numpy: numpy python module 00316 @type numpy: module 00317 """ 00318 try: 00319 end = 0 00320 start = end 00321 end += 4 00322 (length,) = _struct_I.unpack(str[start:end]) 00323 start = end 00324 end += length 00325 self.return_response = str[start:end] 00326 start = end 00327 end += 4 00328 (length,) = _struct_I.unpack(str[start:end]) 00329 self.msg = [] 00330 for i in range(0, length): 00331 val1 = srs_object_database_msgs.msg.grasp() 00332 start = end 00333 end += 4 00334 (val1.objectId,) = _struct_i.unpack(str[start:end]) 00335 start = end 00336 end += 4 00337 (length,) = _struct_I.unpack(str[start:end]) 00338 start = end 00339 end += length 00340 val1.Objecttype = str[start:end] 00341 start = end 00342 end += 4 00343 (length,) = _struct_I.unpack(str[start:end]) 00344 start = end 00345 end += length 00346 val1.pose = str[start:end] 00347 start = end 00348 end += 4 00349 (length,) = _struct_I.unpack(str[start:end]) 00350 start = end 00351 end += length 00352 val1.fileDescription = str[start:end] 00353 start = end 00354 end += 4 00355 (length,) = _struct_I.unpack(str[start:end]) 00356 start = end 00357 end += length 00358 val1.bs = str[start:end] 00359 start = end 00360 end += 4 00361 (val1.size,) = _struct_i.unpack(str[start:end]) 00362 self.msg.append(val1) 00363 return self 00364 except struct.error as e: 00365 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00366 00367 _struct_I = roslib.message.struct_I 00368 _struct_i = struct.Struct("<i") 00369 class GetGrasp(roslib.message.ServiceDefinition): 00370 _type = 'srs_object_database_msgs/GetGrasp' 00371 _md5sum = 'c0202fe21a6c8d396a99038df29693dc' 00372 _request_class = GetGraspRequest 00373 _response_class = GetGraspResponse