$search
00001 """autogenerated by genmsg_py from Version.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import applanix_msgs.msg 00006 00007 class Version(roslib.message.Message): 00008 _md5sum = "436db5a21d31ed873f1f24270392aeca" 00009 _type = "applanix_msgs/Version" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# Group 99 00012 TimeDistance td 00013 00014 uint8[120] system_version 00015 uint8[80] primary_gnss_version 00016 uint8[80] secondary_gnss_version 00017 00018 float32 total_hours 00019 uint32 num_runs 00020 float32 avg_run_length 00021 float32 longest_run 00022 float32 current_run 00023 00024 ================================================================================ 00025 MSG: applanix_msgs/TimeDistance 00026 float64 time1 00027 float64 time2 00028 float64 distance 00029 uint8 time_types 00030 uint8 distance_type 00031 00032 """ 00033 __slots__ = ['td','system_version','primary_gnss_version','secondary_gnss_version','total_hours','num_runs','avg_run_length','longest_run','current_run'] 00034 _slot_types = ['applanix_msgs/TimeDistance','uint8[120]','uint8[80]','uint8[80]','float32','uint32','float32','float32','float32'] 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 td,system_version,primary_gnss_version,secondary_gnss_version,total_hours,num_runs,avg_run_length,longest_run,current_run 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(Version, self).__init__(*args, **kwds) 00052 #message fields cannot be None, assign default values for those that are 00053 if self.td is None: 00054 self.td = applanix_msgs.msg.TimeDistance() 00055 if self.system_version is None: 00056 self.system_version = chr(0)*120 00057 if self.primary_gnss_version is None: 00058 self.primary_gnss_version = chr(0)*80 00059 if self.secondary_gnss_version is None: 00060 self.secondary_gnss_version = chr(0)*80 00061 if self.total_hours is None: 00062 self.total_hours = 0. 00063 if self.num_runs is None: 00064 self.num_runs = 0 00065 if self.avg_run_length is None: 00066 self.avg_run_length = 0. 00067 if self.longest_run is None: 00068 self.longest_run = 0. 00069 if self.current_run is None: 00070 self.current_run = 0. 00071 else: 00072 self.td = applanix_msgs.msg.TimeDistance() 00073 self.system_version = chr(0)*120 00074 self.primary_gnss_version = chr(0)*80 00075 self.secondary_gnss_version = chr(0)*80 00076 self.total_hours = 0. 00077 self.num_runs = 0 00078 self.avg_run_length = 0. 00079 self.longest_run = 0. 00080 self.current_run = 0. 00081 00082 def _get_types(self): 00083 """ 00084 internal API method 00085 """ 00086 return self._slot_types 00087 00088 def serialize(self, buff): 00089 """ 00090 serialize message into buffer 00091 @param buff: buffer 00092 @type buff: StringIO 00093 """ 00094 try: 00095 _x = self 00096 buff.write(_struct_3d2B.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type)) 00097 _x = self.system_version 00098 # - if encoded as a list instead, serialize as bytes instead of string 00099 if type(_x) in [list, tuple]: 00100 buff.write(_struct_120B.pack(*_x)) 00101 else: 00102 buff.write(_struct_120s.pack(_x)) 00103 _x = self.primary_gnss_version 00104 # - if encoded as a list instead, serialize as bytes instead of string 00105 if type(_x) in [list, tuple]: 00106 buff.write(_struct_80B.pack(*_x)) 00107 else: 00108 buff.write(_struct_80s.pack(_x)) 00109 _x = self.secondary_gnss_version 00110 # - if encoded as a list instead, serialize as bytes instead of string 00111 if type(_x) in [list, tuple]: 00112 buff.write(_struct_80B.pack(*_x)) 00113 else: 00114 buff.write(_struct_80s.pack(_x)) 00115 _x = self 00116 buff.write(_struct_fI3f.pack(_x.total_hours, _x.num_runs, _x.avg_run_length, _x.longest_run, _x.current_run)) 00117 except struct.error as se: self._check_types(se) 00118 except TypeError as te: self._check_types(te) 00119 00120 def deserialize(self, str): 00121 """ 00122 unpack serialized message in str into this message instance 00123 @param str: byte array of serialized message 00124 @type str: str 00125 """ 00126 try: 00127 if self.td is None: 00128 self.td = applanix_msgs.msg.TimeDistance() 00129 end = 0 00130 _x = self 00131 start = end 00132 end += 26 00133 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type,) = _struct_3d2B.unpack(str[start:end]) 00134 start = end 00135 end += 120 00136 self.system_version = str[start:end] 00137 start = end 00138 end += 80 00139 self.primary_gnss_version = str[start:end] 00140 start = end 00141 end += 80 00142 self.secondary_gnss_version = str[start:end] 00143 _x = self 00144 start = end 00145 end += 20 00146 (_x.total_hours, _x.num_runs, _x.avg_run_length, _x.longest_run, _x.current_run,) = _struct_fI3f.unpack(str[start:end]) 00147 return self 00148 except struct.error as e: 00149 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00150 00151 00152 def serialize_numpy(self, buff, numpy): 00153 """ 00154 serialize message with numpy array types into buffer 00155 @param buff: buffer 00156 @type buff: StringIO 00157 @param numpy: numpy python module 00158 @type numpy module 00159 """ 00160 try: 00161 _x = self 00162 buff.write(_struct_3d2B.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type)) 00163 _x = self.system_version 00164 # - if encoded as a list instead, serialize as bytes instead of string 00165 if type(_x) in [list, tuple]: 00166 buff.write(_struct_120B.pack(*_x)) 00167 else: 00168 buff.write(_struct_120s.pack(_x)) 00169 _x = self.primary_gnss_version 00170 # - if encoded as a list instead, serialize as bytes instead of string 00171 if type(_x) in [list, tuple]: 00172 buff.write(_struct_80B.pack(*_x)) 00173 else: 00174 buff.write(_struct_80s.pack(_x)) 00175 _x = self.secondary_gnss_version 00176 # - if encoded as a list instead, serialize as bytes instead of string 00177 if type(_x) in [list, tuple]: 00178 buff.write(_struct_80B.pack(*_x)) 00179 else: 00180 buff.write(_struct_80s.pack(_x)) 00181 _x = self 00182 buff.write(_struct_fI3f.pack(_x.total_hours, _x.num_runs, _x.avg_run_length, _x.longest_run, _x.current_run)) 00183 except struct.error as se: self._check_types(se) 00184 except TypeError as te: self._check_types(te) 00185 00186 def deserialize_numpy(self, str, numpy): 00187 """ 00188 unpack serialized message in str into this message instance using numpy for array types 00189 @param str: byte array of serialized message 00190 @type str: str 00191 @param numpy: numpy python module 00192 @type numpy: module 00193 """ 00194 try: 00195 if self.td is None: 00196 self.td = applanix_msgs.msg.TimeDistance() 00197 end = 0 00198 _x = self 00199 start = end 00200 end += 26 00201 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type,) = _struct_3d2B.unpack(str[start:end]) 00202 start = end 00203 end += 120 00204 self.system_version = str[start:end] 00205 start = end 00206 end += 80 00207 self.primary_gnss_version = str[start:end] 00208 start = end 00209 end += 80 00210 self.secondary_gnss_version = str[start:end] 00211 _x = self 00212 start = end 00213 end += 20 00214 (_x.total_hours, _x.num_runs, _x.avg_run_length, _x.longest_run, _x.current_run,) = _struct_fI3f.unpack(str[start:end]) 00215 return self 00216 except struct.error as e: 00217 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00218 00219 _struct_I = roslib.message.struct_I 00220 _struct_fI3f = struct.Struct("<fI3f") 00221 _struct_80B = struct.Struct("<80B") 00222 _struct_120s = struct.Struct("<120s") 00223 _struct_3d2B = struct.Struct("<3d2B") 00224 _struct_80s = struct.Struct("<80s") 00225 _struct_120B = struct.Struct("<120B")