00001 """autogenerated by genpy from ias_table_msgs/PrologReturn.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 geometry_msgs.msg
00008 import genpy
00009
00010 class PrologReturn(genpy.Message):
00011 _md5sum = "36ba6a953c3efbbc3b8ac3da98942c78"
00012 _type = "ias_table_msgs/PrologReturn"
00013 _has_header = False
00014 _full_text = """uint64 table_id
00015 float64[] coeff
00016 geometry_msgs/Point32 table_center
00017 time stamp
00018 geometry_msgs/Point32 object_center
00019 uint64 object_id
00020 string object_type
00021 string object_color
00022 string object_geometric_type
00023 string perception_method
00024 string sensor_type
00025 uint64 lo_id
00026 uint64 object_cop_id
00027 ================================================================================
00028 MSG: geometry_msgs/Point32
00029 # This contains the position of a point in free space(with 32 bits of precision).
00030 # It is recommeded to use Point wherever possible instead of Point32.
00031 #
00032 # This recommendation is to promote interoperability.
00033 #
00034 # This message is designed to take up less space when sending
00035 # lots of points at once, as in the case of a PointCloud.
00036
00037 float32 x
00038 float32 y
00039 float32 z
00040 """
00041 __slots__ = ['table_id','coeff','table_center','stamp','object_center','object_id','object_type','object_color','object_geometric_type','perception_method','sensor_type','lo_id','object_cop_id']
00042 _slot_types = ['uint64','float64[]','geometry_msgs/Point32','time','geometry_msgs/Point32','uint64','string','string','string','string','string','uint64','uint64']
00043
00044 def __init__(self, *args, **kwds):
00045 """
00046 Constructor. Any message fields that are implicitly/explicitly
00047 set to None will be assigned a default value. The recommend
00048 use is keyword arguments as this is more robust to future message
00049 changes. You cannot mix in-order arguments and keyword arguments.
00050
00051 The available fields are:
00052 table_id,coeff,table_center,stamp,object_center,object_id,object_type,object_color,object_geometric_type,perception_method,sensor_type,lo_id,object_cop_id
00053
00054 :param args: complete set of field values, in .msg order
00055 :param kwds: use keyword arguments corresponding to message field names
00056 to set specific fields.
00057 """
00058 if args or kwds:
00059 super(PrologReturn, self).__init__(*args, **kwds)
00060
00061 if self.table_id is None:
00062 self.table_id = 0
00063 if self.coeff is None:
00064 self.coeff = []
00065 if self.table_center is None:
00066 self.table_center = geometry_msgs.msg.Point32()
00067 if self.stamp is None:
00068 self.stamp = genpy.Time()
00069 if self.object_center is None:
00070 self.object_center = geometry_msgs.msg.Point32()
00071 if self.object_id is None:
00072 self.object_id = 0
00073 if self.object_type is None:
00074 self.object_type = ''
00075 if self.object_color is None:
00076 self.object_color = ''
00077 if self.object_geometric_type is None:
00078 self.object_geometric_type = ''
00079 if self.perception_method is None:
00080 self.perception_method = ''
00081 if self.sensor_type is None:
00082 self.sensor_type = ''
00083 if self.lo_id is None:
00084 self.lo_id = 0
00085 if self.object_cop_id is None:
00086 self.object_cop_id = 0
00087 else:
00088 self.table_id = 0
00089 self.coeff = []
00090 self.table_center = geometry_msgs.msg.Point32()
00091 self.stamp = genpy.Time()
00092 self.object_center = geometry_msgs.msg.Point32()
00093 self.object_id = 0
00094 self.object_type = ''
00095 self.object_color = ''
00096 self.object_geometric_type = ''
00097 self.perception_method = ''
00098 self.sensor_type = ''
00099 self.lo_id = 0
00100 self.object_cop_id = 0
00101
00102 def _get_types(self):
00103 """
00104 internal API method
00105 """
00106 return self._slot_types
00107
00108 def serialize(self, buff):
00109 """
00110 serialize message into buffer
00111 :param buff: buffer, ``StringIO``
00112 """
00113 try:
00114 buff.write(_struct_Q.pack(self.table_id))
00115 length = len(self.coeff)
00116 buff.write(_struct_I.pack(length))
00117 pattern = '<%sd'%length
00118 buff.write(struct.pack(pattern, *self.coeff))
00119 _x = self
00120 buff.write(_struct_3f2I3fQ.pack(_x.table_center.x, _x.table_center.y, _x.table_center.z, _x.stamp.secs, _x.stamp.nsecs, _x.object_center.x, _x.object_center.y, _x.object_center.z, _x.object_id))
00121 _x = self.object_type
00122 length = len(_x)
00123 if python3 or type(_x) == unicode:
00124 _x = _x.encode('utf-8')
00125 length = len(_x)
00126 buff.write(struct.pack('<I%ss'%length, length, _x))
00127 _x = self.object_color
00128 length = len(_x)
00129 if python3 or type(_x) == unicode:
00130 _x = _x.encode('utf-8')
00131 length = len(_x)
00132 buff.write(struct.pack('<I%ss'%length, length, _x))
00133 _x = self.object_geometric_type
00134 length = len(_x)
00135 if python3 or type(_x) == unicode:
00136 _x = _x.encode('utf-8')
00137 length = len(_x)
00138 buff.write(struct.pack('<I%ss'%length, length, _x))
00139 _x = self.perception_method
00140 length = len(_x)
00141 if python3 or type(_x) == unicode:
00142 _x = _x.encode('utf-8')
00143 length = len(_x)
00144 buff.write(struct.pack('<I%ss'%length, length, _x))
00145 _x = self.sensor_type
00146 length = len(_x)
00147 if python3 or type(_x) == unicode:
00148 _x = _x.encode('utf-8')
00149 length = len(_x)
00150 buff.write(struct.pack('<I%ss'%length, length, _x))
00151 _x = self
00152 buff.write(_struct_2Q.pack(_x.lo_id, _x.object_cop_id))
00153 except struct.error as se: self._check_types(se)
00154 except TypeError as te: self._check_types(te)
00155
00156 def deserialize(self, str):
00157 """
00158 unpack serialized message in str into this message instance
00159 :param str: byte array of serialized message, ``str``
00160 """
00161 try:
00162 if self.table_center is None:
00163 self.table_center = geometry_msgs.msg.Point32()
00164 if self.stamp is None:
00165 self.stamp = genpy.Time()
00166 if self.object_center is None:
00167 self.object_center = geometry_msgs.msg.Point32()
00168 end = 0
00169 start = end
00170 end += 8
00171 (self.table_id,) = _struct_Q.unpack(str[start:end])
00172 start = end
00173 end += 4
00174 (length,) = _struct_I.unpack(str[start:end])
00175 pattern = '<%sd'%length
00176 start = end
00177 end += struct.calcsize(pattern)
00178 self.coeff = struct.unpack(pattern, str[start:end])
00179 _x = self
00180 start = end
00181 end += 40
00182 (_x.table_center.x, _x.table_center.y, _x.table_center.z, _x.stamp.secs, _x.stamp.nsecs, _x.object_center.x, _x.object_center.y, _x.object_center.z, _x.object_id,) = _struct_3f2I3fQ.unpack(str[start:end])
00183 start = end
00184 end += 4
00185 (length,) = _struct_I.unpack(str[start:end])
00186 start = end
00187 end += length
00188 if python3:
00189 self.object_type = str[start:end].decode('utf-8')
00190 else:
00191 self.object_type = str[start:end]
00192 start = end
00193 end += 4
00194 (length,) = _struct_I.unpack(str[start:end])
00195 start = end
00196 end += length
00197 if python3:
00198 self.object_color = str[start:end].decode('utf-8')
00199 else:
00200 self.object_color = str[start:end]
00201 start = end
00202 end += 4
00203 (length,) = _struct_I.unpack(str[start:end])
00204 start = end
00205 end += length
00206 if python3:
00207 self.object_geometric_type = str[start:end].decode('utf-8')
00208 else:
00209 self.object_geometric_type = str[start:end]
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.perception_method = str[start:end].decode('utf-8')
00217 else:
00218 self.perception_method = str[start:end]
00219 start = end
00220 end += 4
00221 (length,) = _struct_I.unpack(str[start:end])
00222 start = end
00223 end += length
00224 if python3:
00225 self.sensor_type = str[start:end].decode('utf-8')
00226 else:
00227 self.sensor_type = str[start:end]
00228 _x = self
00229 start = end
00230 end += 16
00231 (_x.lo_id, _x.object_cop_id,) = _struct_2Q.unpack(str[start:end])
00232 self.stamp.canon()
00233 return self
00234 except struct.error as e:
00235 raise genpy.DeserializationError(e)
00236
00237
00238 def serialize_numpy(self, buff, numpy):
00239 """
00240 serialize message with numpy array types into buffer
00241 :param buff: buffer, ``StringIO``
00242 :param numpy: numpy python module
00243 """
00244 try:
00245 buff.write(_struct_Q.pack(self.table_id))
00246 length = len(self.coeff)
00247 buff.write(_struct_I.pack(length))
00248 pattern = '<%sd'%length
00249 buff.write(self.coeff.tostring())
00250 _x = self
00251 buff.write(_struct_3f2I3fQ.pack(_x.table_center.x, _x.table_center.y, _x.table_center.z, _x.stamp.secs, _x.stamp.nsecs, _x.object_center.x, _x.object_center.y, _x.object_center.z, _x.object_id))
00252 _x = self.object_type
00253 length = len(_x)
00254 if python3 or type(_x) == unicode:
00255 _x = _x.encode('utf-8')
00256 length = len(_x)
00257 buff.write(struct.pack('<I%ss'%length, length, _x))
00258 _x = self.object_color
00259 length = len(_x)
00260 if python3 or type(_x) == unicode:
00261 _x = _x.encode('utf-8')
00262 length = len(_x)
00263 buff.write(struct.pack('<I%ss'%length, length, _x))
00264 _x = self.object_geometric_type
00265 length = len(_x)
00266 if python3 or type(_x) == unicode:
00267 _x = _x.encode('utf-8')
00268 length = len(_x)
00269 buff.write(struct.pack('<I%ss'%length, length, _x))
00270 _x = self.perception_method
00271 length = len(_x)
00272 if python3 or type(_x) == unicode:
00273 _x = _x.encode('utf-8')
00274 length = len(_x)
00275 buff.write(struct.pack('<I%ss'%length, length, _x))
00276 _x = self.sensor_type
00277 length = len(_x)
00278 if python3 or type(_x) == unicode:
00279 _x = _x.encode('utf-8')
00280 length = len(_x)
00281 buff.write(struct.pack('<I%ss'%length, length, _x))
00282 _x = self
00283 buff.write(_struct_2Q.pack(_x.lo_id, _x.object_cop_id))
00284 except struct.error as se: self._check_types(se)
00285 except TypeError as te: self._check_types(te)
00286
00287 def deserialize_numpy(self, str, numpy):
00288 """
00289 unpack serialized message in str into this message instance using numpy for array types
00290 :param str: byte array of serialized message, ``str``
00291 :param numpy: numpy python module
00292 """
00293 try:
00294 if self.table_center is None:
00295 self.table_center = geometry_msgs.msg.Point32()
00296 if self.stamp is None:
00297 self.stamp = genpy.Time()
00298 if self.object_center is None:
00299 self.object_center = geometry_msgs.msg.Point32()
00300 end = 0
00301 start = end
00302 end += 8
00303 (self.table_id,) = _struct_Q.unpack(str[start:end])
00304 start = end
00305 end += 4
00306 (length,) = _struct_I.unpack(str[start:end])
00307 pattern = '<%sd'%length
00308 start = end
00309 end += struct.calcsize(pattern)
00310 self.coeff = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00311 _x = self
00312 start = end
00313 end += 40
00314 (_x.table_center.x, _x.table_center.y, _x.table_center.z, _x.stamp.secs, _x.stamp.nsecs, _x.object_center.x, _x.object_center.y, _x.object_center.z, _x.object_id,) = _struct_3f2I3fQ.unpack(str[start:end])
00315 start = end
00316 end += 4
00317 (length,) = _struct_I.unpack(str[start:end])
00318 start = end
00319 end += length
00320 if python3:
00321 self.object_type = str[start:end].decode('utf-8')
00322 else:
00323 self.object_type = str[start:end]
00324 start = end
00325 end += 4
00326 (length,) = _struct_I.unpack(str[start:end])
00327 start = end
00328 end += length
00329 if python3:
00330 self.object_color = str[start:end].decode('utf-8')
00331 else:
00332 self.object_color = str[start:end]
00333 start = end
00334 end += 4
00335 (length,) = _struct_I.unpack(str[start:end])
00336 start = end
00337 end += length
00338 if python3:
00339 self.object_geometric_type = str[start:end].decode('utf-8')
00340 else:
00341 self.object_geometric_type = str[start:end]
00342 start = end
00343 end += 4
00344 (length,) = _struct_I.unpack(str[start:end])
00345 start = end
00346 end += length
00347 if python3:
00348 self.perception_method = str[start:end].decode('utf-8')
00349 else:
00350 self.perception_method = str[start:end]
00351 start = end
00352 end += 4
00353 (length,) = _struct_I.unpack(str[start:end])
00354 start = end
00355 end += length
00356 if python3:
00357 self.sensor_type = str[start:end].decode('utf-8')
00358 else:
00359 self.sensor_type = str[start:end]
00360 _x = self
00361 start = end
00362 end += 16
00363 (_x.lo_id, _x.object_cop_id,) = _struct_2Q.unpack(str[start:end])
00364 self.stamp.canon()
00365 return self
00366 except struct.error as e:
00367 raise genpy.DeserializationError(e)
00368
00369 _struct_I = genpy.struct_I
00370 _struct_Q = struct.Struct("<Q")
00371 _struct_2Q = struct.Struct("<2Q")
00372 _struct_3f2I3fQ = struct.Struct("<3f2I3fQ")