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


roboframenet_msgs
Author(s): Brian Thomas
autogenerated on Fri Dec 6 2013 20:32:43