00001 """autogenerated by genpy from jsk_perception/WhiteBalanceRequest.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 WhiteBalanceRequest(genpy.Message):
00011 _md5sum = "d7702dac51626a53e0806ebd0ad35ca3"
00012 _type = "jsk_perception/WhiteBalanceRequest"
00013 _has_header = False
00014 _full_text = """float32[3] reference_color
00015 sensor_msgs/Image input
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__ = ['reference_color','input']
00067 _slot_types = ['float32[3]','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 reference_color,input
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(WhiteBalanceRequest, self).__init__(*args, **kwds)
00085
00086 if self.reference_color is None:
00087 self.reference_color = [0.,0.,0.]
00088 if self.input is None:
00089 self.input = sensor_msgs.msg.Image()
00090 else:
00091 self.reference_color = [0.,0.,0.]
00092 self.input = sensor_msgs.msg.Image()
00093
00094 def _get_types(self):
00095 """
00096 internal API method
00097 """
00098 return self._slot_types
00099
00100 def serialize(self, buff):
00101 """
00102 serialize message into buffer
00103 :param buff: buffer, ``StringIO``
00104 """
00105 try:
00106 buff.write(_struct_3f.pack(*self.reference_color))
00107 _x = self
00108 buff.write(_struct_3I.pack(_x.input.header.seq, _x.input.header.stamp.secs, _x.input.header.stamp.nsecs))
00109 _x = self.input.header.frame_id
00110 length = len(_x)
00111 if python3 or type(_x) == unicode:
00112 _x = _x.encode('utf-8')
00113 length = len(_x)
00114 buff.write(struct.pack('<I%ss'%length, length, _x))
00115 _x = self
00116 buff.write(_struct_2I.pack(_x.input.height, _x.input.width))
00117 _x = self.input.encoding
00118 length = len(_x)
00119 if python3 or type(_x) == unicode:
00120 _x = _x.encode('utf-8')
00121 length = len(_x)
00122 buff.write(struct.pack('<I%ss'%length, length, _x))
00123 _x = self
00124 buff.write(_struct_BI.pack(_x.input.is_bigendian, _x.input.step))
00125 _x = self.input.data
00126 length = len(_x)
00127
00128 if type(_x) in [list, tuple]:
00129 buff.write(struct.pack('<I%sB'%length, length, *_x))
00130 else:
00131 buff.write(struct.pack('<I%ss'%length, length, _x))
00132 except struct.error as se: self._check_types(se)
00133 except TypeError as te: self._check_types(te)
00134
00135 def deserialize(self, str):
00136 """
00137 unpack serialized message in str into this message instance
00138 :param str: byte array of serialized message, ``str``
00139 """
00140 try:
00141 if self.input is None:
00142 self.input = sensor_msgs.msg.Image()
00143 end = 0
00144 start = end
00145 end += 12
00146 self.reference_color = _struct_3f.unpack(str[start:end])
00147 _x = self
00148 start = end
00149 end += 12
00150 (_x.input.header.seq, _x.input.header.stamp.secs, _x.input.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00151 start = end
00152 end += 4
00153 (length,) = _struct_I.unpack(str[start:end])
00154 start = end
00155 end += length
00156 if python3:
00157 self.input.header.frame_id = str[start:end].decode('utf-8')
00158 else:
00159 self.input.header.frame_id = str[start:end]
00160 _x = self
00161 start = end
00162 end += 8
00163 (_x.input.height, _x.input.width,) = _struct_2I.unpack(str[start:end])
00164 start = end
00165 end += 4
00166 (length,) = _struct_I.unpack(str[start:end])
00167 start = end
00168 end += length
00169 if python3:
00170 self.input.encoding = str[start:end].decode('utf-8')
00171 else:
00172 self.input.encoding = str[start:end]
00173 _x = self
00174 start = end
00175 end += 5
00176 (_x.input.is_bigendian, _x.input.step,) = _struct_BI.unpack(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.input.data = str[start:end].decode('utf-8')
00184 else:
00185 self.input.data = str[start:end]
00186 return self
00187 except struct.error as e:
00188 raise genpy.DeserializationError(e)
00189
00190
00191 def serialize_numpy(self, buff, numpy):
00192 """
00193 serialize message with numpy array types into buffer
00194 :param buff: buffer, ``StringIO``
00195 :param numpy: numpy python module
00196 """
00197 try:
00198 buff.write(self.reference_color.tostring())
00199 _x = self
00200 buff.write(_struct_3I.pack(_x.input.header.seq, _x.input.header.stamp.secs, _x.input.header.stamp.nsecs))
00201 _x = self.input.header.frame_id
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_2I.pack(_x.input.height, _x.input.width))
00209 _x = self.input.encoding
00210 length = len(_x)
00211 if python3 or type(_x) == unicode:
00212 _x = _x.encode('utf-8')
00213 length = len(_x)
00214 buff.write(struct.pack('<I%ss'%length, length, _x))
00215 _x = self
00216 buff.write(_struct_BI.pack(_x.input.is_bigendian, _x.input.step))
00217 _x = self.input.data
00218 length = len(_x)
00219
00220 if type(_x) in [list, tuple]:
00221 buff.write(struct.pack('<I%sB'%length, length, *_x))
00222 else:
00223 buff.write(struct.pack('<I%ss'%length, length, _x))
00224 except struct.error as se: self._check_types(se)
00225 except TypeError as te: self._check_types(te)
00226
00227 def deserialize_numpy(self, str, numpy):
00228 """
00229 unpack serialized message in str into this message instance using numpy for array types
00230 :param str: byte array of serialized message, ``str``
00231 :param numpy: numpy python module
00232 """
00233 try:
00234 if self.input is None:
00235 self.input = sensor_msgs.msg.Image()
00236 end = 0
00237 start = end
00238 end += 12
00239 self.reference_color = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=3)
00240 _x = self
00241 start = end
00242 end += 12
00243 (_x.input.header.seq, _x.input.header.stamp.secs, _x.input.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00244 start = end
00245 end += 4
00246 (length,) = _struct_I.unpack(str[start:end])
00247 start = end
00248 end += length
00249 if python3:
00250 self.input.header.frame_id = str[start:end].decode('utf-8')
00251 else:
00252 self.input.header.frame_id = str[start:end]
00253 _x = self
00254 start = end
00255 end += 8
00256 (_x.input.height, _x.input.width,) = _struct_2I.unpack(str[start:end])
00257 start = end
00258 end += 4
00259 (length,) = _struct_I.unpack(str[start:end])
00260 start = end
00261 end += length
00262 if python3:
00263 self.input.encoding = str[start:end].decode('utf-8')
00264 else:
00265 self.input.encoding = str[start:end]
00266 _x = self
00267 start = end
00268 end += 5
00269 (_x.input.is_bigendian, _x.input.step,) = _struct_BI.unpack(str[start:end])
00270 start = end
00271 end += 4
00272 (length,) = _struct_I.unpack(str[start:end])
00273 start = end
00274 end += length
00275 if python3:
00276 self.input.data = str[start:end].decode('utf-8')
00277 else:
00278 self.input.data = str[start:end]
00279 return self
00280 except struct.error as e:
00281 raise genpy.DeserializationError(e)
00282
00283 _struct_I = genpy.struct_I
00284 _struct_3I = struct.Struct("<3I")
00285 _struct_BI = struct.Struct("<BI")
00286 _struct_3f = struct.Struct("<3f")
00287 _struct_2I = struct.Struct("<2I")
00288 """autogenerated by genpy from jsk_perception/WhiteBalanceResponse.msg. Do not edit."""
00289 import sys
00290 python3 = True if sys.hexversion > 0x03000000 else False
00291 import genpy
00292 import struct
00293
00294 import std_msgs.msg
00295 import sensor_msgs.msg
00296
00297 class WhiteBalanceResponse(genpy.Message):
00298 _md5sum = "8eeb6eb8777baa5a80bbc676c219bfef"
00299 _type = "jsk_perception/WhiteBalanceResponse"
00300 _has_header = False
00301 _full_text = """sensor_msgs/Image output
00302
00303
00304 ================================================================================
00305 MSG: sensor_msgs/Image
00306 # This message contains an uncompressed image
00307 # (0, 0) is at top-left corner of image
00308 #
00309
00310 Header header # Header timestamp should be acquisition time of image
00311 # Header frame_id should be optical frame of camera
00312 # origin of frame should be optical center of cameara
00313 # +x should point to the right in the image
00314 # +y should point down in the image
00315 # +z should point into to plane of the image
00316 # If the frame_id here and the frame_id of the CameraInfo
00317 # message associated with the image conflict
00318 # the behavior is undefined
00319
00320 uint32 height # image height, that is, number of rows
00321 uint32 width # image width, that is, number of columns
00322
00323 # The legal values for encoding are in file src/image_encodings.cpp
00324 # If you want to standardize a new string format, join
00325 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00326
00327 string encoding # Encoding of pixels -- channel meaning, ordering, size
00328 # taken from the list of strings in src/image_encodings.cpp
00329
00330 uint8 is_bigendian # is this data bigendian?
00331 uint32 step # Full row length in bytes
00332 uint8[] data # actual matrix data, size is (step * rows)
00333
00334 ================================================================================
00335 MSG: std_msgs/Header
00336 # Standard metadata for higher-level stamped data types.
00337 # This is generally used to communicate timestamped data
00338 # in a particular coordinate frame.
00339 #
00340 # sequence ID: consecutively increasing ID
00341 uint32 seq
00342 #Two-integer timestamp that is expressed as:
00343 # * stamp.secs: seconds (stamp_secs) since epoch
00344 # * stamp.nsecs: nanoseconds since stamp_secs
00345 # time-handling sugar is provided by the client library
00346 time stamp
00347 #Frame this data is associated with
00348 # 0: no frame
00349 # 1: global frame
00350 string frame_id
00351
00352 """
00353 __slots__ = ['output']
00354 _slot_types = ['sensor_msgs/Image']
00355
00356 def __init__(self, *args, **kwds):
00357 """
00358 Constructor. Any message fields that are implicitly/explicitly
00359 set to None will be assigned a default value. The recommend
00360 use is keyword arguments as this is more robust to future message
00361 changes. You cannot mix in-order arguments and keyword arguments.
00362
00363 The available fields are:
00364 output
00365
00366 :param args: complete set of field values, in .msg order
00367 :param kwds: use keyword arguments corresponding to message field names
00368 to set specific fields.
00369 """
00370 if args or kwds:
00371 super(WhiteBalanceResponse, self).__init__(*args, **kwds)
00372
00373 if self.output is None:
00374 self.output = sensor_msgs.msg.Image()
00375 else:
00376 self.output = sensor_msgs.msg.Image()
00377
00378 def _get_types(self):
00379 """
00380 internal API method
00381 """
00382 return self._slot_types
00383
00384 def serialize(self, buff):
00385 """
00386 serialize message into buffer
00387 :param buff: buffer, ``StringIO``
00388 """
00389 try:
00390 _x = self
00391 buff.write(_struct_3I.pack(_x.output.header.seq, _x.output.header.stamp.secs, _x.output.header.stamp.nsecs))
00392 _x = self.output.header.frame_id
00393 length = len(_x)
00394 if python3 or type(_x) == unicode:
00395 _x = _x.encode('utf-8')
00396 length = len(_x)
00397 buff.write(struct.pack('<I%ss'%length, length, _x))
00398 _x = self
00399 buff.write(_struct_2I.pack(_x.output.height, _x.output.width))
00400 _x = self.output.encoding
00401 length = len(_x)
00402 if python3 or type(_x) == unicode:
00403 _x = _x.encode('utf-8')
00404 length = len(_x)
00405 buff.write(struct.pack('<I%ss'%length, length, _x))
00406 _x = self
00407 buff.write(_struct_BI.pack(_x.output.is_bigendian, _x.output.step))
00408 _x = self.output.data
00409 length = len(_x)
00410
00411 if type(_x) in [list, tuple]:
00412 buff.write(struct.pack('<I%sB'%length, length, *_x))
00413 else:
00414 buff.write(struct.pack('<I%ss'%length, length, _x))
00415 except struct.error as se: self._check_types(se)
00416 except TypeError as te: self._check_types(te)
00417
00418 def deserialize(self, str):
00419 """
00420 unpack serialized message in str into this message instance
00421 :param str: byte array of serialized message, ``str``
00422 """
00423 try:
00424 if self.output is None:
00425 self.output = sensor_msgs.msg.Image()
00426 end = 0
00427 _x = self
00428 start = end
00429 end += 12
00430 (_x.output.header.seq, _x.output.header.stamp.secs, _x.output.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00431 start = end
00432 end += 4
00433 (length,) = _struct_I.unpack(str[start:end])
00434 start = end
00435 end += length
00436 if python3:
00437 self.output.header.frame_id = str[start:end].decode('utf-8')
00438 else:
00439 self.output.header.frame_id = str[start:end]
00440 _x = self
00441 start = end
00442 end += 8
00443 (_x.output.height, _x.output.width,) = _struct_2I.unpack(str[start:end])
00444 start = end
00445 end += 4
00446 (length,) = _struct_I.unpack(str[start:end])
00447 start = end
00448 end += length
00449 if python3:
00450 self.output.encoding = str[start:end].decode('utf-8')
00451 else:
00452 self.output.encoding = str[start:end]
00453 _x = self
00454 start = end
00455 end += 5
00456 (_x.output.is_bigendian, _x.output.step,) = _struct_BI.unpack(str[start:end])
00457 start = end
00458 end += 4
00459 (length,) = _struct_I.unpack(str[start:end])
00460 start = end
00461 end += length
00462 if python3:
00463 self.output.data = str[start:end].decode('utf-8')
00464 else:
00465 self.output.data = str[start:end]
00466 return self
00467 except struct.error as e:
00468 raise genpy.DeserializationError(e)
00469
00470
00471 def serialize_numpy(self, buff, numpy):
00472 """
00473 serialize message with numpy array types into buffer
00474 :param buff: buffer, ``StringIO``
00475 :param numpy: numpy python module
00476 """
00477 try:
00478 _x = self
00479 buff.write(_struct_3I.pack(_x.output.header.seq, _x.output.header.stamp.secs, _x.output.header.stamp.nsecs))
00480 _x = self.output.header.frame_id
00481 length = len(_x)
00482 if python3 or type(_x) == unicode:
00483 _x = _x.encode('utf-8')
00484 length = len(_x)
00485 buff.write(struct.pack('<I%ss'%length, length, _x))
00486 _x = self
00487 buff.write(_struct_2I.pack(_x.output.height, _x.output.width))
00488 _x = self.output.encoding
00489 length = len(_x)
00490 if python3 or type(_x) == unicode:
00491 _x = _x.encode('utf-8')
00492 length = len(_x)
00493 buff.write(struct.pack('<I%ss'%length, length, _x))
00494 _x = self
00495 buff.write(_struct_BI.pack(_x.output.is_bigendian, _x.output.step))
00496 _x = self.output.data
00497 length = len(_x)
00498
00499 if type(_x) in [list, tuple]:
00500 buff.write(struct.pack('<I%sB'%length, length, *_x))
00501 else:
00502 buff.write(struct.pack('<I%ss'%length, length, _x))
00503 except struct.error as se: self._check_types(se)
00504 except TypeError as te: self._check_types(te)
00505
00506 def deserialize_numpy(self, str, numpy):
00507 """
00508 unpack serialized message in str into this message instance using numpy for array types
00509 :param str: byte array of serialized message, ``str``
00510 :param numpy: numpy python module
00511 """
00512 try:
00513 if self.output is None:
00514 self.output = sensor_msgs.msg.Image()
00515 end = 0
00516 _x = self
00517 start = end
00518 end += 12
00519 (_x.output.header.seq, _x.output.header.stamp.secs, _x.output.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00520 start = end
00521 end += 4
00522 (length,) = _struct_I.unpack(str[start:end])
00523 start = end
00524 end += length
00525 if python3:
00526 self.output.header.frame_id = str[start:end].decode('utf-8')
00527 else:
00528 self.output.header.frame_id = str[start:end]
00529 _x = self
00530 start = end
00531 end += 8
00532 (_x.output.height, _x.output.width,) = _struct_2I.unpack(str[start:end])
00533 start = end
00534 end += 4
00535 (length,) = _struct_I.unpack(str[start:end])
00536 start = end
00537 end += length
00538 if python3:
00539 self.output.encoding = str[start:end].decode('utf-8')
00540 else:
00541 self.output.encoding = str[start:end]
00542 _x = self
00543 start = end
00544 end += 5
00545 (_x.output.is_bigendian, _x.output.step,) = _struct_BI.unpack(str[start:end])
00546 start = end
00547 end += 4
00548 (length,) = _struct_I.unpack(str[start:end])
00549 start = end
00550 end += length
00551 if python3:
00552 self.output.data = str[start:end].decode('utf-8')
00553 else:
00554 self.output.data = str[start:end]
00555 return self
00556 except struct.error as e:
00557 raise genpy.DeserializationError(e)
00558
00559 _struct_I = genpy.struct_I
00560 _struct_3I = struct.Struct("<3I")
00561 _struct_2I = struct.Struct("<2I")
00562 _struct_BI = struct.Struct("<BI")
00563 class WhiteBalance(object):
00564 _type = 'jsk_perception/WhiteBalance'
00565 _md5sum = 'a35c8b952e94474b5303dc3a82ca7672'
00566 _request_class = WhiteBalanceRequest
00567 _response_class = WhiteBalanceResponse