00001 """autogenerated by genpy from iri_perception_msgs/SetImageRequest.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 import sensor_msgs.msg
00009
00010 class SetImageRequest(genpy.Message):
00011 _md5sum = "db7d5340a17ebc717da28ab27c870995"
00012 _type = "iri_perception_msgs/SetImageRequest"
00013 _has_header = False
00014 _full_text = """
00015 sensor_msgs/Image image_in
00016
00017 ================================================================================
00018 MSG: sensor_msgs/Image
00019 # This message contains an uncompressed image
00020 # (0, 0) is at top-left corner of image
00021 #
00022
00023 Header header # Header timestamp should be acquisition time of image
00024 # Header frame_id should be optical frame of camera
00025 # origin of frame should be optical center of cameara
00026 # +x should point to the right in the image
00027 # +y should point down in the image
00028 # +z should point into to plane of the image
00029 # If the frame_id here and the frame_id of the CameraInfo
00030 # message associated with the image conflict
00031 # the behavior is undefined
00032
00033 uint32 height # image height, that is, number of rows
00034 uint32 width # image width, that is, number of columns
00035
00036 # The legal values for encoding are in file src/image_encodings.cpp
00037 # If you want to standardize a new string format, join
00038 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00039
00040 string encoding # Encoding of pixels -- channel meaning, ordering, size
00041 # taken from the list of strings in src/image_encodings.cpp
00042
00043 uint8 is_bigendian # is this data bigendian?
00044 uint32 step # Full row length in bytes
00045 uint8[] data # actual matrix data, size is (step * rows)
00046
00047 ================================================================================
00048 MSG: std_msgs/Header
00049 # Standard metadata for higher-level stamped data types.
00050 # This is generally used to communicate timestamped data
00051 # in a particular coordinate frame.
00052 #
00053 # sequence ID: consecutively increasing ID
00054 uint32 seq
00055 #Two-integer timestamp that is expressed as:
00056 # * stamp.secs: seconds (stamp_secs) since epoch
00057 # * stamp.nsecs: nanoseconds since stamp_secs
00058 # time-handling sugar is provided by the client library
00059 time stamp
00060 #Frame this data is associated with
00061 # 0: no frame
00062 # 1: global frame
00063 string frame_id
00064
00065 """
00066 __slots__ = ['image_in']
00067 _slot_types = ['sensor_msgs/Image']
00068
00069 def __init__(self, *args, **kwds):
00070 """
00071 Constructor. Any message fields that are implicitly/explicitly
00072 set to None will be assigned a default value. The recommend
00073 use is keyword arguments as this is more robust to future message
00074 changes. You cannot mix in-order arguments and keyword arguments.
00075
00076 The available fields are:
00077 image_in
00078
00079 :param args: complete set of field values, in .msg order
00080 :param kwds: use keyword arguments corresponding to message field names
00081 to set specific fields.
00082 """
00083 if args or kwds:
00084 super(SetImageRequest, self).__init__(*args, **kwds)
00085
00086 if self.image_in is None:
00087 self.image_in = sensor_msgs.msg.Image()
00088 else:
00089 self.image_in = sensor_msgs.msg.Image()
00090
00091 def _get_types(self):
00092 """
00093 internal API method
00094 """
00095 return self._slot_types
00096
00097 def serialize(self, buff):
00098 """
00099 serialize message into buffer
00100 :param buff: buffer, ``StringIO``
00101 """
00102 try:
00103 _x = self
00104 buff.write(_struct_3I.pack(_x.image_in.header.seq, _x.image_in.header.stamp.secs, _x.image_in.header.stamp.nsecs))
00105 _x = self.image_in.header.frame_id
00106 length = len(_x)
00107 if python3 or type(_x) == unicode:
00108 _x = _x.encode('utf-8')
00109 length = len(_x)
00110 buff.write(struct.pack('<I%ss'%length, length, _x))
00111 _x = self
00112 buff.write(_struct_2I.pack(_x.image_in.height, _x.image_in.width))
00113 _x = self.image_in.encoding
00114 length = len(_x)
00115 if python3 or type(_x) == unicode:
00116 _x = _x.encode('utf-8')
00117 length = len(_x)
00118 buff.write(struct.pack('<I%ss'%length, length, _x))
00119 _x = self
00120 buff.write(_struct_BI.pack(_x.image_in.is_bigendian, _x.image_in.step))
00121 _x = self.image_in.data
00122 length = len(_x)
00123
00124 if type(_x) in [list, tuple]:
00125 buff.write(struct.pack('<I%sB'%length, length, *_x))
00126 else:
00127 buff.write(struct.pack('<I%ss'%length, length, _x))
00128 except struct.error as se: self._check_types(se)
00129 except TypeError as te: self._check_types(te)
00130
00131 def deserialize(self, str):
00132 """
00133 unpack serialized message in str into this message instance
00134 :param str: byte array of serialized message, ``str``
00135 """
00136 try:
00137 if self.image_in is None:
00138 self.image_in = sensor_msgs.msg.Image()
00139 end = 0
00140 _x = self
00141 start = end
00142 end += 12
00143 (_x.image_in.header.seq, _x.image_in.header.stamp.secs, _x.image_in.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00144 start = end
00145 end += 4
00146 (length,) = _struct_I.unpack(str[start:end])
00147 start = end
00148 end += length
00149 if python3:
00150 self.image_in.header.frame_id = str[start:end].decode('utf-8')
00151 else:
00152 self.image_in.header.frame_id = str[start:end]
00153 _x = self
00154 start = end
00155 end += 8
00156 (_x.image_in.height, _x.image_in.width,) = _struct_2I.unpack(str[start:end])
00157 start = end
00158 end += 4
00159 (length,) = _struct_I.unpack(str[start:end])
00160 start = end
00161 end += length
00162 if python3:
00163 self.image_in.encoding = str[start:end].decode('utf-8')
00164 else:
00165 self.image_in.encoding = str[start:end]
00166 _x = self
00167 start = end
00168 end += 5
00169 (_x.image_in.is_bigendian, _x.image_in.step,) = _struct_BI.unpack(str[start:end])
00170 start = end
00171 end += 4
00172 (length,) = _struct_I.unpack(str[start:end])
00173 start = end
00174 end += length
00175 if python3:
00176 self.image_in.data = str[start:end].decode('utf-8')
00177 else:
00178 self.image_in.data = str[start:end]
00179 return self
00180 except struct.error as e:
00181 raise genpy.DeserializationError(e)
00182
00183
00184 def serialize_numpy(self, buff, numpy):
00185 """
00186 serialize message with numpy array types into buffer
00187 :param buff: buffer, ``StringIO``
00188 :param numpy: numpy python module
00189 """
00190 try:
00191 _x = self
00192 buff.write(_struct_3I.pack(_x.image_in.header.seq, _x.image_in.header.stamp.secs, _x.image_in.header.stamp.nsecs))
00193 _x = self.image_in.header.frame_id
00194 length = len(_x)
00195 if python3 or type(_x) == unicode:
00196 _x = _x.encode('utf-8')
00197 length = len(_x)
00198 buff.write(struct.pack('<I%ss'%length, length, _x))
00199 _x = self
00200 buff.write(_struct_2I.pack(_x.image_in.height, _x.image_in.width))
00201 _x = self.image_in.encoding
00202 length = len(_x)
00203 if python3 or type(_x) == unicode:
00204 _x = _x.encode('utf-8')
00205 length = len(_x)
00206 buff.write(struct.pack('<I%ss'%length, length, _x))
00207 _x = self
00208 buff.write(_struct_BI.pack(_x.image_in.is_bigendian, _x.image_in.step))
00209 _x = self.image_in.data
00210 length = len(_x)
00211
00212 if type(_x) in [list, tuple]:
00213 buff.write(struct.pack('<I%sB'%length, length, *_x))
00214 else:
00215 buff.write(struct.pack('<I%ss'%length, length, _x))
00216 except struct.error as se: self._check_types(se)
00217 except TypeError as te: self._check_types(te)
00218
00219 def deserialize_numpy(self, str, numpy):
00220 """
00221 unpack serialized message in str into this message instance using numpy for array types
00222 :param str: byte array of serialized message, ``str``
00223 :param numpy: numpy python module
00224 """
00225 try:
00226 if self.image_in is None:
00227 self.image_in = sensor_msgs.msg.Image()
00228 end = 0
00229 _x = self
00230 start = end
00231 end += 12
00232 (_x.image_in.header.seq, _x.image_in.header.stamp.secs, _x.image_in.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00233 start = end
00234 end += 4
00235 (length,) = _struct_I.unpack(str[start:end])
00236 start = end
00237 end += length
00238 if python3:
00239 self.image_in.header.frame_id = str[start:end].decode('utf-8')
00240 else:
00241 self.image_in.header.frame_id = str[start:end]
00242 _x = self
00243 start = end
00244 end += 8
00245 (_x.image_in.height, _x.image_in.width,) = _struct_2I.unpack(str[start:end])
00246 start = end
00247 end += 4
00248 (length,) = _struct_I.unpack(str[start:end])
00249 start = end
00250 end += length
00251 if python3:
00252 self.image_in.encoding = str[start:end].decode('utf-8')
00253 else:
00254 self.image_in.encoding = str[start:end]
00255 _x = self
00256 start = end
00257 end += 5
00258 (_x.image_in.is_bigendian, _x.image_in.step,) = _struct_BI.unpack(str[start:end])
00259 start = end
00260 end += 4
00261 (length,) = _struct_I.unpack(str[start:end])
00262 start = end
00263 end += length
00264 if python3:
00265 self.image_in.data = str[start:end].decode('utf-8')
00266 else:
00267 self.image_in.data = str[start:end]
00268 return self
00269 except struct.error as e:
00270 raise genpy.DeserializationError(e)
00271
00272 _struct_I = genpy.struct_I
00273 _struct_3I = struct.Struct("<3I")
00274 _struct_2I = struct.Struct("<2I")
00275 _struct_BI = struct.Struct("<BI")
00276 """autogenerated by genpy from iri_perception_msgs/SetImageResponse.msg. Do not edit."""
00277 import sys
00278 python3 = True if sys.hexversion > 0x03000000 else False
00279 import genpy
00280 import struct
00281
00282
00283 class SetImageResponse(genpy.Message):
00284 _md5sum = "358e233cde0c8a8bcfea4ce193f8fc15"
00285 _type = "iri_perception_msgs/SetImageResponse"
00286 _has_header = False
00287 _full_text = """
00288 bool success
00289
00290
00291 """
00292 __slots__ = ['success']
00293 _slot_types = ['bool']
00294
00295 def __init__(self, *args, **kwds):
00296 """
00297 Constructor. Any message fields that are implicitly/explicitly
00298 set to None will be assigned a default value. The recommend
00299 use is keyword arguments as this is more robust to future message
00300 changes. You cannot mix in-order arguments and keyword arguments.
00301
00302 The available fields are:
00303 success
00304
00305 :param args: complete set of field values, in .msg order
00306 :param kwds: use keyword arguments corresponding to message field names
00307 to set specific fields.
00308 """
00309 if args or kwds:
00310 super(SetImageResponse, self).__init__(*args, **kwds)
00311
00312 if self.success is None:
00313 self.success = False
00314 else:
00315 self.success = False
00316
00317 def _get_types(self):
00318 """
00319 internal API method
00320 """
00321 return self._slot_types
00322
00323 def serialize(self, buff):
00324 """
00325 serialize message into buffer
00326 :param buff: buffer, ``StringIO``
00327 """
00328 try:
00329 buff.write(_struct_B.pack(self.success))
00330 except struct.error as se: self._check_types(se)
00331 except TypeError as te: self._check_types(te)
00332
00333 def deserialize(self, str):
00334 """
00335 unpack serialized message in str into this message instance
00336 :param str: byte array of serialized message, ``str``
00337 """
00338 try:
00339 end = 0
00340 start = end
00341 end += 1
00342 (self.success,) = _struct_B.unpack(str[start:end])
00343 self.success = bool(self.success)
00344 return self
00345 except struct.error as e:
00346 raise genpy.DeserializationError(e)
00347
00348
00349 def serialize_numpy(self, buff, numpy):
00350 """
00351 serialize message with numpy array types into buffer
00352 :param buff: buffer, ``StringIO``
00353 :param numpy: numpy python module
00354 """
00355 try:
00356 buff.write(_struct_B.pack(self.success))
00357 except struct.error as se: self._check_types(se)
00358 except TypeError as te: self._check_types(te)
00359
00360 def deserialize_numpy(self, str, numpy):
00361 """
00362 unpack serialized message in str into this message instance using numpy for array types
00363 :param str: byte array of serialized message, ``str``
00364 :param numpy: numpy python module
00365 """
00366 try:
00367 end = 0
00368 start = end
00369 end += 1
00370 (self.success,) = _struct_B.unpack(str[start:end])
00371 self.success = bool(self.success)
00372 return self
00373 except struct.error as e:
00374 raise genpy.DeserializationError(e)
00375
00376 _struct_I = genpy.struct_I
00377 _struct_B = struct.Struct("<B")
00378 class SetImage(object):
00379 _type = 'iri_perception_msgs/SetImage'
00380 _md5sum = '3c9d3f37fa6b00d25eaac8ccbaa373ab'
00381 _request_class = SetImageRequest
00382 _response_class = SetImageResponse