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


corobot_camera
Author(s):
autogenerated on Wed Aug 26 2015 11:09:42