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