$search
00001 """autogenerated by genmsg_py from GetMeshRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class GetMeshRequest(roslib.message.Message): 00007 _md5sum = "80afe6caba30c992d2e7ff6ff0e0d51e" 00008 _type = "srs_object_database_msgs/GetMeshRequest" 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 """ 00019 __slots__ = ['model_ids'] 00020 _slot_types = ['int32[]'] 00021 00022 def __init__(self, *args, **kwds): 00023 """ 00024 Constructor. Any message fields that are implicitly/explicitly 00025 set to None will be assigned a default value. The recommend 00026 use is keyword arguments as this is more robust to future message 00027 changes. You cannot mix in-order arguments and keyword arguments. 00028 00029 The available fields are: 00030 model_ids 00031 00032 @param args: complete set of field values, in .msg order 00033 @param kwds: use keyword arguments corresponding to message field names 00034 to set specific fields. 00035 """ 00036 if args or kwds: 00037 super(GetMeshRequest, self).__init__(*args, **kwds) 00038 #message fields cannot be None, assign default values for those that are 00039 if self.model_ids is None: 00040 self.model_ids = [] 00041 else: 00042 self.model_ids = [] 00043 00044 def _get_types(self): 00045 """ 00046 internal API method 00047 """ 00048 return self._slot_types 00049 00050 def serialize(self, buff): 00051 """ 00052 serialize message into buffer 00053 @param buff: buffer 00054 @type buff: StringIO 00055 """ 00056 try: 00057 length = len(self.model_ids) 00058 buff.write(_struct_I.pack(length)) 00059 pattern = '<%si'%length 00060 buff.write(struct.pack(pattern, *self.model_ids)) 00061 except struct.error as se: self._check_types(se) 00062 except TypeError as te: self._check_types(te) 00063 00064 def deserialize(self, str): 00065 """ 00066 unpack serialized message in str into this message instance 00067 @param str: byte array of serialized message 00068 @type str: str 00069 """ 00070 try: 00071 end = 0 00072 start = end 00073 end += 4 00074 (length,) = _struct_I.unpack(str[start:end]) 00075 pattern = '<%si'%length 00076 start = end 00077 end += struct.calcsize(pattern) 00078 self.model_ids = struct.unpack(pattern, str[start:end]) 00079 return self 00080 except struct.error as e: 00081 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00082 00083 00084 def serialize_numpy(self, buff, numpy): 00085 """ 00086 serialize message with numpy array types into buffer 00087 @param buff: buffer 00088 @type buff: StringIO 00089 @param numpy: numpy python module 00090 @type numpy module 00091 """ 00092 try: 00093 length = len(self.model_ids) 00094 buff.write(_struct_I.pack(length)) 00095 pattern = '<%si'%length 00096 buff.write(self.model_ids.tostring()) 00097 except struct.error as se: self._check_types(se) 00098 except TypeError as te: self._check_types(te) 00099 00100 def deserialize_numpy(self, str, numpy): 00101 """ 00102 unpack serialized message in str into this message instance using numpy for array types 00103 @param str: byte array of serialized message 00104 @type str: str 00105 @param numpy: numpy python module 00106 @type numpy: module 00107 """ 00108 try: 00109 end = 0 00110 start = end 00111 end += 4 00112 (length,) = _struct_I.unpack(str[start:end]) 00113 pattern = '<%si'%length 00114 start = end 00115 end += struct.calcsize(pattern) 00116 self.model_ids = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 00117 return self 00118 except struct.error as e: 00119 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00120 00121 _struct_I = roslib.message.struct_I 00122 """autogenerated by genmsg_py from GetMeshResponse.msg. Do not edit.""" 00123 import roslib.message 00124 import struct 00125 00126 import arm_navigation_msgs.msg 00127 import srs_object_database_msgs.msg 00128 import geometry_msgs.msg 00129 00130 class GetMeshResponse(roslib.message.Message): 00131 _md5sum = "859f0c9f87bd71b652ef91870aa5a727" 00132 _type = "srs_object_database_msgs/GetMeshResponse" 00133 _has_header = False #flag to mark the presence of a Header object 00134 _full_text = """ 00135 string return_response 00136 srs_object_database_msgs/mesh[] msg 00137 00138 00139 ================================================================================ 00140 MSG: srs_object_database_msgs/mesh 00141 int32 objectId 00142 arm_navigation_msgs/Shape mesh 00143 string type 00144 uint8[] data 00145 ================================================================================ 00146 MSG: arm_navigation_msgs/Shape 00147 byte SPHERE=0 00148 byte BOX=1 00149 byte CYLINDER=2 00150 byte MESH=3 00151 00152 byte type 00153 00154 00155 #### define sphere, box, cylinder #### 00156 # the origin of each shape is considered at the shape's center 00157 00158 # for sphere 00159 # radius := dimensions[0] 00160 00161 # for cylinder 00162 # radius := dimensions[0] 00163 # length := dimensions[1] 00164 # the length is along the Z axis 00165 00166 # for box 00167 # size_x := dimensions[0] 00168 # size_y := dimensions[1] 00169 # size_z := dimensions[2] 00170 float64[] dimensions 00171 00172 00173 #### define mesh #### 00174 00175 # list of triangles; triangle k is defined by tre vertices located 00176 # at indices triangles[3k], triangles[3k+1], triangles[3k+2] 00177 int32[] triangles 00178 geometry_msgs/Point[] vertices 00179 00180 ================================================================================ 00181 MSG: geometry_msgs/Point 00182 # This contains the position of a point in free space 00183 float64 x 00184 float64 y 00185 float64 z 00186 00187 """ 00188 __slots__ = ['return_response','msg'] 00189 _slot_types = ['string','srs_object_database_msgs/mesh[]'] 00190 00191 def __init__(self, *args, **kwds): 00192 """ 00193 Constructor. Any message fields that are implicitly/explicitly 00194 set to None will be assigned a default value. The recommend 00195 use is keyword arguments as this is more robust to future message 00196 changes. You cannot mix in-order arguments and keyword arguments. 00197 00198 The available fields are: 00199 return_response,msg 00200 00201 @param args: complete set of field values, in .msg order 00202 @param kwds: use keyword arguments corresponding to message field names 00203 to set specific fields. 00204 """ 00205 if args or kwds: 00206 super(GetMeshResponse, self).__init__(*args, **kwds) 00207 #message fields cannot be None, assign default values for those that are 00208 if self.return_response is None: 00209 self.return_response = '' 00210 if self.msg is None: 00211 self.msg = [] 00212 else: 00213 self.return_response = '' 00214 self.msg = [] 00215 00216 def _get_types(self): 00217 """ 00218 internal API method 00219 """ 00220 return self._slot_types 00221 00222 def serialize(self, buff): 00223 """ 00224 serialize message into buffer 00225 @param buff: buffer 00226 @type buff: StringIO 00227 """ 00228 try: 00229 _x = self.return_response 00230 length = len(_x) 00231 buff.write(struct.pack('<I%ss'%length, length, _x)) 00232 length = len(self.msg) 00233 buff.write(_struct_I.pack(length)) 00234 for val1 in self.msg: 00235 buff.write(_struct_i.pack(val1.objectId)) 00236 _v1 = val1.mesh 00237 buff.write(_struct_b.pack(_v1.type)) 00238 length = len(_v1.dimensions) 00239 buff.write(_struct_I.pack(length)) 00240 pattern = '<%sd'%length 00241 buff.write(struct.pack(pattern, *_v1.dimensions)) 00242 length = len(_v1.triangles) 00243 buff.write(_struct_I.pack(length)) 00244 pattern = '<%si'%length 00245 buff.write(struct.pack(pattern, *_v1.triangles)) 00246 length = len(_v1.vertices) 00247 buff.write(_struct_I.pack(length)) 00248 for val3 in _v1.vertices: 00249 _x = val3 00250 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00251 _x = val1.type 00252 length = len(_x) 00253 buff.write(struct.pack('<I%ss'%length, length, _x)) 00254 _x = val1.data 00255 length = len(_x) 00256 # - if encoded as a list instead, serialize as bytes instead of string 00257 if type(_x) in [list, tuple]: 00258 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00259 else: 00260 buff.write(struct.pack('<I%ss'%length, length, _x)) 00261 except struct.error as se: self._check_types(se) 00262 except TypeError as te: self._check_types(te) 00263 00264 def deserialize(self, str): 00265 """ 00266 unpack serialized message in str into this message instance 00267 @param str: byte array of serialized message 00268 @type str: str 00269 """ 00270 try: 00271 end = 0 00272 start = end 00273 end += 4 00274 (length,) = _struct_I.unpack(str[start:end]) 00275 start = end 00276 end += length 00277 self.return_response = str[start:end] 00278 start = end 00279 end += 4 00280 (length,) = _struct_I.unpack(str[start:end]) 00281 self.msg = [] 00282 for i in range(0, length): 00283 val1 = srs_object_database_msgs.msg.mesh() 00284 start = end 00285 end += 4 00286 (val1.objectId,) = _struct_i.unpack(str[start:end]) 00287 _v2 = val1.mesh 00288 start = end 00289 end += 1 00290 (_v2.type,) = _struct_b.unpack(str[start:end]) 00291 start = end 00292 end += 4 00293 (length,) = _struct_I.unpack(str[start:end]) 00294 pattern = '<%sd'%length 00295 start = end 00296 end += struct.calcsize(pattern) 00297 _v2.dimensions = struct.unpack(pattern, str[start:end]) 00298 start = end 00299 end += 4 00300 (length,) = _struct_I.unpack(str[start:end]) 00301 pattern = '<%si'%length 00302 start = end 00303 end += struct.calcsize(pattern) 00304 _v2.triangles = struct.unpack(pattern, str[start:end]) 00305 start = end 00306 end += 4 00307 (length,) = _struct_I.unpack(str[start:end]) 00308 _v2.vertices = [] 00309 for i in range(0, length): 00310 val3 = geometry_msgs.msg.Point() 00311 _x = val3 00312 start = end 00313 end += 24 00314 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00315 _v2.vertices.append(val3) 00316 start = end 00317 end += 4 00318 (length,) = _struct_I.unpack(str[start:end]) 00319 start = end 00320 end += length 00321 val1.type = str[start:end] 00322 start = end 00323 end += 4 00324 (length,) = _struct_I.unpack(str[start:end]) 00325 start = end 00326 end += length 00327 val1.data = str[start:end] 00328 self.msg.append(val1) 00329 return self 00330 except struct.error as e: 00331 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00332 00333 00334 def serialize_numpy(self, buff, numpy): 00335 """ 00336 serialize message with numpy array types into buffer 00337 @param buff: buffer 00338 @type buff: StringIO 00339 @param numpy: numpy python module 00340 @type numpy module 00341 """ 00342 try: 00343 _x = self.return_response 00344 length = len(_x) 00345 buff.write(struct.pack('<I%ss'%length, length, _x)) 00346 length = len(self.msg) 00347 buff.write(_struct_I.pack(length)) 00348 for val1 in self.msg: 00349 buff.write(_struct_i.pack(val1.objectId)) 00350 _v3 = val1.mesh 00351 buff.write(_struct_b.pack(_v3.type)) 00352 length = len(_v3.dimensions) 00353 buff.write(_struct_I.pack(length)) 00354 pattern = '<%sd'%length 00355 buff.write(_v3.dimensions.tostring()) 00356 length = len(_v3.triangles) 00357 buff.write(_struct_I.pack(length)) 00358 pattern = '<%si'%length 00359 buff.write(_v3.triangles.tostring()) 00360 length = len(_v3.vertices) 00361 buff.write(_struct_I.pack(length)) 00362 for val3 in _v3.vertices: 00363 _x = val3 00364 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00365 _x = val1.type 00366 length = len(_x) 00367 buff.write(struct.pack('<I%ss'%length, length, _x)) 00368 _x = val1.data 00369 length = len(_x) 00370 # - if encoded as a list instead, serialize as bytes instead of string 00371 if type(_x) in [list, tuple]: 00372 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00373 else: 00374 buff.write(struct.pack('<I%ss'%length, length, _x)) 00375 except struct.error as se: self._check_types(se) 00376 except TypeError as te: self._check_types(te) 00377 00378 def deserialize_numpy(self, str, numpy): 00379 """ 00380 unpack serialized message in str into this message instance using numpy for array types 00381 @param str: byte array of serialized message 00382 @type str: str 00383 @param numpy: numpy python module 00384 @type numpy: module 00385 """ 00386 try: 00387 end = 0 00388 start = end 00389 end += 4 00390 (length,) = _struct_I.unpack(str[start:end]) 00391 start = end 00392 end += length 00393 self.return_response = str[start:end] 00394 start = end 00395 end += 4 00396 (length,) = _struct_I.unpack(str[start:end]) 00397 self.msg = [] 00398 for i in range(0, length): 00399 val1 = srs_object_database_msgs.msg.mesh() 00400 start = end 00401 end += 4 00402 (val1.objectId,) = _struct_i.unpack(str[start:end]) 00403 _v4 = val1.mesh 00404 start = end 00405 end += 1 00406 (_v4.type,) = _struct_b.unpack(str[start:end]) 00407 start = end 00408 end += 4 00409 (length,) = _struct_I.unpack(str[start:end]) 00410 pattern = '<%sd'%length 00411 start = end 00412 end += struct.calcsize(pattern) 00413 _v4.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00414 start = end 00415 end += 4 00416 (length,) = _struct_I.unpack(str[start:end]) 00417 pattern = '<%si'%length 00418 start = end 00419 end += struct.calcsize(pattern) 00420 _v4.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 00421 start = end 00422 end += 4 00423 (length,) = _struct_I.unpack(str[start:end]) 00424 _v4.vertices = [] 00425 for i in range(0, length): 00426 val3 = geometry_msgs.msg.Point() 00427 _x = val3 00428 start = end 00429 end += 24 00430 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00431 _v4.vertices.append(val3) 00432 start = end 00433 end += 4 00434 (length,) = _struct_I.unpack(str[start:end]) 00435 start = end 00436 end += length 00437 val1.type = str[start:end] 00438 start = end 00439 end += 4 00440 (length,) = _struct_I.unpack(str[start:end]) 00441 start = end 00442 end += length 00443 val1.data = str[start:end] 00444 self.msg.append(val1) 00445 return self 00446 except struct.error as e: 00447 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00448 00449 _struct_I = roslib.message.struct_I 00450 _struct_i = struct.Struct("<i") 00451 _struct_b = struct.Struct("<b") 00452 _struct_3d = struct.Struct("<3d") 00453 class GetMesh(roslib.message.ServiceDefinition): 00454 _type = 'srs_object_database_msgs/GetMesh' 00455 _md5sum = 'a3772ee4f5f8006daae5f01f0b3dbee3' 00456 _request_class = GetMeshRequest 00457 _response_class = GetMeshResponse