$search
00001 """autogenerated by genmsg_py from SRS_Action.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import srs_msgs.msg 00006 00007 class SRS_Action(roslib.message.Message): 00008 _md5sum = "78f876cadd0a50a227e671e96dc7e09b" 00009 _type = "srs_msgs/SRS_Action" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# this message contains information to define a SRS action 00012 00013 uint32 objectID #targeted object 00014 00015 string objectName #object name for easy reading 00016 00017 uint32 actionID #action to be applied 00018 00019 string actionName #action name for easy reading 00020 00021 bool component_is_required #a component is required or not 00022 00023 srs_msgs/Component[] components #components required 00024 00025 bool symbolic_is_required #a component is required or not 00026 00027 uint32 symbolicID # ID of the symbolic 00028 00029 string symbolicName #name of the symbolic 00030 00031 string description #a short description on the current action set to null if no description 00032 ================================================================================ 00033 MSG: srs_msgs/Component 00034 # this message contains information to define a list of required components for an action 00035 uint32 componentID #ID 00036 string componentName #Name 00037 00038 """ 00039 __slots__ = ['objectID','objectName','actionID','actionName','component_is_required','components','symbolic_is_required','symbolicID','symbolicName','description'] 00040 _slot_types = ['uint32','string','uint32','string','bool','srs_msgs/Component[]','bool','uint32','string','string'] 00041 00042 def __init__(self, *args, **kwds): 00043 """ 00044 Constructor. Any message fields that are implicitly/explicitly 00045 set to None will be assigned a default value. The recommend 00046 use is keyword arguments as this is more robust to future message 00047 changes. You cannot mix in-order arguments and keyword arguments. 00048 00049 The available fields are: 00050 objectID,objectName,actionID,actionName,component_is_required,components,symbolic_is_required,symbolicID,symbolicName,description 00051 00052 @param args: complete set of field values, in .msg order 00053 @param kwds: use keyword arguments corresponding to message field names 00054 to set specific fields. 00055 """ 00056 if args or kwds: 00057 super(SRS_Action, self).__init__(*args, **kwds) 00058 #message fields cannot be None, assign default values for those that are 00059 if self.objectID is None: 00060 self.objectID = 0 00061 if self.objectName is None: 00062 self.objectName = '' 00063 if self.actionID is None: 00064 self.actionID = 0 00065 if self.actionName is None: 00066 self.actionName = '' 00067 if self.component_is_required is None: 00068 self.component_is_required = False 00069 if self.components is None: 00070 self.components = [] 00071 if self.symbolic_is_required is None: 00072 self.symbolic_is_required = False 00073 if self.symbolicID is None: 00074 self.symbolicID = 0 00075 if self.symbolicName is None: 00076 self.symbolicName = '' 00077 if self.description is None: 00078 self.description = '' 00079 else: 00080 self.objectID = 0 00081 self.objectName = '' 00082 self.actionID = 0 00083 self.actionName = '' 00084 self.component_is_required = False 00085 self.components = [] 00086 self.symbolic_is_required = False 00087 self.symbolicID = 0 00088 self.symbolicName = '' 00089 self.description = '' 00090 00091 def _get_types(self): 00092 """ 00093 internal API method 00094 """ 00095 return self._slot_types 00096 00097 def serialize(self, buff): 00098 """ 00099 serialize message into buffer 00100 @param buff: buffer 00101 @type buff: StringIO 00102 """ 00103 try: 00104 buff.write(_struct_I.pack(self.objectID)) 00105 _x = self.objectName 00106 length = len(_x) 00107 buff.write(struct.pack('<I%ss'%length, length, _x)) 00108 buff.write(_struct_I.pack(self.actionID)) 00109 _x = self.actionName 00110 length = len(_x) 00111 buff.write(struct.pack('<I%ss'%length, length, _x)) 00112 buff.write(_struct_B.pack(self.component_is_required)) 00113 length = len(self.components) 00114 buff.write(_struct_I.pack(length)) 00115 for val1 in self.components: 00116 buff.write(_struct_I.pack(val1.componentID)) 00117 _x = val1.componentName 00118 length = len(_x) 00119 buff.write(struct.pack('<I%ss'%length, length, _x)) 00120 _x = self 00121 buff.write(_struct_BI.pack(_x.symbolic_is_required, _x.symbolicID)) 00122 _x = self.symbolicName 00123 length = len(_x) 00124 buff.write(struct.pack('<I%ss'%length, length, _x)) 00125 _x = self.description 00126 length = len(_x) 00127 buff.write(struct.pack('<I%ss'%length, length, _x)) 00128 except struct.error as se: self._check_types(se) 00129 except TypeError as te: self._check_types(te) 00130 00131 def deserialize(self, str): 00132 """ 00133 unpack serialized message in str into this message instance 00134 @param str: byte array of serialized message 00135 @type str: str 00136 """ 00137 try: 00138 end = 0 00139 start = end 00140 end += 4 00141 (self.objectID,) = _struct_I.unpack(str[start:end]) 00142 start = end 00143 end += 4 00144 (length,) = _struct_I.unpack(str[start:end]) 00145 start = end 00146 end += length 00147 self.objectName = str[start:end] 00148 start = end 00149 end += 4 00150 (self.actionID,) = _struct_I.unpack(str[start:end]) 00151 start = end 00152 end += 4 00153 (length,) = _struct_I.unpack(str[start:end]) 00154 start = end 00155 end += length 00156 self.actionName = str[start:end] 00157 start = end 00158 end += 1 00159 (self.component_is_required,) = _struct_B.unpack(str[start:end]) 00160 self.component_is_required = bool(self.component_is_required) 00161 start = end 00162 end += 4 00163 (length,) = _struct_I.unpack(str[start:end]) 00164 self.components = [] 00165 for i in range(0, length): 00166 val1 = srs_msgs.msg.Component() 00167 start = end 00168 end += 4 00169 (val1.componentID,) = _struct_I.unpack(str[start:end]) 00170 start = end 00171 end += 4 00172 (length,) = _struct_I.unpack(str[start:end]) 00173 start = end 00174 end += length 00175 val1.componentName = str[start:end] 00176 self.components.append(val1) 00177 _x = self 00178 start = end 00179 end += 5 00180 (_x.symbolic_is_required, _x.symbolicID,) = _struct_BI.unpack(str[start:end]) 00181 self.symbolic_is_required = bool(self.symbolic_is_required) 00182 start = end 00183 end += 4 00184 (length,) = _struct_I.unpack(str[start:end]) 00185 start = end 00186 end += length 00187 self.symbolicName = str[start:end] 00188 start = end 00189 end += 4 00190 (length,) = _struct_I.unpack(str[start:end]) 00191 start = end 00192 end += length 00193 self.description = str[start:end] 00194 return self 00195 except struct.error as e: 00196 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00197 00198 00199 def serialize_numpy(self, buff, numpy): 00200 """ 00201 serialize message with numpy array types into buffer 00202 @param buff: buffer 00203 @type buff: StringIO 00204 @param numpy: numpy python module 00205 @type numpy module 00206 """ 00207 try: 00208 buff.write(_struct_I.pack(self.objectID)) 00209 _x = self.objectName 00210 length = len(_x) 00211 buff.write(struct.pack('<I%ss'%length, length, _x)) 00212 buff.write(_struct_I.pack(self.actionID)) 00213 _x = self.actionName 00214 length = len(_x) 00215 buff.write(struct.pack('<I%ss'%length, length, _x)) 00216 buff.write(_struct_B.pack(self.component_is_required)) 00217 length = len(self.components) 00218 buff.write(_struct_I.pack(length)) 00219 for val1 in self.components: 00220 buff.write(_struct_I.pack(val1.componentID)) 00221 _x = val1.componentName 00222 length = len(_x) 00223 buff.write(struct.pack('<I%ss'%length, length, _x)) 00224 _x = self 00225 buff.write(_struct_BI.pack(_x.symbolic_is_required, _x.symbolicID)) 00226 _x = self.symbolicName 00227 length = len(_x) 00228 buff.write(struct.pack('<I%ss'%length, length, _x)) 00229 _x = self.description 00230 length = len(_x) 00231 buff.write(struct.pack('<I%ss'%length, length, _x)) 00232 except struct.error as se: self._check_types(se) 00233 except TypeError as te: self._check_types(te) 00234 00235 def deserialize_numpy(self, str, numpy): 00236 """ 00237 unpack serialized message in str into this message instance using numpy for array types 00238 @param str: byte array of serialized message 00239 @type str: str 00240 @param numpy: numpy python module 00241 @type numpy: module 00242 """ 00243 try: 00244 end = 0 00245 start = end 00246 end += 4 00247 (self.objectID,) = _struct_I.unpack(str[start:end]) 00248 start = end 00249 end += 4 00250 (length,) = _struct_I.unpack(str[start:end]) 00251 start = end 00252 end += length 00253 self.objectName = str[start:end] 00254 start = end 00255 end += 4 00256 (self.actionID,) = _struct_I.unpack(str[start:end]) 00257 start = end 00258 end += 4 00259 (length,) = _struct_I.unpack(str[start:end]) 00260 start = end 00261 end += length 00262 self.actionName = str[start:end] 00263 start = end 00264 end += 1 00265 (self.component_is_required,) = _struct_B.unpack(str[start:end]) 00266 self.component_is_required = bool(self.component_is_required) 00267 start = end 00268 end += 4 00269 (length,) = _struct_I.unpack(str[start:end]) 00270 self.components = [] 00271 for i in range(0, length): 00272 val1 = srs_msgs.msg.Component() 00273 start = end 00274 end += 4 00275 (val1.componentID,) = _struct_I.unpack(str[start:end]) 00276 start = end 00277 end += 4 00278 (length,) = _struct_I.unpack(str[start:end]) 00279 start = end 00280 end += length 00281 val1.componentName = str[start:end] 00282 self.components.append(val1) 00283 _x = self 00284 start = end 00285 end += 5 00286 (_x.symbolic_is_required, _x.symbolicID,) = _struct_BI.unpack(str[start:end]) 00287 self.symbolic_is_required = bool(self.symbolic_is_required) 00288 start = end 00289 end += 4 00290 (length,) = _struct_I.unpack(str[start:end]) 00291 start = end 00292 end += length 00293 self.symbolicName = str[start:end] 00294 start = end 00295 end += 4 00296 (length,) = _struct_I.unpack(str[start:end]) 00297 start = end 00298 end += length 00299 self.description = str[start:end] 00300 return self 00301 except struct.error as e: 00302 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00303 00304 _struct_I = roslib.message.struct_I 00305 _struct_B = struct.Struct("<B") 00306 _struct_BI = struct.Struct("<BI")