00001 """autogenerated by genpy from roboframenet_msgs/FilledSemanticFrameGoal.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 FilledSemanticFrameGoal(genpy.Message):
00010 _md5sum = "a6589ab534cf6440192eaa954de43f00"
00011 _type = "roboframenet_msgs/FilledSemanticFrameGoal"
00012 _has_header = False
00013 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00014 # goal
00015 FilledSemanticFrame frame
00016
00017 ================================================================================
00018 MSG: roboframenet_msgs/FilledSemanticFrame
00019 string name
00020 FilledFrameElement[] frame_elements
00021 string[] action_server_topics
00022
00023 ================================================================================
00024 MSG: roboframenet_msgs/FilledFrameElement
00025 string name # eg object, recipient
00026 string argument # eg apple, bob
00027
00028 """
00029 __slots__ = ['frame']
00030 _slot_types = ['roboframenet_msgs/FilledSemanticFrame']
00031
00032 def __init__(self, *args, **kwds):
00033 """
00034 Constructor. Any message fields that are implicitly/explicitly
00035 set to None will be assigned a default value. The recommend
00036 use is keyword arguments as this is more robust to future message
00037 changes. You cannot mix in-order arguments and keyword arguments.
00038
00039 The available fields are:
00040 frame
00041
00042 :param args: complete set of field values, in .msg order
00043 :param kwds: use keyword arguments corresponding to message field names
00044 to set specific fields.
00045 """
00046 if args or kwds:
00047 super(FilledSemanticFrameGoal, self).__init__(*args, **kwds)
00048
00049 if self.frame is None:
00050 self.frame = roboframenet_msgs.msg.FilledSemanticFrame()
00051 else:
00052 self.frame = roboframenet_msgs.msg.FilledSemanticFrame()
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.frame.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.frame_elements)
00073 buff.write(_struct_I.pack(length))
00074 for val1 in self.frame.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.frame.action_server_topics)
00088 buff.write(_struct_I.pack(length))
00089 for val1 in self.frame.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 is None:
00105 self.frame = roboframenet_msgs.msg.FilledSemanticFrame()
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.frame.name = str[start:end].decode('utf-8')
00114 else:
00115 self.frame.name = str[start:end]
00116 start = end
00117 end += 4
00118 (length,) = _struct_I.unpack(str[start:end])
00119 self.frame.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.frame_elements.append(val1)
00141 start = end
00142 end += 4
00143 (length,) = _struct_I.unpack(str[start:end])
00144 self.frame.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.frame.action_server_topics.append(val1)
00156 return self
00157 except struct.error as e:
00158 raise genpy.DeserializationError(e)
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.frame.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.frame_elements)
00175 buff.write(_struct_I.pack(length))
00176 for val1 in self.frame.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.frame.action_server_topics)
00190 buff.write(_struct_I.pack(length))
00191 for val1 in self.frame.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 is None:
00208 self.frame = roboframenet_msgs.msg.FilledSemanticFrame()
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.frame.name = str[start:end].decode('utf-8')
00217 else:
00218 self.frame.name = str[start:end]
00219 start = end
00220 end += 4
00221 (length,) = _struct_I.unpack(str[start:end])
00222 self.frame.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.frame_elements.append(val1)
00244 start = end
00245 end += 4
00246 (length,) = _struct_I.unpack(str[start:end])
00247 self.frame.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.frame.action_server_topics.append(val1)
00259 return self
00260 except struct.error as e:
00261 raise genpy.DeserializationError(e)
00262
00263 _struct_I = genpy.struct_I