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