_utfMessage.py
Go to the documentation of this file.
00001 """autogenerated by genpy from uncertain_tf/utfMessage.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 uncertain_tf.msg
00008 import std_msgs.msg
00009 
00010 class utfMessage(genpy.Message):
00011   _md5sum = "031297ac1eed0541c5c271554208b372"
00012   _type = "uncertain_tf/utfMessage"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """uncertain_tf/CovarianceStamped[] covariances
00015 
00016 ================================================================================
00017 MSG: uncertain_tf/CovarianceStamped
00018 # for now we consider only covariances
00019 Header header
00020 float64[36] covariance
00021 
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data 
00026 # in a particular coordinate frame.
00027 # 
00028 # sequence ID: consecutively increasing ID 
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039 
00040 """
00041   __slots__ = ['covariances']
00042   _slot_types = ['uncertain_tf/CovarianceStamped[]']
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        covariances
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(utfMessage, self).__init__(*args, **kwds)
00060       #message fields cannot be None, assign default values for those that are
00061       if self.covariances is None:
00062         self.covariances = []
00063     else:
00064       self.covariances = []
00065 
00066   def _get_types(self):
00067     """
00068     internal API method
00069     """
00070     return self._slot_types
00071 
00072   def serialize(self, buff):
00073     """
00074     serialize message into buffer
00075     :param buff: buffer, ``StringIO``
00076     """
00077     try:
00078       length = len(self.covariances)
00079       buff.write(_struct_I.pack(length))
00080       for val1 in self.covariances:
00081         _v1 = val1.header
00082         buff.write(_struct_I.pack(_v1.seq))
00083         _v2 = _v1.stamp
00084         _x = _v2
00085         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00086         _x = _v1.frame_id
00087         length = len(_x)
00088         if python3 or type(_x) == unicode:
00089           _x = _x.encode('utf-8')
00090           length = len(_x)
00091         buff.write(struct.pack('<I%ss'%length, length, _x))
00092         buff.write(_struct_36d.pack(*val1.covariance))
00093     except struct.error as se: self._check_types(se)
00094     except TypeError as te: self._check_types(te)
00095 
00096   def deserialize(self, str):
00097     """
00098     unpack serialized message in str into this message instance
00099     :param str: byte array of serialized message, ``str``
00100     """
00101     try:
00102       if self.covariances is None:
00103         self.covariances = None
00104       end = 0
00105       start = end
00106       end += 4
00107       (length,) = _struct_I.unpack(str[start:end])
00108       self.covariances = []
00109       for i in range(0, length):
00110         val1 = uncertain_tf.msg.CovarianceStamped()
00111         _v3 = val1.header
00112         start = end
00113         end += 4
00114         (_v3.seq,) = _struct_I.unpack(str[start:end])
00115         _v4 = _v3.stamp
00116         _x = _v4
00117         start = end
00118         end += 8
00119         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00120         start = end
00121         end += 4
00122         (length,) = _struct_I.unpack(str[start:end])
00123         start = end
00124         end += length
00125         if python3:
00126           _v3.frame_id = str[start:end].decode('utf-8')
00127         else:
00128           _v3.frame_id = str[start:end]
00129         start = end
00130         end += 288
00131         val1.covariance = _struct_36d.unpack(str[start:end])
00132         self.covariances.append(val1)
00133       return self
00134     except struct.error as e:
00135       raise genpy.DeserializationError(e) #most likely buffer underfill
00136 
00137 
00138   def serialize_numpy(self, buff, numpy):
00139     """
00140     serialize message with numpy array types into buffer
00141     :param buff: buffer, ``StringIO``
00142     :param numpy: numpy python module
00143     """
00144     try:
00145       length = len(self.covariances)
00146       buff.write(_struct_I.pack(length))
00147       for val1 in self.covariances:
00148         _v5 = val1.header
00149         buff.write(_struct_I.pack(_v5.seq))
00150         _v6 = _v5.stamp
00151         _x = _v6
00152         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00153         _x = _v5.frame_id
00154         length = len(_x)
00155         if python3 or type(_x) == unicode:
00156           _x = _x.encode('utf-8')
00157           length = len(_x)
00158         buff.write(struct.pack('<I%ss'%length, length, _x))
00159         buff.write(val1.covariance.tostring())
00160     except struct.error as se: self._check_types(se)
00161     except TypeError as te: self._check_types(te)
00162 
00163   def deserialize_numpy(self, str, numpy):
00164     """
00165     unpack serialized message in str into this message instance using numpy for array types
00166     :param str: byte array of serialized message, ``str``
00167     :param numpy: numpy python module
00168     """
00169     try:
00170       if self.covariances is None:
00171         self.covariances = None
00172       end = 0
00173       start = end
00174       end += 4
00175       (length,) = _struct_I.unpack(str[start:end])
00176       self.covariances = []
00177       for i in range(0, length):
00178         val1 = uncertain_tf.msg.CovarianceStamped()
00179         _v7 = val1.header
00180         start = end
00181         end += 4
00182         (_v7.seq,) = _struct_I.unpack(str[start:end])
00183         _v8 = _v7.stamp
00184         _x = _v8
00185         start = end
00186         end += 8
00187         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00188         start = end
00189         end += 4
00190         (length,) = _struct_I.unpack(str[start:end])
00191         start = end
00192         end += length
00193         if python3:
00194           _v7.frame_id = str[start:end].decode('utf-8')
00195         else:
00196           _v7.frame_id = str[start:end]
00197         start = end
00198         end += 288
00199         val1.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36)
00200         self.covariances.append(val1)
00201       return self
00202     except struct.error as e:
00203       raise genpy.DeserializationError(e) #most likely buffer underfill
00204 
00205 _struct_I = genpy.struct_I
00206 _struct_36d = struct.Struct("<36d")
00207 _struct_2I = struct.Struct("<2I")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


uncertain_tf
Author(s): Thomas Ruehr
autogenerated on Thu May 23 2013 17:49:36