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


corobot_msgs
Author(s):
autogenerated on Wed Aug 26 2015 11:09:32