_TF2Error.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tf2_msgs/TF2Error.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class TF2Error(genpy.Message):
00009   _md5sum = "bc6848fd6fd750c92e38575618a4917d"
00010   _type = "tf2_msgs/TF2Error"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint8 NO_ERROR = 0
00013 uint8 LOOKUP_ERROR = 1
00014 uint8 CONNECTIVITY_ERROR = 2
00015 uint8 EXTRAPOLATION_ERROR = 3
00016 uint8 INVALID_ARGUMENT_ERROR = 4
00017 uint8 TIMEOUT_ERROR = 5
00018 uint8 TRANSFORM_ERROR = 6
00019 
00020 uint8 error
00021 string error_string
00022 
00023 """
00024   # Pseudo-constants
00025   NO_ERROR = 0
00026   LOOKUP_ERROR = 1
00027   CONNECTIVITY_ERROR = 2
00028   EXTRAPOLATION_ERROR = 3
00029   INVALID_ARGUMENT_ERROR = 4
00030   TIMEOUT_ERROR = 5
00031   TRANSFORM_ERROR = 6
00032 
00033   __slots__ = ['error','error_string']
00034   _slot_types = ['uint8','string']
00035 
00036   def __init__(self, *args, **kwds):
00037     """
00038     Constructor. Any message fields that are implicitly/explicitly
00039     set to None will be assigned a default value. The recommend
00040     use is keyword arguments as this is more robust to future message
00041     changes.  You cannot mix in-order arguments and keyword arguments.
00042 
00043     The available fields are:
00044        error,error_string
00045 
00046     :param args: complete set of field values, in .msg order
00047     :param kwds: use keyword arguments corresponding to message field names
00048     to set specific fields.
00049     """
00050     if args or kwds:
00051       super(TF2Error, self).__init__(*args, **kwds)
00052       #message fields cannot be None, assign default values for those that are
00053       if self.error is None:
00054         self.error = 0
00055       if self.error_string is None:
00056         self.error_string = ''
00057     else:
00058       self.error = 0
00059       self.error_string = ''
00060 
00061   def _get_types(self):
00062     """
00063     internal API method
00064     """
00065     return self._slot_types
00066 
00067   def serialize(self, buff):
00068     """
00069     serialize message into buffer
00070     :param buff: buffer, ``StringIO``
00071     """
00072     try:
00073       buff.write(_struct_B.pack(self.error))
00074       _x = self.error_string
00075       length = len(_x)
00076       if python3 or type(_x) == unicode:
00077         _x = _x.encode('utf-8')
00078         length = len(_x)
00079       buff.write(struct.pack('<I%ss'%length, length, _x))
00080     except struct.error as se: self._check_types(se)
00081     except TypeError as te: self._check_types(te)
00082 
00083   def deserialize(self, str):
00084     """
00085     unpack serialized message in str into this message instance
00086     :param str: byte array of serialized message, ``str``
00087     """
00088     try:
00089       end = 0
00090       start = end
00091       end += 1
00092       (self.error,) = _struct_B.unpack(str[start:end])
00093       start = end
00094       end += 4
00095       (length,) = _struct_I.unpack(str[start:end])
00096       start = end
00097       end += length
00098       if python3:
00099         self.error_string = str[start:end].decode('utf-8')
00100       else:
00101         self.error_string = str[start:end]
00102       return self
00103     except struct.error as e:
00104       raise genpy.DeserializationError(e) #most likely buffer underfill
00105 
00106 
00107   def serialize_numpy(self, buff, numpy):
00108     """
00109     serialize message with numpy array types into buffer
00110     :param buff: buffer, ``StringIO``
00111     :param numpy: numpy python module
00112     """
00113     try:
00114       buff.write(_struct_B.pack(self.error))
00115       _x = self.error_string
00116       length = len(_x)
00117       if python3 or type(_x) == unicode:
00118         _x = _x.encode('utf-8')
00119         length = len(_x)
00120       buff.write(struct.pack('<I%ss'%length, length, _x))
00121     except struct.error as se: self._check_types(se)
00122     except TypeError as te: self._check_types(te)
00123 
00124   def deserialize_numpy(self, str, numpy):
00125     """
00126     unpack serialized message in str into this message instance using numpy for array types
00127     :param str: byte array of serialized message, ``str``
00128     :param numpy: numpy python module
00129     """
00130     try:
00131       end = 0
00132       start = end
00133       end += 1
00134       (self.error,) = _struct_B.unpack(str[start:end])
00135       start = end
00136       end += 4
00137       (length,) = _struct_I.unpack(str[start:end])
00138       start = end
00139       end += length
00140       if python3:
00141         self.error_string = str[start:end].decode('utf-8')
00142       else:
00143         self.error_string = str[start:end]
00144       return self
00145     except struct.error as e:
00146       raise genpy.DeserializationError(e) #most likely buffer underfill
00147 
00148 _struct_I = genpy.struct_I
00149 _struct_B = struct.Struct("<B")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


tf2_msgs
Author(s): Eitan Marder-Eppstein
autogenerated on Mon Aug 19 2013 10:26:46