_Status.py
Go to the documentation of this file.
00001 """autogenerated by genpy from mav_msgs/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 Status(genpy.Message):
00010   _md5sum = "a057741fd00ea7c39c0e7269b0defec7"
00011   _type = "mav_msgs/Status"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """# Software License Agreement (BSD License)
00014 #
00015 # Copyright (c) 2010
00016 #  Ivan Dryanovski <ivan.dryanovski@gmail.com>
00017 # All rights reserved.
00018 #
00019 # Redistribution and use in source and binary forms, with or without
00020 # modification, are permitted provided that the following conditions
00021 # are met:
00022 #
00023 #  * Redistributions of source code must retain the above copyright
00024 #    notice, this list of conditions and the following disclaimer.
00025 #  * Redistributions in binary form must reproduce the above
00026 #    copyright notice, this list of conditions and the following
00027 #    disclaimer in the documentation and/or other materials provided
00028 #    with the distribution.
00029 #  * Neither the name of CCNY Robotics Lab nor the names of its
00030 #    contributors may be used to endorse or promote products derived
00031 #    from this software without specific prior written permission.
00032 #
00033 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00034 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00035 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00036 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00037 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00038 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00039 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00040 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00041 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00042 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00043 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00044 # POSSIBILITY OF SUCH DAMAGE.
00045 
00046 Header header
00047 
00048 uint8 flight_state
00049 
00050 ================================================================================
00051 MSG: std_msgs/Header
00052 # Standard metadata for higher-level stamped data types.
00053 # This is generally used to communicate timestamped data 
00054 # in a particular coordinate frame.
00055 # 
00056 # sequence ID: consecutively increasing ID 
00057 uint32 seq
00058 #Two-integer timestamp that is expressed as:
00059 # * stamp.secs: seconds (stamp_secs) since epoch
00060 # * stamp.nsecs: nanoseconds since stamp_secs
00061 # time-handling sugar is provided by the client library
00062 time stamp
00063 #Frame this data is associated with
00064 # 0: no frame
00065 # 1: global frame
00066 string frame_id
00067 
00068 """
00069   __slots__ = ['header','flight_state']
00070   _slot_types = ['std_msgs/Header','uint8']
00071 
00072   def __init__(self, *args, **kwds):
00073     """
00074     Constructor. Any message fields that are implicitly/explicitly
00075     set to None will be assigned a default value. The recommend
00076     use is keyword arguments as this is more robust to future message
00077     changes.  You cannot mix in-order arguments and keyword arguments.
00078 
00079     The available fields are:
00080        header,flight_state
00081 
00082     :param args: complete set of field values, in .msg order
00083     :param kwds: use keyword arguments corresponding to message field names
00084     to set specific fields.
00085     """
00086     if args or kwds:
00087       super(Status, self).__init__(*args, **kwds)
00088       #message fields cannot be None, assign default values for those that are
00089       if self.header is None:
00090         self.header = std_msgs.msg.Header()
00091       if self.flight_state is None:
00092         self.flight_state = 0
00093     else:
00094       self.header = std_msgs.msg.Header()
00095       self.flight_state = 0
00096 
00097   def _get_types(self):
00098     """
00099     internal API method
00100     """
00101     return self._slot_types
00102 
00103   def serialize(self, buff):
00104     """
00105     serialize message into buffer
00106     :param buff: buffer, ``StringIO``
00107     """
00108     try:
00109       _x = self
00110       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00111       _x = self.header.frame_id
00112       length = len(_x)
00113       if python3 or type(_x) == unicode:
00114         _x = _x.encode('utf-8')
00115         length = len(_x)
00116       buff.write(struct.pack('<I%ss'%length, length, _x))
00117       buff.write(_struct_B.pack(self.flight_state))
00118     except struct.error as se: self._check_types(se)
00119     except TypeError as te: self._check_types(te)
00120 
00121   def deserialize(self, str):
00122     """
00123     unpack serialized message in str into this message instance
00124     :param str: byte array of serialized message, ``str``
00125     """
00126     try:
00127       if self.header is None:
00128         self.header = std_msgs.msg.Header()
00129       end = 0
00130       _x = self
00131       start = end
00132       end += 12
00133       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00134       start = end
00135       end += 4
00136       (length,) = _struct_I.unpack(str[start:end])
00137       start = end
00138       end += length
00139       if python3:
00140         self.header.frame_id = str[start:end].decode('utf-8')
00141       else:
00142         self.header.frame_id = str[start:end]
00143       start = end
00144       end += 1
00145       (self.flight_state,) = _struct_B.unpack(str[start:end])
00146       return self
00147     except struct.error as e:
00148       raise genpy.DeserializationError(e) #most likely buffer underfill
00149 
00150 
00151   def serialize_numpy(self, buff, numpy):
00152     """
00153     serialize message with numpy array types into buffer
00154     :param buff: buffer, ``StringIO``
00155     :param numpy: numpy python module
00156     """
00157     try:
00158       _x = self
00159       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00160       _x = self.header.frame_id
00161       length = len(_x)
00162       if python3 or type(_x) == unicode:
00163         _x = _x.encode('utf-8')
00164         length = len(_x)
00165       buff.write(struct.pack('<I%ss'%length, length, _x))
00166       buff.write(_struct_B.pack(self.flight_state))
00167     except struct.error as se: self._check_types(se)
00168     except TypeError as te: self._check_types(te)
00169 
00170   def deserialize_numpy(self, str, numpy):
00171     """
00172     unpack serialized message in str into this message instance using numpy for array types
00173     :param str: byte array of serialized message, ``str``
00174     :param numpy: numpy python module
00175     """
00176     try:
00177       if self.header is None:
00178         self.header = std_msgs.msg.Header()
00179       end = 0
00180       _x = self
00181       start = end
00182       end += 12
00183       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00184       start = end
00185       end += 4
00186       (length,) = _struct_I.unpack(str[start:end])
00187       start = end
00188       end += length
00189       if python3:
00190         self.header.frame_id = str[start:end].decode('utf-8')
00191       else:
00192         self.header.frame_id = str[start:end]
00193       start = end
00194       end += 1
00195       (self.flight_state,) = _struct_B.unpack(str[start:end])
00196       return self
00197     except struct.error as e:
00198       raise genpy.DeserializationError(e) #most likely buffer underfill
00199 
00200 _struct_I = genpy.struct_I
00201 _struct_3I = struct.Struct("<3I")
00202 _struct_B = struct.Struct("<B")


mav_msgs
Author(s): Ivan Dryanovski, William Morris
autogenerated on Thu Jan 2 2014 11:28:10