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