$search
00001 """autogenerated by genmsg_py from CUAction.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import srs_knowledge.msg 00006 00007 class CUAction(roslib.message.Message): 00008 _md5sum = "dd380bff1522657abc20274417168b83" 00009 _type = "srs_knowledge/CUAction" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# still at alpha stage. not finalised yet. 00012 00013 # indicate if task finished successfully (1); no feasible solution (-1); continue executing the given actions in this message (0) 00014 int32 status 00015 00016 # [ifNavigate, ifDetect, ifGrasp]. 0: yes, 1: no, 2: others (undefined) 00017 #int32[] actionFlags 00018 00019 #MoveAction ma 00020 #PerceptionAction pa 00021 #GraspAction ga 00022 GenericAction generic 00023 00024 # move, perception, grasp, or generic 00025 string actionType 00026 ================================================================================ 00027 MSG: srs_knowledge/GenericAction 00028 # use a list as the information container of an action 00029 # BE CAREFUL WHEN USING IT. FOR FLEXIBILITY REASON OR TESTING NEW ADDED ACTION TYPE 00030 # string[] actionInfo # to deprecate 00031 string jsonActionInfo 00032 00033 """ 00034 __slots__ = ['status','generic','actionType'] 00035 _slot_types = ['int32','srs_knowledge/GenericAction','string'] 00036 00037 def __init__(self, *args, **kwds): 00038 """ 00039 Constructor. Any message fields that are implicitly/explicitly 00040 set to None will be assigned a default value. The recommend 00041 use is keyword arguments as this is more robust to future message 00042 changes. You cannot mix in-order arguments and keyword arguments. 00043 00044 The available fields are: 00045 status,generic,actionType 00046 00047 @param args: complete set of field values, in .msg order 00048 @param kwds: use keyword arguments corresponding to message field names 00049 to set specific fields. 00050 """ 00051 if args or kwds: 00052 super(CUAction, self).__init__(*args, **kwds) 00053 #message fields cannot be None, assign default values for those that are 00054 if self.status is None: 00055 self.status = 0 00056 if self.generic is None: 00057 self.generic = srs_knowledge.msg.GenericAction() 00058 if self.actionType is None: 00059 self.actionType = '' 00060 else: 00061 self.status = 0 00062 self.generic = srs_knowledge.msg.GenericAction() 00063 self.actionType = '' 00064 00065 def _get_types(self): 00066 """ 00067 internal API method 00068 """ 00069 return self._slot_types 00070 00071 def serialize(self, buff): 00072 """ 00073 serialize message into buffer 00074 @param buff: buffer 00075 @type buff: StringIO 00076 """ 00077 try: 00078 buff.write(_struct_i.pack(self.status)) 00079 _x = self.generic.jsonActionInfo 00080 length = len(_x) 00081 buff.write(struct.pack('<I%ss'%length, length, _x)) 00082 _x = self.actionType 00083 length = len(_x) 00084 buff.write(struct.pack('<I%ss'%length, length, _x)) 00085 except struct.error as se: self._check_types(se) 00086 except TypeError as te: self._check_types(te) 00087 00088 def deserialize(self, str): 00089 """ 00090 unpack serialized message in str into this message instance 00091 @param str: byte array of serialized message 00092 @type str: str 00093 """ 00094 try: 00095 if self.generic is None: 00096 self.generic = srs_knowledge.msg.GenericAction() 00097 end = 0 00098 start = end 00099 end += 4 00100 (self.status,) = _struct_i.unpack(str[start:end]) 00101 start = end 00102 end += 4 00103 (length,) = _struct_I.unpack(str[start:end]) 00104 start = end 00105 end += length 00106 self.generic.jsonActionInfo = str[start:end] 00107 start = end 00108 end += 4 00109 (length,) = _struct_I.unpack(str[start:end]) 00110 start = end 00111 end += length 00112 self.actionType = str[start:end] 00113 return self 00114 except struct.error as e: 00115 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00116 00117 00118 def serialize_numpy(self, buff, numpy): 00119 """ 00120 serialize message with numpy array types into buffer 00121 @param buff: buffer 00122 @type buff: StringIO 00123 @param numpy: numpy python module 00124 @type numpy module 00125 """ 00126 try: 00127 buff.write(_struct_i.pack(self.status)) 00128 _x = self.generic.jsonActionInfo 00129 length = len(_x) 00130 buff.write(struct.pack('<I%ss'%length, length, _x)) 00131 _x = self.actionType 00132 length = len(_x) 00133 buff.write(struct.pack('<I%ss'%length, length, _x)) 00134 except struct.error as se: self._check_types(se) 00135 except TypeError as te: self._check_types(te) 00136 00137 def deserialize_numpy(self, str, numpy): 00138 """ 00139 unpack serialized message in str into this message instance using numpy for array types 00140 @param str: byte array of serialized message 00141 @type str: str 00142 @param numpy: numpy python module 00143 @type numpy: module 00144 """ 00145 try: 00146 if self.generic is None: 00147 self.generic = srs_knowledge.msg.GenericAction() 00148 end = 0 00149 start = end 00150 end += 4 00151 (self.status,) = _struct_i.unpack(str[start:end]) 00152 start = end 00153 end += 4 00154 (length,) = _struct_I.unpack(str[start:end]) 00155 start = end 00156 end += length 00157 self.generic.jsonActionInfo = str[start:end] 00158 start = end 00159 end += 4 00160 (length,) = _struct_I.unpack(str[start:end]) 00161 start = end 00162 end += length 00163 self.actionType = str[start:end] 00164 return self 00165 except struct.error as e: 00166 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00167 00168 _struct_I = roslib.message.struct_I 00169 _struct_i = struct.Struct("<i")