_GetPolledImage.py
Go to the documentation of this file.
00001 """autogenerated by genpy from polled_camera/GetPolledImageRequest.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 sensor_msgs.msg
00009 
00010 class GetPolledImageRequest(genpy.Message):
00011   _md5sum = "c77ed43e530fd48e9e7a2a93845e154c"
00012   _type = "polled_camera/GetPolledImageRequest"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """
00015 
00016 
00017 
00018 string response_namespace
00019 
00020 
00021 
00022 
00023 duration timeout
00024 
00025 
00026 uint32 binning_x
00027 uint32 binning_y
00028 
00029 
00030 sensor_msgs/RegionOfInterest roi
00031 
00032 ================================================================================
00033 MSG: sensor_msgs/RegionOfInterest
00034 # This message is used to specify a region of interest within an image.
00035 #
00036 # When used to specify the ROI setting of the camera when the image was
00037 # taken, the height and width fields should either match the height and
00038 # width fields for the associated image; or height = width = 0
00039 # indicates that the full resolution image was captured.
00040 
00041 uint32 x_offset  # Leftmost pixel of the ROI
00042                  # (0 if the ROI includes the left edge of the image)
00043 uint32 y_offset  # Topmost pixel of the ROI
00044                  # (0 if the ROI includes the top edge of the image)
00045 uint32 height    # Height of ROI
00046 uint32 width     # Width of ROI
00047 
00048 # True if a distinct rectified ROI should be calculated from the "raw"
00049 # ROI in this message. Typically this should be False if the full image
00050 # is captured (ROI not used), and True if a subwindow is captured (ROI
00051 # used).
00052 bool do_rectify
00053 
00054 """
00055   __slots__ = ['response_namespace','timeout','binning_x','binning_y','roi']
00056   _slot_types = ['string','duration','uint32','uint32','sensor_msgs/RegionOfInterest']
00057 
00058   def __init__(self, *args, **kwds):
00059     """
00060     Constructor. Any message fields that are implicitly/explicitly
00061     set to None will be assigned a default value. The recommend
00062     use is keyword arguments as this is more robust to future message
00063     changes.  You cannot mix in-order arguments and keyword arguments.
00064 
00065     The available fields are:
00066        response_namespace,timeout,binning_x,binning_y,roi
00067 
00068     :param args: complete set of field values, in .msg order
00069     :param kwds: use keyword arguments corresponding to message field names
00070     to set specific fields.
00071     """
00072     if args or kwds:
00073       super(GetPolledImageRequest, self).__init__(*args, **kwds)
00074       #message fields cannot be None, assign default values for those that are
00075       if self.response_namespace is None:
00076         self.response_namespace = ''
00077       if self.timeout is None:
00078         self.timeout = genpy.Duration()
00079       if self.binning_x is None:
00080         self.binning_x = 0
00081       if self.binning_y is None:
00082         self.binning_y = 0
00083       if self.roi is None:
00084         self.roi = sensor_msgs.msg.RegionOfInterest()
00085     else:
00086       self.response_namespace = ''
00087       self.timeout = genpy.Duration()
00088       self.binning_x = 0
00089       self.binning_y = 0
00090       self.roi = sensor_msgs.msg.RegionOfInterest()
00091 
00092   def _get_types(self):
00093     """
00094     internal API method
00095     """
00096     return self._slot_types
00097 
00098   def serialize(self, buff):
00099     """
00100     serialize message into buffer
00101     :param buff: buffer, ``StringIO``
00102     """
00103     try:
00104       _x = self.response_namespace
00105       length = len(_x)
00106       if python3 or type(_x) == unicode:
00107         _x = _x.encode('utf-8')
00108         length = len(_x)
00109       buff.write(struct.pack('<I%ss'%length, length, _x))
00110       _x = self
00111       buff.write(_struct_2i6IB.pack(_x.timeout.secs, _x.timeout.nsecs, _x.binning_x, _x.binning_y, _x.roi.x_offset, _x.roi.y_offset, _x.roi.height, _x.roi.width, _x.roi.do_rectify))
00112     except struct.error as se: self._check_types(se)
00113     except TypeError as te: self._check_types(te)
00114 
00115   def deserialize(self, str):
00116     """
00117     unpack serialized message in str into this message instance
00118     :param str: byte array of serialized message, ``str``
00119     """
00120     try:
00121       if self.timeout is None:
00122         self.timeout = genpy.Duration()
00123       if self.roi is None:
00124         self.roi = sensor_msgs.msg.RegionOfInterest()
00125       end = 0
00126       start = end
00127       end += 4
00128       (length,) = _struct_I.unpack(str[start:end])
00129       start = end
00130       end += length
00131       if python3:
00132         self.response_namespace = str[start:end].decode('utf-8')
00133       else:
00134         self.response_namespace = str[start:end]
00135       _x = self
00136       start = end
00137       end += 33
00138       (_x.timeout.secs, _x.timeout.nsecs, _x.binning_x, _x.binning_y, _x.roi.x_offset, _x.roi.y_offset, _x.roi.height, _x.roi.width, _x.roi.do_rectify,) = _struct_2i6IB.unpack(str[start:end])
00139       self.roi.do_rectify = bool(self.roi.do_rectify)
00140       self.timeout.canon()
00141       return self
00142     except struct.error as e:
00143       raise genpy.DeserializationError(e) #most likely buffer underfill
00144 
00145 
00146   def serialize_numpy(self, buff, numpy):
00147     """
00148     serialize message with numpy array types into buffer
00149     :param buff: buffer, ``StringIO``
00150     :param numpy: numpy python module
00151     """
00152     try:
00153       _x = self.response_namespace
00154       length = len(_x)
00155       if python3 or type(_x) == unicode:
00156         _x = _x.encode('utf-8')
00157         length = len(_x)
00158       buff.write(struct.pack('<I%ss'%length, length, _x))
00159       _x = self
00160       buff.write(_struct_2i6IB.pack(_x.timeout.secs, _x.timeout.nsecs, _x.binning_x, _x.binning_y, _x.roi.x_offset, _x.roi.y_offset, _x.roi.height, _x.roi.width, _x.roi.do_rectify))
00161     except struct.error as se: self._check_types(se)
00162     except TypeError as te: self._check_types(te)
00163 
00164   def deserialize_numpy(self, str, numpy):
00165     """
00166     unpack serialized message in str into this message instance using numpy for array types
00167     :param str: byte array of serialized message, ``str``
00168     :param numpy: numpy python module
00169     """
00170     try:
00171       if self.timeout is None:
00172         self.timeout = genpy.Duration()
00173       if self.roi is None:
00174         self.roi = sensor_msgs.msg.RegionOfInterest()
00175       end = 0
00176       start = end
00177       end += 4
00178       (length,) = _struct_I.unpack(str[start:end])
00179       start = end
00180       end += length
00181       if python3:
00182         self.response_namespace = str[start:end].decode('utf-8')
00183       else:
00184         self.response_namespace = str[start:end]
00185       _x = self
00186       start = end
00187       end += 33
00188       (_x.timeout.secs, _x.timeout.nsecs, _x.binning_x, _x.binning_y, _x.roi.x_offset, _x.roi.y_offset, _x.roi.height, _x.roi.width, _x.roi.do_rectify,) = _struct_2i6IB.unpack(str[start:end])
00189       self.roi.do_rectify = bool(self.roi.do_rectify)
00190       self.timeout.canon()
00191       return self
00192     except struct.error as e:
00193       raise genpy.DeserializationError(e) #most likely buffer underfill
00194 
00195 _struct_I = genpy.struct_I
00196 _struct_2i6IB = struct.Struct("<2i6IB")
00197 """autogenerated by genpy from polled_camera/GetPolledImageResponse.msg. Do not edit."""
00198 import sys
00199 python3 = True if sys.hexversion > 0x03000000 else False
00200 import genpy
00201 import struct
00202 
00203 import genpy
00204 
00205 class GetPolledImageResponse(genpy.Message):
00206   _md5sum = "dbf1f851bc511800e6129ccd5a3542ab"
00207   _type = "polled_camera/GetPolledImageResponse"
00208   _has_header = False #flag to mark the presence of a Header object
00209   _full_text = """bool success
00210 string status_message
00211 time stamp
00212 
00213 
00214 
00215 """
00216   __slots__ = ['success','status_message','stamp']
00217   _slot_types = ['bool','string','time']
00218 
00219   def __init__(self, *args, **kwds):
00220     """
00221     Constructor. Any message fields that are implicitly/explicitly
00222     set to None will be assigned a default value. The recommend
00223     use is keyword arguments as this is more robust to future message
00224     changes.  You cannot mix in-order arguments and keyword arguments.
00225 
00226     The available fields are:
00227        success,status_message,stamp
00228 
00229     :param args: complete set of field values, in .msg order
00230     :param kwds: use keyword arguments corresponding to message field names
00231     to set specific fields.
00232     """
00233     if args or kwds:
00234       super(GetPolledImageResponse, self).__init__(*args, **kwds)
00235       #message fields cannot be None, assign default values for those that are
00236       if self.success is None:
00237         self.success = False
00238       if self.status_message is None:
00239         self.status_message = ''
00240       if self.stamp is None:
00241         self.stamp = genpy.Time()
00242     else:
00243       self.success = False
00244       self.status_message = ''
00245       self.stamp = genpy.Time()
00246 
00247   def _get_types(self):
00248     """
00249     internal API method
00250     """
00251     return self._slot_types
00252 
00253   def serialize(self, buff):
00254     """
00255     serialize message into buffer
00256     :param buff: buffer, ``StringIO``
00257     """
00258     try:
00259       buff.write(_struct_B.pack(self.success))
00260       _x = self.status_message
00261       length = len(_x)
00262       if python3 or type(_x) == unicode:
00263         _x = _x.encode('utf-8')
00264         length = len(_x)
00265       buff.write(struct.pack('<I%ss'%length, length, _x))
00266       _x = self
00267       buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs))
00268     except struct.error as se: self._check_types(se)
00269     except TypeError as te: self._check_types(te)
00270 
00271   def deserialize(self, str):
00272     """
00273     unpack serialized message in str into this message instance
00274     :param str: byte array of serialized message, ``str``
00275     """
00276     try:
00277       if self.stamp is None:
00278         self.stamp = genpy.Time()
00279       end = 0
00280       start = end
00281       end += 1
00282       (self.success,) = _struct_B.unpack(str[start:end])
00283       self.success = bool(self.success)
00284       start = end
00285       end += 4
00286       (length,) = _struct_I.unpack(str[start:end])
00287       start = end
00288       end += length
00289       if python3:
00290         self.status_message = str[start:end].decode('utf-8')
00291       else:
00292         self.status_message = str[start:end]
00293       _x = self
00294       start = end
00295       end += 8
00296       (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00297       self.stamp.canon()
00298       return self
00299     except struct.error as e:
00300       raise genpy.DeserializationError(e) #most likely buffer underfill
00301 
00302 
00303   def serialize_numpy(self, buff, numpy):
00304     """
00305     serialize message with numpy array types into buffer
00306     :param buff: buffer, ``StringIO``
00307     :param numpy: numpy python module
00308     """
00309     try:
00310       buff.write(_struct_B.pack(self.success))
00311       _x = self.status_message
00312       length = len(_x)
00313       if python3 or type(_x) == unicode:
00314         _x = _x.encode('utf-8')
00315         length = len(_x)
00316       buff.write(struct.pack('<I%ss'%length, length, _x))
00317       _x = self
00318       buff.write(_struct_2I.pack(_x.stamp.secs, _x.stamp.nsecs))
00319     except struct.error as se: self._check_types(se)
00320     except TypeError as te: self._check_types(te)
00321 
00322   def deserialize_numpy(self, str, numpy):
00323     """
00324     unpack serialized message in str into this message instance using numpy for array types
00325     :param str: byte array of serialized message, ``str``
00326     :param numpy: numpy python module
00327     """
00328     try:
00329       if self.stamp is None:
00330         self.stamp = genpy.Time()
00331       end = 0
00332       start = end
00333       end += 1
00334       (self.success,) = _struct_B.unpack(str[start:end])
00335       self.success = bool(self.success)
00336       start = end
00337       end += 4
00338       (length,) = _struct_I.unpack(str[start:end])
00339       start = end
00340       end += length
00341       if python3:
00342         self.status_message = str[start:end].decode('utf-8')
00343       else:
00344         self.status_message = str[start:end]
00345       _x = self
00346       start = end
00347       end += 8
00348       (_x.stamp.secs, _x.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00349       self.stamp.canon()
00350       return self
00351     except struct.error as e:
00352       raise genpy.DeserializationError(e) #most likely buffer underfill
00353 
00354 _struct_I = genpy.struct_I
00355 _struct_B = struct.Struct("<B")
00356 _struct_2I = struct.Struct("<2I")
00357 class GetPolledImage(object):
00358   _type          = 'polled_camera/GetPolledImage'
00359   _md5sum = '1f3fb0d09d6e1c72d4a7eeb9822d9030'
00360   _request_class  = GetPolledImageRequest
00361   _response_class = GetPolledImageResponse


polled_camera
Author(s): Patrick Mihelich
autogenerated on Fri Jan 3 2014 11:24:21