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


corobot_camera
Author(s):
autogenerated on Sun Oct 5 2014 23:17:57