_ObjectModel.py
Go to the documentation of this file.
00001 """autogenerated by genpy from worldmodel_msgs/ObjectModel.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 worldmodel_msgs.msg
00009 import std_msgs.msg
00010 
00011 class ObjectModel(genpy.Message):
00012   _md5sum = "0e38ac3cfe11f476b7d55135cfbc074a"
00013   _type = "worldmodel_msgs/ObjectModel"
00014   _has_header = True #flag to mark the presence of a Header object
00015   _full_text = """# This message represents a collection of known objects.
00016 Header header
00017 worldmodel_msgs/Object[] objects
00018 
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data 
00023 # in a particular coordinate frame.
00024 # 
00025 # sequence ID: consecutively increasing ID 
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036 
00037 ================================================================================
00038 MSG: worldmodel_msgs/Object
00039 # This message represents an estimate of an object's pose and identity.
00040 
00041 # The header.
00042 #   stamp: Timestamp of last update.
00043 #   frame_id: Coordinate frame, in which the pose is given
00044 Header header
00045 
00046 # The pose
00047 geometry_msgs/PoseWithCovariance pose
00048 
00049 # Further information about the object
00050 ObjectInfo info
00051 
00052 # The tracked state of the object
00053 ObjectState state
00054 
00055 ================================================================================
00056 MSG: geometry_msgs/PoseWithCovariance
00057 # This represents a pose in free space with uncertainty.
00058 
00059 Pose pose
00060 
00061 # Row-major representation of the 6x6 covariance matrix
00062 # The orientation parameters use a fixed-axis representation.
00063 # In order, the parameters are:
00064 # (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
00065 float64[36] covariance
00066 
00067 ================================================================================
00068 MSG: geometry_msgs/Pose
00069 # A representation of pose in free space, composed of postion and orientation. 
00070 Point position
00071 Quaternion orientation
00072 
00073 ================================================================================
00074 MSG: geometry_msgs/Point
00075 # This contains the position of a point in free space
00076 float64 x
00077 float64 y
00078 float64 z
00079 
00080 ================================================================================
00081 MSG: geometry_msgs/Quaternion
00082 # This represents an orientation in free space in quaternion form.
00083 
00084 float64 x
00085 float64 y
00086 float64 z
00087 float64 w
00088 
00089 ================================================================================
00090 MSG: worldmodel_msgs/ObjectInfo
00091 # This message contains information about the estimated class affiliation, object id and corresponding support
00092 
00093 # A string identifying the object's class (all objects of a class look the same)
00094 string class_id
00095 
00096 # A string identifying the specific object
00097 string object_id
00098 
00099 # A string that contains the name or a description of the specific object
00100 string name
00101 
00102 # The support (degree of belief) of the object's presence given as log odd ratio
00103 float32 support
00104 
00105 
00106 ================================================================================
00107 MSG: worldmodel_msgs/ObjectState
00108 # The state of an object estimate used to track
00109 # states smaller than 0 disable all updates
00110 
00111 # Predefined states. Use states smaller than 0 or bigger than 63 for user defined states.
00112 int8 UNKNOWN = 0
00113 int8 PENDING = 1
00114 int8 ACTIVE  = 2
00115 int8 INACTIVE = 3
00116 int8 CONFIRMED = -1
00117 int8 DISCARDED = -2
00118 int8 APPROACHING = -3
00119 
00120 int8 state
00121 
00122 """
00123   __slots__ = ['header','objects']
00124   _slot_types = ['std_msgs/Header','worldmodel_msgs/Object[]']
00125 
00126   def __init__(self, *args, **kwds):
00127     """
00128     Constructor. Any message fields that are implicitly/explicitly
00129     set to None will be assigned a default value. The recommend
00130     use is keyword arguments as this is more robust to future message
00131     changes.  You cannot mix in-order arguments and keyword arguments.
00132 
00133     The available fields are:
00134        header,objects
00135 
00136     :param args: complete set of field values, in .msg order
00137     :param kwds: use keyword arguments corresponding to message field names
00138     to set specific fields.
00139     """
00140     if args or kwds:
00141       super(ObjectModel, self).__init__(*args, **kwds)
00142       #message fields cannot be None, assign default values for those that are
00143       if self.header is None:
00144         self.header = std_msgs.msg.Header()
00145       if self.objects is None:
00146         self.objects = []
00147     else:
00148       self.header = std_msgs.msg.Header()
00149       self.objects = []
00150 
00151   def _get_types(self):
00152     """
00153     internal API method
00154     """
00155     return self._slot_types
00156 
00157   def serialize(self, buff):
00158     """
00159     serialize message into buffer
00160     :param buff: buffer, ``StringIO``
00161     """
00162     try:
00163       _x = self
00164       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00165       _x = self.header.frame_id
00166       length = len(_x)
00167       if python3 or type(_x) == unicode:
00168         _x = _x.encode('utf-8')
00169         length = len(_x)
00170       buff.write(struct.pack('<I%ss'%length, length, _x))
00171       length = len(self.objects)
00172       buff.write(_struct_I.pack(length))
00173       for val1 in self.objects:
00174         _v1 = val1.header
00175         buff.write(_struct_I.pack(_v1.seq))
00176         _v2 = _v1.stamp
00177         _x = _v2
00178         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00179         _x = _v1.frame_id
00180         length = len(_x)
00181         if python3 or type(_x) == unicode:
00182           _x = _x.encode('utf-8')
00183           length = len(_x)
00184         buff.write(struct.pack('<I%ss'%length, length, _x))
00185         _v3 = val1.pose
00186         _v4 = _v3.pose
00187         _v5 = _v4.position
00188         _x = _v5
00189         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00190         _v6 = _v4.orientation
00191         _x = _v6
00192         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00193         buff.write(_struct_36d.pack(*_v3.covariance))
00194         _v7 = val1.info
00195         _x = _v7.class_id
00196         length = len(_x)
00197         if python3 or type(_x) == unicode:
00198           _x = _x.encode('utf-8')
00199           length = len(_x)
00200         buff.write(struct.pack('<I%ss'%length, length, _x))
00201         _x = _v7.object_id
00202         length = len(_x)
00203         if python3 or type(_x) == unicode:
00204           _x = _x.encode('utf-8')
00205           length = len(_x)
00206         buff.write(struct.pack('<I%ss'%length, length, _x))
00207         _x = _v7.name
00208         length = len(_x)
00209         if python3 or type(_x) == unicode:
00210           _x = _x.encode('utf-8')
00211           length = len(_x)
00212         buff.write(struct.pack('<I%ss'%length, length, _x))
00213         buff.write(_struct_f.pack(_v7.support))
00214         _v8 = val1.state
00215         buff.write(_struct_b.pack(_v8.state))
00216     except struct.error as se: self._check_types(se)
00217     except TypeError as te: self._check_types(te)
00218 
00219   def deserialize(self, str):
00220     """
00221     unpack serialized message in str into this message instance
00222     :param str: byte array of serialized message, ``str``
00223     """
00224     try:
00225       if self.header is None:
00226         self.header = std_msgs.msg.Header()
00227       if self.objects is None:
00228         self.objects = None
00229       end = 0
00230       _x = self
00231       start = end
00232       end += 12
00233       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(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         self.header.frame_id = str[start:end].decode('utf-8')
00241       else:
00242         self.header.frame_id = str[start:end]
00243       start = end
00244       end += 4
00245       (length,) = _struct_I.unpack(str[start:end])
00246       self.objects = []
00247       for i in range(0, length):
00248         val1 = worldmodel_msgs.msg.Object()
00249         _v9 = val1.header
00250         start = end
00251         end += 4
00252         (_v9.seq,) = _struct_I.unpack(str[start:end])
00253         _v10 = _v9.stamp
00254         _x = _v10
00255         start = end
00256         end += 8
00257         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00258         start = end
00259         end += 4
00260         (length,) = _struct_I.unpack(str[start:end])
00261         start = end
00262         end += length
00263         if python3:
00264           _v9.frame_id = str[start:end].decode('utf-8')
00265         else:
00266           _v9.frame_id = str[start:end]
00267         _v11 = val1.pose
00268         _v12 = _v11.pose
00269         _v13 = _v12.position
00270         _x = _v13
00271         start = end
00272         end += 24
00273         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00274         _v14 = _v12.orientation
00275         _x = _v14
00276         start = end
00277         end += 32
00278         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00279         start = end
00280         end += 288
00281         _v11.covariance = _struct_36d.unpack(str[start:end])
00282         _v15 = val1.info
00283         start = end
00284         end += 4
00285         (length,) = _struct_I.unpack(str[start:end])
00286         start = end
00287         end += length
00288         if python3:
00289           _v15.class_id = str[start:end].decode('utf-8')
00290         else:
00291           _v15.class_id = str[start:end]
00292         start = end
00293         end += 4
00294         (length,) = _struct_I.unpack(str[start:end])
00295         start = end
00296         end += length
00297         if python3:
00298           _v15.object_id = str[start:end].decode('utf-8')
00299         else:
00300           _v15.object_id = str[start:end]
00301         start = end
00302         end += 4
00303         (length,) = _struct_I.unpack(str[start:end])
00304         start = end
00305         end += length
00306         if python3:
00307           _v15.name = str[start:end].decode('utf-8')
00308         else:
00309           _v15.name = str[start:end]
00310         start = end
00311         end += 4
00312         (_v15.support,) = _struct_f.unpack(str[start:end])
00313         _v16 = val1.state
00314         start = end
00315         end += 1
00316         (_v16.state,) = _struct_b.unpack(str[start:end])
00317         self.objects.append(val1)
00318       return self
00319     except struct.error as e:
00320       raise genpy.DeserializationError(e) #most likely buffer underfill
00321 
00322 
00323   def serialize_numpy(self, buff, numpy):
00324     """
00325     serialize message with numpy array types into buffer
00326     :param buff: buffer, ``StringIO``
00327     :param numpy: numpy python module
00328     """
00329     try:
00330       _x = self
00331       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00332       _x = self.header.frame_id
00333       length = len(_x)
00334       if python3 or type(_x) == unicode:
00335         _x = _x.encode('utf-8')
00336         length = len(_x)
00337       buff.write(struct.pack('<I%ss'%length, length, _x))
00338       length = len(self.objects)
00339       buff.write(_struct_I.pack(length))
00340       for val1 in self.objects:
00341         _v17 = val1.header
00342         buff.write(_struct_I.pack(_v17.seq))
00343         _v18 = _v17.stamp
00344         _x = _v18
00345         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00346         _x = _v17.frame_id
00347         length = len(_x)
00348         if python3 or type(_x) == unicode:
00349           _x = _x.encode('utf-8')
00350           length = len(_x)
00351         buff.write(struct.pack('<I%ss'%length, length, _x))
00352         _v19 = val1.pose
00353         _v20 = _v19.pose
00354         _v21 = _v20.position
00355         _x = _v21
00356         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00357         _v22 = _v20.orientation
00358         _x = _v22
00359         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00360         buff.write(_v19.covariance.tostring())
00361         _v23 = val1.info
00362         _x = _v23.class_id
00363         length = len(_x)
00364         if python3 or type(_x) == unicode:
00365           _x = _x.encode('utf-8')
00366           length = len(_x)
00367         buff.write(struct.pack('<I%ss'%length, length, _x))
00368         _x = _v23.object_id
00369         length = len(_x)
00370         if python3 or type(_x) == unicode:
00371           _x = _x.encode('utf-8')
00372           length = len(_x)
00373         buff.write(struct.pack('<I%ss'%length, length, _x))
00374         _x = _v23.name
00375         length = len(_x)
00376         if python3 or type(_x) == unicode:
00377           _x = _x.encode('utf-8')
00378           length = len(_x)
00379         buff.write(struct.pack('<I%ss'%length, length, _x))
00380         buff.write(_struct_f.pack(_v23.support))
00381         _v24 = val1.state
00382         buff.write(_struct_b.pack(_v24.state))
00383     except struct.error as se: self._check_types(se)
00384     except TypeError as te: self._check_types(te)
00385 
00386   def deserialize_numpy(self, str, numpy):
00387     """
00388     unpack serialized message in str into this message instance using numpy for array types
00389     :param str: byte array of serialized message, ``str``
00390     :param numpy: numpy python module
00391     """
00392     try:
00393       if self.header is None:
00394         self.header = std_msgs.msg.Header()
00395       if self.objects is None:
00396         self.objects = None
00397       end = 0
00398       _x = self
00399       start = end
00400       end += 12
00401       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00402       start = end
00403       end += 4
00404       (length,) = _struct_I.unpack(str[start:end])
00405       start = end
00406       end += length
00407       if python3:
00408         self.header.frame_id = str[start:end].decode('utf-8')
00409       else:
00410         self.header.frame_id = str[start:end]
00411       start = end
00412       end += 4
00413       (length,) = _struct_I.unpack(str[start:end])
00414       self.objects = []
00415       for i in range(0, length):
00416         val1 = worldmodel_msgs.msg.Object()
00417         _v25 = val1.header
00418         start = end
00419         end += 4
00420         (_v25.seq,) = _struct_I.unpack(str[start:end])
00421         _v26 = _v25.stamp
00422         _x = _v26
00423         start = end
00424         end += 8
00425         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00426         start = end
00427         end += 4
00428         (length,) = _struct_I.unpack(str[start:end])
00429         start = end
00430         end += length
00431         if python3:
00432           _v25.frame_id = str[start:end].decode('utf-8')
00433         else:
00434           _v25.frame_id = str[start:end]
00435         _v27 = val1.pose
00436         _v28 = _v27.pose
00437         _v29 = _v28.position
00438         _x = _v29
00439         start = end
00440         end += 24
00441         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00442         _v30 = _v28.orientation
00443         _x = _v30
00444         start = end
00445         end += 32
00446         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00447         start = end
00448         end += 288
00449         _v27.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36)
00450         _v31 = val1.info
00451         start = end
00452         end += 4
00453         (length,) = _struct_I.unpack(str[start:end])
00454         start = end
00455         end += length
00456         if python3:
00457           _v31.class_id = str[start:end].decode('utf-8')
00458         else:
00459           _v31.class_id = str[start:end]
00460         start = end
00461         end += 4
00462         (length,) = _struct_I.unpack(str[start:end])
00463         start = end
00464         end += length
00465         if python3:
00466           _v31.object_id = str[start:end].decode('utf-8')
00467         else:
00468           _v31.object_id = str[start:end]
00469         start = end
00470         end += 4
00471         (length,) = _struct_I.unpack(str[start:end])
00472         start = end
00473         end += length
00474         if python3:
00475           _v31.name = str[start:end].decode('utf-8')
00476         else:
00477           _v31.name = str[start:end]
00478         start = end
00479         end += 4
00480         (_v31.support,) = _struct_f.unpack(str[start:end])
00481         _v32 = val1.state
00482         start = end
00483         end += 1
00484         (_v32.state,) = _struct_b.unpack(str[start:end])
00485         self.objects.append(val1)
00486       return self
00487     except struct.error as e:
00488       raise genpy.DeserializationError(e) #most likely buffer underfill
00489 
00490 _struct_I = genpy.struct_I
00491 _struct_b = struct.Struct("<b")
00492 _struct_f = struct.Struct("<f")
00493 _struct_36d = struct.Struct("<36d")
00494 _struct_3I = struct.Struct("<3I")
00495 _struct_4d = struct.Struct("<4d")
00496 _struct_2I = struct.Struct("<2I")
00497 _struct_3d = struct.Struct("<3d")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


worldmodel_msgs
Author(s): Johannes Meyer
autogenerated on Mon Jul 15 2013 16:50:40