_Status.py
Go to the documentation of this file.
00001 """autogenerated by genpy from quad_status/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 genpy
00008 import std_msgs.msg
00009 
00010 class Status(genpy.Message):
00011   _md5sum = "3563f39c50382b772e10b44ffe9cb2ed"
00012   _type = "quad_status/Status"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 float32 Batt_Voltage
00016 bool RC_OK
00017 bool Motors_ON
00018 bool ExCtrl_ON
00019 duration Run_Time
00020 
00021 ================================================================================
00022 MSG: std_msgs/Header
00023 # Standard metadata for higher-level stamped data types.
00024 # This is generally used to communicate timestamped data 
00025 # in a particular coordinate frame.
00026 # 
00027 # sequence ID: consecutively increasing ID 
00028 uint32 seq
00029 #Two-integer timestamp that is expressed as:
00030 # * stamp.secs: seconds (stamp_secs) since epoch
00031 # * stamp.nsecs: nanoseconds since stamp_secs
00032 # time-handling sugar is provided by the client library
00033 time stamp
00034 #Frame this data is associated with
00035 # 0: no frame
00036 # 1: global frame
00037 string frame_id
00038 
00039 """
00040   __slots__ = ['header','Batt_Voltage','RC_OK','Motors_ON','ExCtrl_ON','Run_Time']
00041   _slot_types = ['std_msgs/Header','float32','bool','bool','bool','duration']
00042 
00043   def __init__(self, *args, **kwds):
00044     """
00045     Constructor. Any message fields that are implicitly/explicitly
00046     set to None will be assigned a default value. The recommend
00047     use is keyword arguments as this is more robust to future message
00048     changes.  You cannot mix in-order arguments and keyword arguments.
00049 
00050     The available fields are:
00051        header,Batt_Voltage,RC_OK,Motors_ON,ExCtrl_ON,Run_Time
00052 
00053     :param args: complete set of field values, in .msg order
00054     :param kwds: use keyword arguments corresponding to message field names
00055     to set specific fields.
00056     """
00057     if args or kwds:
00058       super(Status, self).__init__(*args, **kwds)
00059       #message fields cannot be None, assign default values for those that are
00060       if self.header is None:
00061         self.header = std_msgs.msg.Header()
00062       if self.Batt_Voltage is None:
00063         self.Batt_Voltage = 0.
00064       if self.RC_OK is None:
00065         self.RC_OK = False
00066       if self.Motors_ON is None:
00067         self.Motors_ON = False
00068       if self.ExCtrl_ON is None:
00069         self.ExCtrl_ON = False
00070       if self.Run_Time is None:
00071         self.Run_Time = genpy.Duration()
00072     else:
00073       self.header = std_msgs.msg.Header()
00074       self.Batt_Voltage = 0.
00075       self.RC_OK = False
00076       self.Motors_ON = False
00077       self.ExCtrl_ON = False
00078       self.Run_Time = genpy.Duration()
00079 
00080   def _get_types(self):
00081     """
00082     internal API method
00083     """
00084     return self._slot_types
00085 
00086   def serialize(self, buff):
00087     """
00088     serialize message into buffer
00089     :param buff: buffer, ``StringIO``
00090     """
00091     try:
00092       _x = self
00093       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00094       _x = self.header.frame_id
00095       length = len(_x)
00096       if python3 or type(_x) == unicode:
00097         _x = _x.encode('utf-8')
00098         length = len(_x)
00099       buff.write(struct.pack('<I%ss'%length, length, _x))
00100       _x = self
00101       buff.write(_struct_f3B2i.pack(_x.Batt_Voltage, _x.RC_OK, _x.Motors_ON, _x.ExCtrl_ON, _x.Run_Time.secs, _x.Run_Time.nsecs))
00102     except struct.error as se: self._check_types(se)
00103     except TypeError as te: self._check_types(te)
00104 
00105   def deserialize(self, str):
00106     """
00107     unpack serialized message in str into this message instance
00108     :param str: byte array of serialized message, ``str``
00109     """
00110     try:
00111       if self.header is None:
00112         self.header = std_msgs.msg.Header()
00113       if self.Run_Time is None:
00114         self.Run_Time = genpy.Duration()
00115       end = 0
00116       _x = self
00117       start = end
00118       end += 12
00119       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00120       start = end
00121       end += 4
00122       (length,) = _struct_I.unpack(str[start:end])
00123       start = end
00124       end += length
00125       if python3:
00126         self.header.frame_id = str[start:end].decode('utf-8')
00127       else:
00128         self.header.frame_id = str[start:end]
00129       _x = self
00130       start = end
00131       end += 15
00132       (_x.Batt_Voltage, _x.RC_OK, _x.Motors_ON, _x.ExCtrl_ON, _x.Run_Time.secs, _x.Run_Time.nsecs,) = _struct_f3B2i.unpack(str[start:end])
00133       self.RC_OK = bool(self.RC_OK)
00134       self.Motors_ON = bool(self.Motors_ON)
00135       self.ExCtrl_ON = bool(self.ExCtrl_ON)
00136       self.Run_Time.canon()
00137       return self
00138     except struct.error as e:
00139       raise genpy.DeserializationError(e) #most likely buffer underfill
00140 
00141 
00142   def serialize_numpy(self, buff, numpy):
00143     """
00144     serialize message with numpy array types into buffer
00145     :param buff: buffer, ``StringIO``
00146     :param numpy: numpy python module
00147     """
00148     try:
00149       _x = self
00150       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00151       _x = self.header.frame_id
00152       length = len(_x)
00153       if python3 or type(_x) == unicode:
00154         _x = _x.encode('utf-8')
00155         length = len(_x)
00156       buff.write(struct.pack('<I%ss'%length, length, _x))
00157       _x = self
00158       buff.write(_struct_f3B2i.pack(_x.Batt_Voltage, _x.RC_OK, _x.Motors_ON, _x.ExCtrl_ON, _x.Run_Time.secs, _x.Run_Time.nsecs))
00159     except struct.error as se: self._check_types(se)
00160     except TypeError as te: self._check_types(te)
00161 
00162   def deserialize_numpy(self, str, numpy):
00163     """
00164     unpack serialized message in str into this message instance using numpy for array types
00165     :param str: byte array of serialized message, ``str``
00166     :param numpy: numpy python module
00167     """
00168     try:
00169       if self.header is None:
00170         self.header = std_msgs.msg.Header()
00171       if self.Run_Time is None:
00172         self.Run_Time = genpy.Duration()
00173       end = 0
00174       _x = self
00175       start = end
00176       end += 12
00177       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00178       start = end
00179       end += 4
00180       (length,) = _struct_I.unpack(str[start:end])
00181       start = end
00182       end += length
00183       if python3:
00184         self.header.frame_id = str[start:end].decode('utf-8')
00185       else:
00186         self.header.frame_id = str[start:end]
00187       _x = self
00188       start = end
00189       end += 15
00190       (_x.Batt_Voltage, _x.RC_OK, _x.Motors_ON, _x.ExCtrl_ON, _x.Run_Time.secs, _x.Run_Time.nsecs,) = _struct_f3B2i.unpack(str[start:end])
00191       self.RC_OK = bool(self.RC_OK)
00192       self.Motors_ON = bool(self.Motors_ON)
00193       self.ExCtrl_ON = bool(self.ExCtrl_ON)
00194       self.Run_Time.canon()
00195       return self
00196     except struct.error as e:
00197       raise genpy.DeserializationError(e) #most likely buffer underfill
00198 
00199 _struct_I = genpy.struct_I
00200 _struct_3I = struct.Struct("<3I")
00201 _struct_f3B2i = struct.Struct("<f3B2i")


quad_status
Author(s): Henrique
autogenerated on Mon Jan 6 2014 11:48:42