$search
00001 """autogenerated by genmsg_py from PlanNextActionRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class PlanNextActionRequest(roslib.message.Message): 00007 _md5sum = "90aa55f2110a11f60c77302fa9d17f42" 00008 _type = "srs_knowledge/PlanNextActionRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """ 00011 00012 int32 sessionId 00013 00014 00015 00016 00017 00018 00019 00020 00021 int32 resultLastAction 00022 00023 00024 00025 00026 string jsonFeedback 00027 00028 00029 """ 00030 __slots__ = ['sessionId','resultLastAction','jsonFeedback'] 00031 _slot_types = ['int32','int32','string'] 00032 00033 def __init__(self, *args, **kwds): 00034 """ 00035 Constructor. Any message fields that are implicitly/explicitly 00036 set to None will be assigned a default value. The recommend 00037 use is keyword arguments as this is more robust to future message 00038 changes. You cannot mix in-order arguments and keyword arguments. 00039 00040 The available fields are: 00041 sessionId,resultLastAction,jsonFeedback 00042 00043 @param args: complete set of field values, in .msg order 00044 @param kwds: use keyword arguments corresponding to message field names 00045 to set specific fields. 00046 """ 00047 if args or kwds: 00048 super(PlanNextActionRequest, self).__init__(*args, **kwds) 00049 #message fields cannot be None, assign default values for those that are 00050 if self.sessionId is None: 00051 self.sessionId = 0 00052 if self.resultLastAction is None: 00053 self.resultLastAction = 0 00054 if self.jsonFeedback is None: 00055 self.jsonFeedback = '' 00056 else: 00057 self.sessionId = 0 00058 self.resultLastAction = 0 00059 self.jsonFeedback = '' 00060 00061 def _get_types(self): 00062 """ 00063 internal API method 00064 """ 00065 return self._slot_types 00066 00067 def serialize(self, buff): 00068 """ 00069 serialize message into buffer 00070 @param buff: buffer 00071 @type buff: StringIO 00072 """ 00073 try: 00074 _x = self 00075 buff.write(_struct_2i.pack(_x.sessionId, _x.resultLastAction)) 00076 _x = self.jsonFeedback 00077 length = len(_x) 00078 buff.write(struct.pack('<I%ss'%length, length, _x)) 00079 except struct.error as se: self._check_types(se) 00080 except TypeError as te: self._check_types(te) 00081 00082 def deserialize(self, str): 00083 """ 00084 unpack serialized message in str into this message instance 00085 @param str: byte array of serialized message 00086 @type str: str 00087 """ 00088 try: 00089 end = 0 00090 _x = self 00091 start = end 00092 end += 8 00093 (_x.sessionId, _x.resultLastAction,) = _struct_2i.unpack(str[start:end]) 00094 start = end 00095 end += 4 00096 (length,) = _struct_I.unpack(str[start:end]) 00097 start = end 00098 end += length 00099 self.jsonFeedback = str[start:end] 00100 return self 00101 except struct.error as e: 00102 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00103 00104 00105 def serialize_numpy(self, buff, numpy): 00106 """ 00107 serialize message with numpy array types into buffer 00108 @param buff: buffer 00109 @type buff: StringIO 00110 @param numpy: numpy python module 00111 @type numpy module 00112 """ 00113 try: 00114 _x = self 00115 buff.write(_struct_2i.pack(_x.sessionId, _x.resultLastAction)) 00116 _x = self.jsonFeedback 00117 length = len(_x) 00118 buff.write(struct.pack('<I%ss'%length, length, _x)) 00119 except struct.error as se: self._check_types(se) 00120 except TypeError as te: self._check_types(te) 00121 00122 def deserialize_numpy(self, str, numpy): 00123 """ 00124 unpack serialized message in str into this message instance using numpy for array types 00125 @param str: byte array of serialized message 00126 @type str: str 00127 @param numpy: numpy python module 00128 @type numpy: module 00129 """ 00130 try: 00131 end = 0 00132 _x = self 00133 start = end 00134 end += 8 00135 (_x.sessionId, _x.resultLastAction,) = _struct_2i.unpack(str[start:end]) 00136 start = end 00137 end += 4 00138 (length,) = _struct_I.unpack(str[start:end]) 00139 start = end 00140 end += length 00141 self.jsonFeedback = str[start:end] 00142 return self 00143 except struct.error as e: 00144 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00145 00146 _struct_I = roslib.message.struct_I 00147 _struct_2i = struct.Struct("<2i") 00148 """autogenerated by genmsg_py from PlanNextActionResponse.msg. Do not edit.""" 00149 import roslib.message 00150 import struct 00151 00152 import srs_knowledge.msg 00153 00154 class PlanNextActionResponse(roslib.message.Message): 00155 _md5sum = "3cfc405d12917b675e44ffae8a735c2f" 00156 _type = "srs_knowledge/PlanNextActionResponse" 00157 _has_header = False #flag to mark the presence of a Header object 00158 _full_text = """ 00159 00160 CUAction nextAction 00161 00162 00163 ================================================================================ 00164 MSG: srs_knowledge/CUAction 00165 # still at alpha stage. not finalised yet. 00166 00167 # indicate if task finished successfully (1); no feasible solution (-1); continue executing the given actions in this message (0) 00168 int32 status 00169 00170 # [ifNavigate, ifDetect, ifGrasp]. 0: yes, 1: no, 2: others (undefined) 00171 #int32[] actionFlags 00172 00173 #MoveAction ma 00174 #PerceptionAction pa 00175 #GraspAction ga 00176 GenericAction generic 00177 00178 # move, perception, grasp, or generic 00179 string actionType 00180 ================================================================================ 00181 MSG: srs_knowledge/GenericAction 00182 # use a list as the information container of an action 00183 # BE CAREFUL WHEN USING IT. FOR FLEXIBILITY REASON OR TESTING NEW ADDED ACTION TYPE 00184 # string[] actionInfo # to deprecate 00185 string jsonActionInfo 00186 00187 """ 00188 __slots__ = ['nextAction'] 00189 _slot_types = ['srs_knowledge/CUAction'] 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 nextAction 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(PlanNextActionResponse, self).__init__(*args, **kwds) 00207 #message fields cannot be None, assign default values for those that are 00208 if self.nextAction is None: 00209 self.nextAction = srs_knowledge.msg.CUAction() 00210 else: 00211 self.nextAction = srs_knowledge.msg.CUAction() 00212 00213 def _get_types(self): 00214 """ 00215 internal API method 00216 """ 00217 return self._slot_types 00218 00219 def serialize(self, buff): 00220 """ 00221 serialize message into buffer 00222 @param buff: buffer 00223 @type buff: StringIO 00224 """ 00225 try: 00226 buff.write(_struct_i.pack(self.nextAction.status)) 00227 _x = self.nextAction.generic.jsonActionInfo 00228 length = len(_x) 00229 buff.write(struct.pack('<I%ss'%length, length, _x)) 00230 _x = self.nextAction.actionType 00231 length = len(_x) 00232 buff.write(struct.pack('<I%ss'%length, length, _x)) 00233 except struct.error as se: self._check_types(se) 00234 except TypeError as te: self._check_types(te) 00235 00236 def deserialize(self, str): 00237 """ 00238 unpack serialized message in str into this message instance 00239 @param str: byte array of serialized message 00240 @type str: str 00241 """ 00242 try: 00243 if self.nextAction is None: 00244 self.nextAction = srs_knowledge.msg.CUAction() 00245 end = 0 00246 start = end 00247 end += 4 00248 (self.nextAction.status,) = _struct_i.unpack(str[start:end]) 00249 start = end 00250 end += 4 00251 (length,) = _struct_I.unpack(str[start:end]) 00252 start = end 00253 end += length 00254 self.nextAction.generic.jsonActionInfo = str[start:end] 00255 start = end 00256 end += 4 00257 (length,) = _struct_I.unpack(str[start:end]) 00258 start = end 00259 end += length 00260 self.nextAction.actionType = str[start:end] 00261 return self 00262 except struct.error as e: 00263 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00264 00265 00266 def serialize_numpy(self, buff, numpy): 00267 """ 00268 serialize message with numpy array types into buffer 00269 @param buff: buffer 00270 @type buff: StringIO 00271 @param numpy: numpy python module 00272 @type numpy module 00273 """ 00274 try: 00275 buff.write(_struct_i.pack(self.nextAction.status)) 00276 _x = self.nextAction.generic.jsonActionInfo 00277 length = len(_x) 00278 buff.write(struct.pack('<I%ss'%length, length, _x)) 00279 _x = self.nextAction.actionType 00280 length = len(_x) 00281 buff.write(struct.pack('<I%ss'%length, length, _x)) 00282 except struct.error as se: self._check_types(se) 00283 except TypeError as te: self._check_types(te) 00284 00285 def deserialize_numpy(self, str, numpy): 00286 """ 00287 unpack serialized message in str into this message instance using numpy for array types 00288 @param str: byte array of serialized message 00289 @type str: str 00290 @param numpy: numpy python module 00291 @type numpy: module 00292 """ 00293 try: 00294 if self.nextAction is None: 00295 self.nextAction = srs_knowledge.msg.CUAction() 00296 end = 0 00297 start = end 00298 end += 4 00299 (self.nextAction.status,) = _struct_i.unpack(str[start:end]) 00300 start = end 00301 end += 4 00302 (length,) = _struct_I.unpack(str[start:end]) 00303 start = end 00304 end += length 00305 self.nextAction.generic.jsonActionInfo = str[start:end] 00306 start = end 00307 end += 4 00308 (length,) = _struct_I.unpack(str[start:end]) 00309 start = end 00310 end += length 00311 self.nextAction.actionType = str[start:end] 00312 return self 00313 except struct.error as e: 00314 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00315 00316 _struct_I = roslib.message.struct_I 00317 _struct_i = struct.Struct("<i") 00318 class PlanNextAction(roslib.message.ServiceDefinition): 00319 _type = 'srs_knowledge/PlanNextAction' 00320 _md5sum = 'fc8c22a04eb6f13d60a0e9d1d3eff505' 00321 _request_class = PlanNextActionRequest 00322 _response_class = PlanNextActionResponse