_mav_status.py
Go to the documentation of this file.
00001 """autogenerated by genpy from asctec_hl_comm/mav_status.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 std_msgs.msg
00008 
00009 class mav_status(genpy.Message):
00010   _md5sum = "f975cbdf223868931f194323c62d7be5"
00011   _type = "asctec_hl_comm/mav_status"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """Header header
00014 
00015 float32     battery_voltage
00016 string      flight_mode_ll
00017 string      state_estimation
00018 string      position_control
00019 bool        serial_interface_enabled
00020 bool        serial_interface_active
00021 float32     flight_time
00022 float32     cpu_load
00023 
00024 string      motor_status
00025 
00026 string      gps_status
00027 int32       gps_num_satellites 
00028 
00029 int32       debug1
00030 int32       debug2
00031 
00032 bool        have_SSDK_parameters
00033 
00034 uint32      tx_packets
00035 uint32      tx_packets_good
00036 uint32      rx_packets
00037 uint32      rx_packets_good
00038 
00039 float32     timesync_offset
00040 ================================================================================
00041 MSG: std_msgs/Header
00042 # Standard metadata for higher-level stamped data types.
00043 # This is generally used to communicate timestamped data 
00044 # in a particular coordinate frame.
00045 # 
00046 # sequence ID: consecutively increasing ID 
00047 uint32 seq
00048 #Two-integer timestamp that is expressed as:
00049 # * stamp.secs: seconds (stamp_secs) since epoch
00050 # * stamp.nsecs: nanoseconds since stamp_secs
00051 # time-handling sugar is provided by the client library
00052 time stamp
00053 #Frame this data is associated with
00054 # 0: no frame
00055 # 1: global frame
00056 string frame_id
00057 
00058 """
00059   __slots__ = ['header','battery_voltage','flight_mode_ll','state_estimation','position_control','serial_interface_enabled','serial_interface_active','flight_time','cpu_load','motor_status','gps_status','gps_num_satellites','debug1','debug2','have_SSDK_parameters','tx_packets','tx_packets_good','rx_packets','rx_packets_good','timesync_offset']
00060   _slot_types = ['std_msgs/Header','float32','string','string','string','bool','bool','float32','float32','string','string','int32','int32','int32','bool','uint32','uint32','uint32','uint32','float32']
00061 
00062   def __init__(self, *args, **kwds):
00063     """
00064     Constructor. Any message fields that are implicitly/explicitly
00065     set to None will be assigned a default value. The recommend
00066     use is keyword arguments as this is more robust to future message
00067     changes.  You cannot mix in-order arguments and keyword arguments.
00068 
00069     The available fields are:
00070        header,battery_voltage,flight_mode_ll,state_estimation,position_control,serial_interface_enabled,serial_interface_active,flight_time,cpu_load,motor_status,gps_status,gps_num_satellites,debug1,debug2,have_SSDK_parameters,tx_packets,tx_packets_good,rx_packets,rx_packets_good,timesync_offset
00071 
00072     :param args: complete set of field values, in .msg order
00073     :param kwds: use keyword arguments corresponding to message field names
00074     to set specific fields.
00075     """
00076     if args or kwds:
00077       super(mav_status, self).__init__(*args, **kwds)
00078       #message fields cannot be None, assign default values for those that are
00079       if self.header is None:
00080         self.header = std_msgs.msg.Header()
00081       if self.battery_voltage is None:
00082         self.battery_voltage = 0.
00083       if self.flight_mode_ll is None:
00084         self.flight_mode_ll = ''
00085       if self.state_estimation is None:
00086         self.state_estimation = ''
00087       if self.position_control is None:
00088         self.position_control = ''
00089       if self.serial_interface_enabled is None:
00090         self.serial_interface_enabled = False
00091       if self.serial_interface_active is None:
00092         self.serial_interface_active = False
00093       if self.flight_time is None:
00094         self.flight_time = 0.
00095       if self.cpu_load is None:
00096         self.cpu_load = 0.
00097       if self.motor_status is None:
00098         self.motor_status = ''
00099       if self.gps_status is None:
00100         self.gps_status = ''
00101       if self.gps_num_satellites is None:
00102         self.gps_num_satellites = 0
00103       if self.debug1 is None:
00104         self.debug1 = 0
00105       if self.debug2 is None:
00106         self.debug2 = 0
00107       if self.have_SSDK_parameters is None:
00108         self.have_SSDK_parameters = False
00109       if self.tx_packets is None:
00110         self.tx_packets = 0
00111       if self.tx_packets_good is None:
00112         self.tx_packets_good = 0
00113       if self.rx_packets is None:
00114         self.rx_packets = 0
00115       if self.rx_packets_good is None:
00116         self.rx_packets_good = 0
00117       if self.timesync_offset is None:
00118         self.timesync_offset = 0.
00119     else:
00120       self.header = std_msgs.msg.Header()
00121       self.battery_voltage = 0.
00122       self.flight_mode_ll = ''
00123       self.state_estimation = ''
00124       self.position_control = ''
00125       self.serial_interface_enabled = False
00126       self.serial_interface_active = False
00127       self.flight_time = 0.
00128       self.cpu_load = 0.
00129       self.motor_status = ''
00130       self.gps_status = ''
00131       self.gps_num_satellites = 0
00132       self.debug1 = 0
00133       self.debug2 = 0
00134       self.have_SSDK_parameters = False
00135       self.tx_packets = 0
00136       self.tx_packets_good = 0
00137       self.rx_packets = 0
00138       self.rx_packets_good = 0
00139       self.timesync_offset = 0.
00140 
00141   def _get_types(self):
00142     """
00143     internal API method
00144     """
00145     return self._slot_types
00146 
00147   def serialize(self, buff):
00148     """
00149     serialize message into buffer
00150     :param buff: buffer, ``StringIO``
00151     """
00152     try:
00153       _x = self
00154       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00155       _x = self.header.frame_id
00156       length = len(_x)
00157       if python3 or type(_x) == unicode:
00158         _x = _x.encode('utf-8')
00159         length = len(_x)
00160       buff.write(struct.pack('<I%ss'%length, length, _x))
00161       buff.write(_struct_f.pack(self.battery_voltage))
00162       _x = self.flight_mode_ll
00163       length = len(_x)
00164       if python3 or type(_x) == unicode:
00165         _x = _x.encode('utf-8')
00166         length = len(_x)
00167       buff.write(struct.pack('<I%ss'%length, length, _x))
00168       _x = self.state_estimation
00169       length = len(_x)
00170       if python3 or type(_x) == unicode:
00171         _x = _x.encode('utf-8')
00172         length = len(_x)
00173       buff.write(struct.pack('<I%ss'%length, length, _x))
00174       _x = self.position_control
00175       length = len(_x)
00176       if python3 or type(_x) == unicode:
00177         _x = _x.encode('utf-8')
00178         length = len(_x)
00179       buff.write(struct.pack('<I%ss'%length, length, _x))
00180       _x = self
00181       buff.write(_struct_2B2f.pack(_x.serial_interface_enabled, _x.serial_interface_active, _x.flight_time, _x.cpu_load))
00182       _x = self.motor_status
00183       length = len(_x)
00184       if python3 or type(_x) == unicode:
00185         _x = _x.encode('utf-8')
00186         length = len(_x)
00187       buff.write(struct.pack('<I%ss'%length, length, _x))
00188       _x = self.gps_status
00189       length = len(_x)
00190       if python3 or type(_x) == unicode:
00191         _x = _x.encode('utf-8')
00192         length = len(_x)
00193       buff.write(struct.pack('<I%ss'%length, length, _x))
00194       _x = self
00195       buff.write(_struct_3iB4If.pack(_x.gps_num_satellites, _x.debug1, _x.debug2, _x.have_SSDK_parameters, _x.tx_packets, _x.tx_packets_good, _x.rx_packets, _x.rx_packets_good, _x.timesync_offset))
00196     except struct.error as se: self._check_types(se)
00197     except TypeError as te: self._check_types(te)
00198 
00199   def deserialize(self, str):
00200     """
00201     unpack serialized message in str into this message instance
00202     :param str: byte array of serialized message, ``str``
00203     """
00204     try:
00205       if self.header is None:
00206         self.header = std_msgs.msg.Header()
00207       end = 0
00208       _x = self
00209       start = end
00210       end += 12
00211       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00212       start = end
00213       end += 4
00214       (length,) = _struct_I.unpack(str[start:end])
00215       start = end
00216       end += length
00217       if python3:
00218         self.header.frame_id = str[start:end].decode('utf-8')
00219       else:
00220         self.header.frame_id = str[start:end]
00221       start = end
00222       end += 4
00223       (self.battery_voltage,) = _struct_f.unpack(str[start:end])
00224       start = end
00225       end += 4
00226       (length,) = _struct_I.unpack(str[start:end])
00227       start = end
00228       end += length
00229       if python3:
00230         self.flight_mode_ll = str[start:end].decode('utf-8')
00231       else:
00232         self.flight_mode_ll = str[start:end]
00233       start = end
00234       end += 4
00235       (length,) = _struct_I.unpack(str[start:end])
00236       start = end
00237       end += length
00238       if python3:
00239         self.state_estimation = str[start:end].decode('utf-8')
00240       else:
00241         self.state_estimation = str[start:end]
00242       start = end
00243       end += 4
00244       (length,) = _struct_I.unpack(str[start:end])
00245       start = end
00246       end += length
00247       if python3:
00248         self.position_control = str[start:end].decode('utf-8')
00249       else:
00250         self.position_control = str[start:end]
00251       _x = self
00252       start = end
00253       end += 10
00254       (_x.serial_interface_enabled, _x.serial_interface_active, _x.flight_time, _x.cpu_load,) = _struct_2B2f.unpack(str[start:end])
00255       self.serial_interface_enabled = bool(self.serial_interface_enabled)
00256       self.serial_interface_active = bool(self.serial_interface_active)
00257       start = end
00258       end += 4
00259       (length,) = _struct_I.unpack(str[start:end])
00260       start = end
00261       end += length
00262       if python3:
00263         self.motor_status = str[start:end].decode('utf-8')
00264       else:
00265         self.motor_status = str[start:end]
00266       start = end
00267       end += 4
00268       (length,) = _struct_I.unpack(str[start:end])
00269       start = end
00270       end += length
00271       if python3:
00272         self.gps_status = str[start:end].decode('utf-8')
00273       else:
00274         self.gps_status = str[start:end]
00275       _x = self
00276       start = end
00277       end += 33
00278       (_x.gps_num_satellites, _x.debug1, _x.debug2, _x.have_SSDK_parameters, _x.tx_packets, _x.tx_packets_good, _x.rx_packets, _x.rx_packets_good, _x.timesync_offset,) = _struct_3iB4If.unpack(str[start:end])
00279       self.have_SSDK_parameters = bool(self.have_SSDK_parameters)
00280       return self
00281     except struct.error as e:
00282       raise genpy.DeserializationError(e) #most likely buffer underfill
00283 
00284 
00285   def serialize_numpy(self, buff, numpy):
00286     """
00287     serialize message with numpy array types into buffer
00288     :param buff: buffer, ``StringIO``
00289     :param numpy: numpy python module
00290     """
00291     try:
00292       _x = self
00293       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00294       _x = self.header.frame_id
00295       length = len(_x)
00296       if python3 or type(_x) == unicode:
00297         _x = _x.encode('utf-8')
00298         length = len(_x)
00299       buff.write(struct.pack('<I%ss'%length, length, _x))
00300       buff.write(_struct_f.pack(self.battery_voltage))
00301       _x = self.flight_mode_ll
00302       length = len(_x)
00303       if python3 or type(_x) == unicode:
00304         _x = _x.encode('utf-8')
00305         length = len(_x)
00306       buff.write(struct.pack('<I%ss'%length, length, _x))
00307       _x = self.state_estimation
00308       length = len(_x)
00309       if python3 or type(_x) == unicode:
00310         _x = _x.encode('utf-8')
00311         length = len(_x)
00312       buff.write(struct.pack('<I%ss'%length, length, _x))
00313       _x = self.position_control
00314       length = len(_x)
00315       if python3 or type(_x) == unicode:
00316         _x = _x.encode('utf-8')
00317         length = len(_x)
00318       buff.write(struct.pack('<I%ss'%length, length, _x))
00319       _x = self
00320       buff.write(_struct_2B2f.pack(_x.serial_interface_enabled, _x.serial_interface_active, _x.flight_time, _x.cpu_load))
00321       _x = self.motor_status
00322       length = len(_x)
00323       if python3 or type(_x) == unicode:
00324         _x = _x.encode('utf-8')
00325         length = len(_x)
00326       buff.write(struct.pack('<I%ss'%length, length, _x))
00327       _x = self.gps_status
00328       length = len(_x)
00329       if python3 or type(_x) == unicode:
00330         _x = _x.encode('utf-8')
00331         length = len(_x)
00332       buff.write(struct.pack('<I%ss'%length, length, _x))
00333       _x = self
00334       buff.write(_struct_3iB4If.pack(_x.gps_num_satellites, _x.debug1, _x.debug2, _x.have_SSDK_parameters, _x.tx_packets, _x.tx_packets_good, _x.rx_packets, _x.rx_packets_good, _x.timesync_offset))
00335     except struct.error as se: self._check_types(se)
00336     except TypeError as te: self._check_types(te)
00337 
00338   def deserialize_numpy(self, str, numpy):
00339     """
00340     unpack serialized message in str into this message instance using numpy for array types
00341     :param str: byte array of serialized message, ``str``
00342     :param numpy: numpy python module
00343     """
00344     try:
00345       if self.header is None:
00346         self.header = std_msgs.msg.Header()
00347       end = 0
00348       _x = self
00349       start = end
00350       end += 12
00351       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00352       start = end
00353       end += 4
00354       (length,) = _struct_I.unpack(str[start:end])
00355       start = end
00356       end += length
00357       if python3:
00358         self.header.frame_id = str[start:end].decode('utf-8')
00359       else:
00360         self.header.frame_id = str[start:end]
00361       start = end
00362       end += 4
00363       (self.battery_voltage,) = _struct_f.unpack(str[start:end])
00364       start = end
00365       end += 4
00366       (length,) = _struct_I.unpack(str[start:end])
00367       start = end
00368       end += length
00369       if python3:
00370         self.flight_mode_ll = str[start:end].decode('utf-8')
00371       else:
00372         self.flight_mode_ll = str[start:end]
00373       start = end
00374       end += 4
00375       (length,) = _struct_I.unpack(str[start:end])
00376       start = end
00377       end += length
00378       if python3:
00379         self.state_estimation = str[start:end].decode('utf-8')
00380       else:
00381         self.state_estimation = str[start:end]
00382       start = end
00383       end += 4
00384       (length,) = _struct_I.unpack(str[start:end])
00385       start = end
00386       end += length
00387       if python3:
00388         self.position_control = str[start:end].decode('utf-8')
00389       else:
00390         self.position_control = str[start:end]
00391       _x = self
00392       start = end
00393       end += 10
00394       (_x.serial_interface_enabled, _x.serial_interface_active, _x.flight_time, _x.cpu_load,) = _struct_2B2f.unpack(str[start:end])
00395       self.serial_interface_enabled = bool(self.serial_interface_enabled)
00396       self.serial_interface_active = bool(self.serial_interface_active)
00397       start = end
00398       end += 4
00399       (length,) = _struct_I.unpack(str[start:end])
00400       start = end
00401       end += length
00402       if python3:
00403         self.motor_status = str[start:end].decode('utf-8')
00404       else:
00405         self.motor_status = str[start:end]
00406       start = end
00407       end += 4
00408       (length,) = _struct_I.unpack(str[start:end])
00409       start = end
00410       end += length
00411       if python3:
00412         self.gps_status = str[start:end].decode('utf-8')
00413       else:
00414         self.gps_status = str[start:end]
00415       _x = self
00416       start = end
00417       end += 33
00418       (_x.gps_num_satellites, _x.debug1, _x.debug2, _x.have_SSDK_parameters, _x.tx_packets, _x.tx_packets_good, _x.rx_packets, _x.rx_packets_good, _x.timesync_offset,) = _struct_3iB4If.unpack(str[start:end])
00419       self.have_SSDK_parameters = bool(self.have_SSDK_parameters)
00420       return self
00421     except struct.error as e:
00422       raise genpy.DeserializationError(e) #most likely buffer underfill
00423 
00424 _struct_I = genpy.struct_I
00425 _struct_2B2f = struct.Struct("<2B2f")
00426 _struct_3I = struct.Struct("<3I")
00427 _struct_3iB4If = struct.Struct("<3iB4If")
00428 _struct_f = struct.Struct("<f")


asctec_hl_comm
Author(s): Markus Achtelik, Michael Achtelik, Stephan Weiss, Laurent Kneip
autogenerated on Tue Jan 7 2014 11:05:05