_Object.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hector_worldmodel_msgs/Object.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 hector_worldmodel_msgs.msg
00008 import geometry_msgs.msg
00009 import std_msgs.msg
00010 
00011 class Object(genpy.Message):
00012   _md5sum = "02dea96e80640703553490052f13918d"
00013   _type = "hector_worldmodel_msgs/Object"
00014   _has_header = True #flag to mark the presence of a Header object
00015   _full_text = """# hector_worldmodel_msgs/Object
00016 # This message represents an estimate of an object's pose and identity.
00017 
00018 # The header.
00019 #   stamp: Timestamp of last update.
00020 #   frame_id: Coordinate frame, in which the pose is given
00021 Header header
00022 
00023 # The pose
00024 geometry_msgs/PoseWithCovariance pose
00025 
00026 # Further information about the object
00027 ObjectInfo info
00028 
00029 # The tracked state of the object
00030 ObjectState state
00031 
00032 ================================================================================
00033 MSG: std_msgs/Header
00034 # Standard metadata for higher-level stamped data types.
00035 # This is generally used to communicate timestamped data 
00036 # in a particular coordinate frame.
00037 # 
00038 # sequence ID: consecutively increasing ID 
00039 uint32 seq
00040 #Two-integer timestamp that is expressed as:
00041 # * stamp.secs: seconds (stamp_secs) since epoch
00042 # * stamp.nsecs: nanoseconds since stamp_secs
00043 # time-handling sugar is provided by the client library
00044 time stamp
00045 #Frame this data is associated with
00046 # 0: no frame
00047 # 1: global frame
00048 string frame_id
00049 
00050 ================================================================================
00051 MSG: geometry_msgs/PoseWithCovariance
00052 # This represents a pose in free space with uncertainty.
00053 
00054 Pose pose
00055 
00056 # Row-major representation of the 6x6 covariance matrix
00057 # The orientation parameters use a fixed-axis representation.
00058 # In order, the parameters are:
00059 # (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
00060 float64[36] covariance
00061 
00062 ================================================================================
00063 MSG: geometry_msgs/Pose
00064 # A representation of pose in free space, composed of postion and orientation. 
00065 Point position
00066 Quaternion orientation
00067 
00068 ================================================================================
00069 MSG: geometry_msgs/Point
00070 # This contains the position of a point in free space
00071 float64 x
00072 float64 y
00073 float64 z
00074 
00075 ================================================================================
00076 MSG: geometry_msgs/Quaternion
00077 # This represents an orientation in free space in quaternion form.
00078 
00079 float64 x
00080 float64 y
00081 float64 z
00082 float64 w
00083 
00084 ================================================================================
00085 MSG: hector_worldmodel_msgs/ObjectInfo
00086 # hector_worldmodel_msgs/ObjectInfo
00087 # This message contains information about the estimated class affiliation, object id and corresponding support
00088 
00089 # A string identifying the object's class (all objects of a class look the same)
00090 string class_id
00091 
00092 # A string identifying the specific object
00093 string object_id
00094 
00095 # A string that contains the name or a description of the specific object
00096 string name
00097 
00098 # The support (degree of belief) of the object's presence given as log odd ratio
00099 float32 support
00100 
00101 
00102 ================================================================================
00103 MSG: hector_worldmodel_msgs/ObjectState
00104 # The state of an object estimate used to track
00105 # states smaller than 0 disable all updates
00106 
00107 # Predefined states. Use states smaller than 0 or bigger than 63 for user defined states.
00108 int8 UNKNOWN = 0
00109 int8 PENDING = 1
00110 int8 ACTIVE  = 2
00111 int8 INACTIVE = 3
00112 int8 CONFIRMED = -1
00113 int8 DISCARDED = -2
00114 int8 APPROACHING = -3
00115 
00116 int8 state
00117 
00118 """
00119   __slots__ = ['header','pose','info','state']
00120   _slot_types = ['std_msgs/Header','geometry_msgs/PoseWithCovariance','hector_worldmodel_msgs/ObjectInfo','hector_worldmodel_msgs/ObjectState']
00121 
00122   def __init__(self, *args, **kwds):
00123     """
00124     Constructor. Any message fields that are implicitly/explicitly
00125     set to None will be assigned a default value. The recommend
00126     use is keyword arguments as this is more robust to future message
00127     changes.  You cannot mix in-order arguments and keyword arguments.
00128 
00129     The available fields are:
00130        header,pose,info,state
00131 
00132     :param args: complete set of field values, in .msg order
00133     :param kwds: use keyword arguments corresponding to message field names
00134     to set specific fields.
00135     """
00136     if args or kwds:
00137       super(Object, self).__init__(*args, **kwds)
00138       #message fields cannot be None, assign default values for those that are
00139       if self.header is None:
00140         self.header = std_msgs.msg.Header()
00141       if self.pose is None:
00142         self.pose = geometry_msgs.msg.PoseWithCovariance()
00143       if self.info is None:
00144         self.info = hector_worldmodel_msgs.msg.ObjectInfo()
00145       if self.state is None:
00146         self.state = hector_worldmodel_msgs.msg.ObjectState()
00147     else:
00148       self.header = std_msgs.msg.Header()
00149       self.pose = geometry_msgs.msg.PoseWithCovariance()
00150       self.info = hector_worldmodel_msgs.msg.ObjectInfo()
00151       self.state = hector_worldmodel_msgs.msg.ObjectState()
00152 
00153   def _get_types(self):
00154     """
00155     internal API method
00156     """
00157     return self._slot_types
00158 
00159   def serialize(self, buff):
00160     """
00161     serialize message into buffer
00162     :param buff: buffer, ``StringIO``
00163     """
00164     try:
00165       _x = self
00166       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00167       _x = self.header.frame_id
00168       length = len(_x)
00169       if python3 or type(_x) == unicode:
00170         _x = _x.encode('utf-8')
00171         length = len(_x)
00172       buff.write(struct.pack('<I%ss'%length, length, _x))
00173       _x = self
00174       buff.write(_struct_7d.pack(_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w))
00175       buff.write(_struct_36d.pack(*self.pose.covariance))
00176       _x = self.info.class_id
00177       length = len(_x)
00178       if python3 or type(_x) == unicode:
00179         _x = _x.encode('utf-8')
00180         length = len(_x)
00181       buff.write(struct.pack('<I%ss'%length, length, _x))
00182       _x = self.info.object_id
00183       length = len(_x)
00184       if python3 or type(_x) == unicode:
00185         _x = _x.encode('utf-8')
00186         length = len(_x)
00187       buff.write(struct.pack('<I%ss'%length, length, _x))
00188       _x = self.info.name
00189       length = len(_x)
00190       if python3 or type(_x) == unicode:
00191         _x = _x.encode('utf-8')
00192         length = len(_x)
00193       buff.write(struct.pack('<I%ss'%length, length, _x))
00194       _x = self
00195       buff.write(_struct_fb.pack(_x.info.support, _x.state.state))
00196     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00197     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00198 
00199   def deserialize(self, str):
00200     """
00201     unpack serialized message in str into this message instance
00202     :param str: byte array of serialized message, ``str``
00203     """
00204     try:
00205       if self.header is None:
00206         self.header = std_msgs.msg.Header()
00207       if self.pose is None:
00208         self.pose = geometry_msgs.msg.PoseWithCovariance()
00209       if self.info is None:
00210         self.info = hector_worldmodel_msgs.msg.ObjectInfo()
00211       if self.state is None:
00212         self.state = hector_worldmodel_msgs.msg.ObjectState()
00213       end = 0
00214       _x = self
00215       start = end
00216       end += 12
00217       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00218       start = end
00219       end += 4
00220       (length,) = _struct_I.unpack(str[start:end])
00221       start = end
00222       end += length
00223       if python3:
00224         self.header.frame_id = str[start:end].decode('utf-8')
00225       else:
00226         self.header.frame_id = str[start:end]
00227       _x = self
00228       start = end
00229       end += 56
00230       (_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00231       start = end
00232       end += 288
00233       self.pose.covariance = _struct_36d.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.info.class_id = str[start:end].decode('utf-8')
00241       else:
00242         self.info.class_id = str[start:end]
00243       start = end
00244       end += 4
00245       (length,) = _struct_I.unpack(str[start:end])
00246       start = end
00247       end += length
00248       if python3:
00249         self.info.object_id = str[start:end].decode('utf-8')
00250       else:
00251         self.info.object_id = str[start:end]
00252       start = end
00253       end += 4
00254       (length,) = _struct_I.unpack(str[start:end])
00255       start = end
00256       end += length
00257       if python3:
00258         self.info.name = str[start:end].decode('utf-8')
00259       else:
00260         self.info.name = str[start:end]
00261       _x = self
00262       start = end
00263       end += 5
00264       (_x.info.support, _x.state.state,) = _struct_fb.unpack(str[start:end])
00265       return self
00266     except struct.error as e:
00267       raise genpy.DeserializationError(e) #most likely buffer underfill
00268 
00269 
00270   def serialize_numpy(self, buff, numpy):
00271     """
00272     serialize message with numpy array types into buffer
00273     :param buff: buffer, ``StringIO``
00274     :param numpy: numpy python module
00275     """
00276     try:
00277       _x = self
00278       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00279       _x = self.header.frame_id
00280       length = len(_x)
00281       if python3 or type(_x) == unicode:
00282         _x = _x.encode('utf-8')
00283         length = len(_x)
00284       buff.write(struct.pack('<I%ss'%length, length, _x))
00285       _x = self
00286       buff.write(_struct_7d.pack(_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w))
00287       buff.write(self.pose.covariance.tostring())
00288       _x = self.info.class_id
00289       length = len(_x)
00290       if python3 or type(_x) == unicode:
00291         _x = _x.encode('utf-8')
00292         length = len(_x)
00293       buff.write(struct.pack('<I%ss'%length, length, _x))
00294       _x = self.info.object_id
00295       length = len(_x)
00296       if python3 or type(_x) == unicode:
00297         _x = _x.encode('utf-8')
00298         length = len(_x)
00299       buff.write(struct.pack('<I%ss'%length, length, _x))
00300       _x = self.info.name
00301       length = len(_x)
00302       if python3 or type(_x) == unicode:
00303         _x = _x.encode('utf-8')
00304         length = len(_x)
00305       buff.write(struct.pack('<I%ss'%length, length, _x))
00306       _x = self
00307       buff.write(_struct_fb.pack(_x.info.support, _x.state.state))
00308     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00309     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00310 
00311   def deserialize_numpy(self, str, numpy):
00312     """
00313     unpack serialized message in str into this message instance using numpy for array types
00314     :param str: byte array of serialized message, ``str``
00315     :param numpy: numpy python module
00316     """
00317     try:
00318       if self.header is None:
00319         self.header = std_msgs.msg.Header()
00320       if self.pose is None:
00321         self.pose = geometry_msgs.msg.PoseWithCovariance()
00322       if self.info is None:
00323         self.info = hector_worldmodel_msgs.msg.ObjectInfo()
00324       if self.state is None:
00325         self.state = hector_worldmodel_msgs.msg.ObjectState()
00326       end = 0
00327       _x = self
00328       start = end
00329       end += 12
00330       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00331       start = end
00332       end += 4
00333       (length,) = _struct_I.unpack(str[start:end])
00334       start = end
00335       end += length
00336       if python3:
00337         self.header.frame_id = str[start:end].decode('utf-8')
00338       else:
00339         self.header.frame_id = str[start:end]
00340       _x = self
00341       start = end
00342       end += 56
00343       (_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00344       start = end
00345       end += 288
00346       self.pose.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36)
00347       start = end
00348       end += 4
00349       (length,) = _struct_I.unpack(str[start:end])
00350       start = end
00351       end += length
00352       if python3:
00353         self.info.class_id = str[start:end].decode('utf-8')
00354       else:
00355         self.info.class_id = str[start:end]
00356       start = end
00357       end += 4
00358       (length,) = _struct_I.unpack(str[start:end])
00359       start = end
00360       end += length
00361       if python3:
00362         self.info.object_id = str[start:end].decode('utf-8')
00363       else:
00364         self.info.object_id = str[start:end]
00365       start = end
00366       end += 4
00367       (length,) = _struct_I.unpack(str[start:end])
00368       start = end
00369       end += length
00370       if python3:
00371         self.info.name = str[start:end].decode('utf-8')
00372       else:
00373         self.info.name = str[start:end]
00374       _x = self
00375       start = end
00376       end += 5
00377       (_x.info.support, _x.state.state,) = _struct_fb.unpack(str[start:end])
00378       return self
00379     except struct.error as e:
00380       raise genpy.DeserializationError(e) #most likely buffer underfill
00381 
00382 _struct_I = genpy.struct_I
00383 _struct_fb = struct.Struct("<fb")
00384 _struct_3I = struct.Struct("<3I")
00385 _struct_7d = struct.Struct("<7d")
00386 _struct_36d = struct.Struct("<36d")


hector_worldmodel_msgs
Author(s): Johannes Meyer
autogenerated on Mon Oct 6 2014 00:36:27