00001 """autogenerated by genpy from checkerboard_detector2/DetectRequest.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 DetectRequest(genpy.Message):
00011 _md5sum = "bfee1901edaf2aa4d9f0844a03ff634f"
00012 _type = "checkerboard_detector2/DetectRequest"
00013 _has_header = False
00014 _full_text = """
00015 sensor_msgs/Image image
00016 sensor_msgs/CameraInfo camera_info
00017
00018 ================================================================================
00019 MSG: sensor_msgs/Image
00020 # This message contains an uncompressed image
00021 # (0, 0) is at top-left corner of image
00022 #
00023
00024 Header header # Header timestamp should be acquisition time of image
00025 # Header frame_id should be optical frame of camera
00026 # origin of frame should be optical center of cameara
00027 # +x should point to the right in the image
00028 # +y should point down in the image
00029 # +z should point into to plane of the image
00030 # If the frame_id here and the frame_id of the CameraInfo
00031 # message associated with the image conflict
00032 # the behavior is undefined
00033
00034 uint32 height # image height, that is, number of rows
00035 uint32 width # image width, that is, number of columns
00036
00037 # The legal values for encoding are in file src/image_encodings.cpp
00038 # If you want to standardize a new string format, join
00039 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00040
00041 string encoding # Encoding of pixels -- channel meaning, ordering, size
00042 # taken from the list of strings in src/image_encodings.cpp
00043
00044 uint8 is_bigendian # is this data bigendian?
00045 uint32 step # Full row length in bytes
00046 uint8[] data # actual matrix data, size is (step * rows)
00047
00048 ================================================================================
00049 MSG: std_msgs/Header
00050 # Standard metadata for higher-level stamped data types.
00051 # This is generally used to communicate timestamped data
00052 # in a particular coordinate frame.
00053 #
00054 # sequence ID: consecutively increasing ID
00055 uint32 seq
00056 #Two-integer timestamp that is expressed as:
00057 # * stamp.secs: seconds (stamp_secs) since epoch
00058 # * stamp.nsecs: nanoseconds since stamp_secs
00059 # time-handling sugar is provided by the client library
00060 time stamp
00061 #Frame this data is associated with
00062 # 0: no frame
00063 # 1: global frame
00064 string frame_id
00065
00066 ================================================================================
00067 MSG: sensor_msgs/CameraInfo
00068 # This message defines meta information for a camera. It should be in a
00069 # camera namespace on topic "camera_info" and accompanied by up to five
00070 # image topics named:
00071 #
00072 # image_raw - raw data from the camera driver, possibly Bayer encoded
00073 # image - monochrome, distorted
00074 # image_color - color, distorted
00075 # image_rect - monochrome, rectified
00076 # image_rect_color - color, rectified
00077 #
00078 # The image_pipeline contains packages (image_proc, stereo_image_proc)
00079 # for producing the four processed image topics from image_raw and
00080 # camera_info. The meaning of the camera parameters are described in
00081 # detail at http://www.ros.org/wiki/image_pipeline/CameraInfo.
00082 #
00083 # The image_geometry package provides a user-friendly interface to
00084 # common operations using this meta information. If you want to, e.g.,
00085 # project a 3d point into image coordinates, we strongly recommend
00086 # using image_geometry.
00087 #
00088 # If the camera is uncalibrated, the matrices D, K, R, P should be left
00089 # zeroed out. In particular, clients may assume that K[0] == 0.0
00090 # indicates an uncalibrated camera.
00091
00092 #######################################################################
00093 # Image acquisition info #
00094 #######################################################################
00095
00096 # Time of image acquisition, camera coordinate frame ID
00097 Header header # Header timestamp should be acquisition time of image
00098 # Header frame_id should be optical frame of camera
00099 # origin of frame should be optical center of camera
00100 # +x should point to the right in the image
00101 # +y should point down in the image
00102 # +z should point into the plane of the image
00103
00104
00105 #######################################################################
00106 # Calibration Parameters #
00107 #######################################################################
00108 # These are fixed during camera calibration. Their values will be the #
00109 # same in all messages until the camera is recalibrated. Note that #
00110 # self-calibrating systems may "recalibrate" frequently. #
00111 # #
00112 # The internal parameters can be used to warp a raw (distorted) image #
00113 # to: #
00114 # 1. An undistorted image (requires D and K) #
00115 # 2. A rectified image (requires D, K, R) #
00116 # The projection matrix P projects 3D points into the rectified image.#
00117 #######################################################################
00118
00119 # The image dimensions with which the camera was calibrated. Normally
00120 # this will be the full camera resolution in pixels.
00121 uint32 height
00122 uint32 width
00123
00124 # The distortion model used. Supported models are listed in
00125 # sensor_msgs/distortion_models.h. For most cameras, "plumb_bob" - a
00126 # simple model of radial and tangential distortion - is sufficent.
00127 string distortion_model
00128
00129 # The distortion parameters, size depending on the distortion model.
00130 # For "plumb_bob", the 5 parameters are: (k1, k2, t1, t2, k3).
00131 float64[] D
00132
00133 # Intrinsic camera matrix for the raw (distorted) images.
00134 # [fx 0 cx]
00135 # K = [ 0 fy cy]
00136 # [ 0 0 1]
00137 # Projects 3D points in the camera coordinate frame to 2D pixel
00138 # coordinates using the focal lengths (fx, fy) and principal point
00139 # (cx, cy).
00140 float64[9] K # 3x3 row-major matrix
00141
00142 # Rectification matrix (stereo cameras only)
00143 # A rotation matrix aligning the camera coordinate system to the ideal
00144 # stereo image plane so that epipolar lines in both stereo images are
00145 # parallel.
00146 float64[9] R # 3x3 row-major matrix
00147
00148 # Projection/camera matrix
00149 # [fx' 0 cx' Tx]
00150 # P = [ 0 fy' cy' Ty]
00151 # [ 0 0 1 0]
00152 # By convention, this matrix specifies the intrinsic (camera) matrix
00153 # of the processed (rectified) image. That is, the left 3x3 portion
00154 # is the normal camera intrinsic matrix for the rectified image.
00155 # It projects 3D points in the camera coordinate frame to 2D pixel
00156 # coordinates using the focal lengths (fx', fy') and principal point
00157 # (cx', cy') - these may differ from the values in K.
00158 # For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will
00159 # also have R = the identity and P[1:3,1:3] = K.
00160 # For a stereo pair, the fourth column [Tx Ty 0]' is related to the
00161 # position of the optical center of the second camera in the first
00162 # camera's frame. We assume Tz = 0 so both cameras are in the same
00163 # stereo image plane. The first camera always has Tx = Ty = 0. For
00164 # the right (second) camera of a horizontal stereo pair, Ty = 0 and
00165 # Tx = -fx' * B, where B is the baseline between the cameras.
00166 # Given a 3D point [X Y Z]', the projection (x, y) of the point onto
00167 # the rectified image is given by:
00168 # [u v w]' = P * [X Y Z 1]'
00169 # x = u / w
00170 # y = v / w
00171 # This holds for both images of a stereo pair.
00172 float64[12] P # 3x4 row-major matrix
00173
00174
00175 #######################################################################
00176 # Operational Parameters #
00177 #######################################################################
00178 # These define the image region actually captured by the camera #
00179 # driver. Although they affect the geometry of the output image, they #
00180 # may be changed freely without recalibrating the camera. #
00181 #######################################################################
00182
00183 # Binning refers here to any camera setting which combines rectangular
00184 # neighborhoods of pixels into larger "super-pixels." It reduces the
00185 # resolution of the output image to
00186 # (width / binning_x) x (height / binning_y).
00187 # The default values binning_x = binning_y = 0 is considered the same
00188 # as binning_x = binning_y = 1 (no subsampling).
00189 uint32 binning_x
00190 uint32 binning_y
00191
00192 # Region of interest (subwindow of full camera resolution), given in
00193 # full resolution (unbinned) image coordinates. A particular ROI
00194 # always denotes the same window of pixels on the camera sensor,
00195 # regardless of binning settings.
00196 # The default setting of roi (all values 0) is considered the same as
00197 # full resolution (roi.width = width, roi.height = height).
00198 RegionOfInterest roi
00199
00200 ================================================================================
00201 MSG: sensor_msgs/RegionOfInterest
00202 # This message is used to specify a region of interest within an image.
00203 #
00204 # When used to specify the ROI setting of the camera when the image was
00205 # taken, the height and width fields should either match the height and
00206 # width fields for the associated image; or height = width = 0
00207 # indicates that the full resolution image was captured.
00208
00209 uint32 x_offset # Leftmost pixel of the ROI
00210 # (0 if the ROI includes the left edge of the image)
00211 uint32 y_offset # Topmost pixel of the ROI
00212 # (0 if the ROI includes the top edge of the image)
00213 uint32 height # Height of ROI
00214 uint32 width # Width of ROI
00215
00216 # True if a distinct rectified ROI should be calculated from the "raw"
00217 # ROI in this message. Typically this should be False if the full image
00218 # is captured (ROI not used), and True if a subwindow is captured (ROI
00219 # used).
00220 bool do_rectify
00221
00222 """
00223 __slots__ = ['image','camera_info']
00224 _slot_types = ['sensor_msgs/Image','sensor_msgs/CameraInfo']
00225
00226 def __init__(self, *args, **kwds):
00227 """
00228 Constructor. Any message fields that are implicitly/explicitly
00229 set to None will be assigned a default value. The recommend
00230 use is keyword arguments as this is more robust to future message
00231 changes. You cannot mix in-order arguments and keyword arguments.
00232
00233 The available fields are:
00234 image,camera_info
00235
00236 :param args: complete set of field values, in .msg order
00237 :param kwds: use keyword arguments corresponding to message field names
00238 to set specific fields.
00239 """
00240 if args or kwds:
00241 super(DetectRequest, self).__init__(*args, **kwds)
00242
00243 if self.image is None:
00244 self.image = sensor_msgs.msg.Image()
00245 if self.camera_info is None:
00246 self.camera_info = sensor_msgs.msg.CameraInfo()
00247 else:
00248 self.image = sensor_msgs.msg.Image()
00249 self.camera_info = sensor_msgs.msg.CameraInfo()
00250
00251 def _get_types(self):
00252 """
00253 internal API method
00254 """
00255 return self._slot_types
00256
00257 def serialize(self, buff):
00258 """
00259 serialize message into buffer
00260 :param buff: buffer, ``StringIO``
00261 """
00262 try:
00263 _x = self
00264 buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00265 _x = self.image.header.frame_id
00266 length = len(_x)
00267 if python3 or type(_x) == unicode:
00268 _x = _x.encode('utf-8')
00269 length = len(_x)
00270 buff.write(struct.pack('<I%ss'%length, length, _x))
00271 _x = self
00272 buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00273 _x = self.image.encoding
00274 length = len(_x)
00275 if python3 or type(_x) == unicode:
00276 _x = _x.encode('utf-8')
00277 length = len(_x)
00278 buff.write(struct.pack('<I%ss'%length, length, _x))
00279 _x = self
00280 buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00281 _x = self.image.data
00282 length = len(_x)
00283
00284 if type(_x) in [list, tuple]:
00285 buff.write(struct.pack('<I%sB'%length, length, *_x))
00286 else:
00287 buff.write(struct.pack('<I%ss'%length, length, _x))
00288 _x = self
00289 buff.write(_struct_3I.pack(_x.camera_info.header.seq, _x.camera_info.header.stamp.secs, _x.camera_info.header.stamp.nsecs))
00290 _x = self.camera_info.header.frame_id
00291 length = len(_x)
00292 if python3 or type(_x) == unicode:
00293 _x = _x.encode('utf-8')
00294 length = len(_x)
00295 buff.write(struct.pack('<I%ss'%length, length, _x))
00296 _x = self
00297 buff.write(_struct_2I.pack(_x.camera_info.height, _x.camera_info.width))
00298 _x = self.camera_info.distortion_model
00299 length = len(_x)
00300 if python3 or type(_x) == unicode:
00301 _x = _x.encode('utf-8')
00302 length = len(_x)
00303 buff.write(struct.pack('<I%ss'%length, length, _x))
00304 length = len(self.camera_info.D)
00305 buff.write(_struct_I.pack(length))
00306 pattern = '<%sd'%length
00307 buff.write(struct.pack(pattern, *self.camera_info.D))
00308 buff.write(_struct_9d.pack(*self.camera_info.K))
00309 buff.write(_struct_9d.pack(*self.camera_info.R))
00310 buff.write(_struct_12d.pack(*self.camera_info.P))
00311 _x = self
00312 buff.write(_struct_6IB.pack(_x.camera_info.binning_x, _x.camera_info.binning_y, _x.camera_info.roi.x_offset, _x.camera_info.roi.y_offset, _x.camera_info.roi.height, _x.camera_info.roi.width, _x.camera_info.roi.do_rectify))
00313 except struct.error as se: self._check_types(se)
00314 except TypeError as te: self._check_types(te)
00315
00316 def deserialize(self, str):
00317 """
00318 unpack serialized message in str into this message instance
00319 :param str: byte array of serialized message, ``str``
00320 """
00321 try:
00322 if self.image is None:
00323 self.image = sensor_msgs.msg.Image()
00324 if self.camera_info is None:
00325 self.camera_info = sensor_msgs.msg.CameraInfo()
00326 end = 0
00327 _x = self
00328 start = end
00329 end += 12
00330 (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00331 start = end
00332 end += 4
00333 (length,) = _struct_I.unpack(str[start:end])
00334 start = end
00335 end += length
00336 if python3:
00337 self.image.header.frame_id = str[start:end].decode('utf-8')
00338 else:
00339 self.image.header.frame_id = str[start:end]
00340 _x = self
00341 start = end
00342 end += 8
00343 (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
00344 start = end
00345 end += 4
00346 (length,) = _struct_I.unpack(str[start:end])
00347 start = end
00348 end += length
00349 if python3:
00350 self.image.encoding = str[start:end].decode('utf-8')
00351 else:
00352 self.image.encoding = str[start:end]
00353 _x = self
00354 start = end
00355 end += 5
00356 (_x.image.is_bigendian, _x.image.step,) = _struct_BI.unpack(str[start:end])
00357 start = end
00358 end += 4
00359 (length,) = _struct_I.unpack(str[start:end])
00360 start = end
00361 end += length
00362 if python3:
00363 self.image.data = str[start:end].decode('utf-8')
00364 else:
00365 self.image.data = str[start:end]
00366 _x = self
00367 start = end
00368 end += 12
00369 (_x.camera_info.header.seq, _x.camera_info.header.stamp.secs, _x.camera_info.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00370 start = end
00371 end += 4
00372 (length,) = _struct_I.unpack(str[start:end])
00373 start = end
00374 end += length
00375 if python3:
00376 self.camera_info.header.frame_id = str[start:end].decode('utf-8')
00377 else:
00378 self.camera_info.header.frame_id = str[start:end]
00379 _x = self
00380 start = end
00381 end += 8
00382 (_x.camera_info.height, _x.camera_info.width,) = _struct_2I.unpack(str[start:end])
00383 start = end
00384 end += 4
00385 (length,) = _struct_I.unpack(str[start:end])
00386 start = end
00387 end += length
00388 if python3:
00389 self.camera_info.distortion_model = str[start:end].decode('utf-8')
00390 else:
00391 self.camera_info.distortion_model = str[start:end]
00392 start = end
00393 end += 4
00394 (length,) = _struct_I.unpack(str[start:end])
00395 pattern = '<%sd'%length
00396 start = end
00397 end += struct.calcsize(pattern)
00398 self.camera_info.D = struct.unpack(pattern, str[start:end])
00399 start = end
00400 end += 72
00401 self.camera_info.K = _struct_9d.unpack(str[start:end])
00402 start = end
00403 end += 72
00404 self.camera_info.R = _struct_9d.unpack(str[start:end])
00405 start = end
00406 end += 96
00407 self.camera_info.P = _struct_12d.unpack(str[start:end])
00408 _x = self
00409 start = end
00410 end += 25
00411 (_x.camera_info.binning_x, _x.camera_info.binning_y, _x.camera_info.roi.x_offset, _x.camera_info.roi.y_offset, _x.camera_info.roi.height, _x.camera_info.roi.width, _x.camera_info.roi.do_rectify,) = _struct_6IB.unpack(str[start:end])
00412 self.camera_info.roi.do_rectify = bool(self.camera_info.roi.do_rectify)
00413 return self
00414 except struct.error as e:
00415 raise genpy.DeserializationError(e)
00416
00417
00418 def serialize_numpy(self, buff, numpy):
00419 """
00420 serialize message with numpy array types into buffer
00421 :param buff: buffer, ``StringIO``
00422 :param numpy: numpy python module
00423 """
00424 try:
00425 _x = self
00426 buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00427 _x = self.image.header.frame_id
00428 length = len(_x)
00429 if python3 or type(_x) == unicode:
00430 _x = _x.encode('utf-8')
00431 length = len(_x)
00432 buff.write(struct.pack('<I%ss'%length, length, _x))
00433 _x = self
00434 buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00435 _x = self.image.encoding
00436 length = len(_x)
00437 if python3 or type(_x) == unicode:
00438 _x = _x.encode('utf-8')
00439 length = len(_x)
00440 buff.write(struct.pack('<I%ss'%length, length, _x))
00441 _x = self
00442 buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00443 _x = self.image.data
00444 length = len(_x)
00445
00446 if type(_x) in [list, tuple]:
00447 buff.write(struct.pack('<I%sB'%length, length, *_x))
00448 else:
00449 buff.write(struct.pack('<I%ss'%length, length, _x))
00450 _x = self
00451 buff.write(_struct_3I.pack(_x.camera_info.header.seq, _x.camera_info.header.stamp.secs, _x.camera_info.header.stamp.nsecs))
00452 _x = self.camera_info.header.frame_id
00453 length = len(_x)
00454 if python3 or type(_x) == unicode:
00455 _x = _x.encode('utf-8')
00456 length = len(_x)
00457 buff.write(struct.pack('<I%ss'%length, length, _x))
00458 _x = self
00459 buff.write(_struct_2I.pack(_x.camera_info.height, _x.camera_info.width))
00460 _x = self.camera_info.distortion_model
00461 length = len(_x)
00462 if python3 or type(_x) == unicode:
00463 _x = _x.encode('utf-8')
00464 length = len(_x)
00465 buff.write(struct.pack('<I%ss'%length, length, _x))
00466 length = len(self.camera_info.D)
00467 buff.write(_struct_I.pack(length))
00468 pattern = '<%sd'%length
00469 buff.write(self.camera_info.D.tostring())
00470 buff.write(self.camera_info.K.tostring())
00471 buff.write(self.camera_info.R.tostring())
00472 buff.write(self.camera_info.P.tostring())
00473 _x = self
00474 buff.write(_struct_6IB.pack(_x.camera_info.binning_x, _x.camera_info.binning_y, _x.camera_info.roi.x_offset, _x.camera_info.roi.y_offset, _x.camera_info.roi.height, _x.camera_info.roi.width, _x.camera_info.roi.do_rectify))
00475 except struct.error as se: self._check_types(se)
00476 except TypeError as te: self._check_types(te)
00477
00478 def deserialize_numpy(self, str, numpy):
00479 """
00480 unpack serialized message in str into this message instance using numpy for array types
00481 :param str: byte array of serialized message, ``str``
00482 :param numpy: numpy python module
00483 """
00484 try:
00485 if self.image is None:
00486 self.image = sensor_msgs.msg.Image()
00487 if self.camera_info is None:
00488 self.camera_info = sensor_msgs.msg.CameraInfo()
00489 end = 0
00490 _x = self
00491 start = end
00492 end += 12
00493 (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00494 start = end
00495 end += 4
00496 (length,) = _struct_I.unpack(str[start:end])
00497 start = end
00498 end += length
00499 if python3:
00500 self.image.header.frame_id = str[start:end].decode('utf-8')
00501 else:
00502 self.image.header.frame_id = str[start:end]
00503 _x = self
00504 start = end
00505 end += 8
00506 (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
00507 start = end
00508 end += 4
00509 (length,) = _struct_I.unpack(str[start:end])
00510 start = end
00511 end += length
00512 if python3:
00513 self.image.encoding = str[start:end].decode('utf-8')
00514 else:
00515 self.image.encoding = str[start:end]
00516 _x = self
00517 start = end
00518 end += 5
00519 (_x.image.is_bigendian, _x.image.step,) = _struct_BI.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.image.data = str[start:end].decode('utf-8')
00527 else:
00528 self.image.data = str[start:end]
00529 _x = self
00530 start = end
00531 end += 12
00532 (_x.camera_info.header.seq, _x.camera_info.header.stamp.secs, _x.camera_info.header.stamp.nsecs,) = _struct_3I.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.camera_info.header.frame_id = str[start:end].decode('utf-8')
00540 else:
00541 self.camera_info.header.frame_id = str[start:end]
00542 _x = self
00543 start = end
00544 end += 8
00545 (_x.camera_info.height, _x.camera_info.width,) = _struct_2I.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.camera_info.distortion_model = str[start:end].decode('utf-8')
00553 else:
00554 self.camera_info.distortion_model = str[start:end]
00555 start = end
00556 end += 4
00557 (length,) = _struct_I.unpack(str[start:end])
00558 pattern = '<%sd'%length
00559 start = end
00560 end += struct.calcsize(pattern)
00561 self.camera_info.D = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00562 start = end
00563 end += 72
00564 self.camera_info.K = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00565 start = end
00566 end += 72
00567 self.camera_info.R = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00568 start = end
00569 end += 96
00570 self.camera_info.P = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=12)
00571 _x = self
00572 start = end
00573 end += 25
00574 (_x.camera_info.binning_x, _x.camera_info.binning_y, _x.camera_info.roi.x_offset, _x.camera_info.roi.y_offset, _x.camera_info.roi.height, _x.camera_info.roi.width, _x.camera_info.roi.do_rectify,) = _struct_6IB.unpack(str[start:end])
00575 self.camera_info.roi.do_rectify = bool(self.camera_info.roi.do_rectify)
00576 return self
00577 except struct.error as e:
00578 raise genpy.DeserializationError(e)
00579
00580 _struct_I = genpy.struct_I
00581 _struct_6IB = struct.Struct("<6IB")
00582 _struct_12d = struct.Struct("<12d")
00583 _struct_9d = struct.Struct("<9d")
00584 _struct_BI = struct.Struct("<BI")
00585 _struct_3I = struct.Struct("<3I")
00586 _struct_2I = struct.Struct("<2I")
00587 """autogenerated by genpy from checkerboard_detector2/DetectResponse.msg. Do not edit."""
00588 import sys
00589 python3 = True if sys.hexversion > 0x03000000 else False
00590 import genpy
00591 import struct
00592
00593 import geometry_msgs.msg
00594 import checkerboard_detector2.msg
00595 import std_msgs.msg
00596
00597 class DetectResponse(genpy.Message):
00598 _md5sum = "fa5565282e26025bb768b1b949144e94"
00599 _type = "checkerboard_detector2/DetectResponse"
00600 _has_header = False
00601 _full_text = """ObjectDetection object_detection
00602
00603
00604 ================================================================================
00605 MSG: checkerboard_detector2/ObjectDetection
00606 Header header
00607 Object6DPose[] objects
00608 # unique image id these objects were taken from
00609
00610 ================================================================================
00611 MSG: std_msgs/Header
00612 # Standard metadata for higher-level stamped data types.
00613 # This is generally used to communicate timestamped data
00614 # in a particular coordinate frame.
00615 #
00616 # sequence ID: consecutively increasing ID
00617 uint32 seq
00618 #Two-integer timestamp that is expressed as:
00619 # * stamp.secs: seconds (stamp_secs) since epoch
00620 # * stamp.nsecs: nanoseconds since stamp_secs
00621 # time-handling sugar is provided by the client library
00622 time stamp
00623 #Frame this data is associated with
00624 # 0: no frame
00625 # 1: global frame
00626 string frame_id
00627
00628 ================================================================================
00629 MSG: checkerboard_detector2/Object6DPose
00630 # 6D pose of object
00631 geometry_msgs/Pose pose
00632
00633 # type of object, usually contains the filename of the object that allows the receiving side to visualize it
00634 # can also be used as a unique type id
00635 string type
00636 uint32 id
00637 ================================================================================
00638 MSG: geometry_msgs/Pose
00639 # A representation of pose in free space, composed of postion and orientation.
00640 Point position
00641 Quaternion orientation
00642
00643 ================================================================================
00644 MSG: geometry_msgs/Point
00645 # This contains the position of a point in free space
00646 float64 x
00647 float64 y
00648 float64 z
00649
00650 ================================================================================
00651 MSG: geometry_msgs/Quaternion
00652 # This represents an orientation in free space in quaternion form.
00653
00654 float64 x
00655 float64 y
00656 float64 z
00657 float64 w
00658
00659 """
00660 __slots__ = ['object_detection']
00661 _slot_types = ['checkerboard_detector2/ObjectDetection']
00662
00663 def __init__(self, *args, **kwds):
00664 """
00665 Constructor. Any message fields that are implicitly/explicitly
00666 set to None will be assigned a default value. The recommend
00667 use is keyword arguments as this is more robust to future message
00668 changes. You cannot mix in-order arguments and keyword arguments.
00669
00670 The available fields are:
00671 object_detection
00672
00673 :param args: complete set of field values, in .msg order
00674 :param kwds: use keyword arguments corresponding to message field names
00675 to set specific fields.
00676 """
00677 if args or kwds:
00678 super(DetectResponse, self).__init__(*args, **kwds)
00679
00680 if self.object_detection is None:
00681 self.object_detection = checkerboard_detector2.msg.ObjectDetection()
00682 else:
00683 self.object_detection = checkerboard_detector2.msg.ObjectDetection()
00684
00685 def _get_types(self):
00686 """
00687 internal API method
00688 """
00689 return self._slot_types
00690
00691 def serialize(self, buff):
00692 """
00693 serialize message into buffer
00694 :param buff: buffer, ``StringIO``
00695 """
00696 try:
00697 _x = self
00698 buff.write(_struct_3I.pack(_x.object_detection.header.seq, _x.object_detection.header.stamp.secs, _x.object_detection.header.stamp.nsecs))
00699 _x = self.object_detection.header.frame_id
00700 length = len(_x)
00701 if python3 or type(_x) == unicode:
00702 _x = _x.encode('utf-8')
00703 length = len(_x)
00704 buff.write(struct.pack('<I%ss'%length, length, _x))
00705 length = len(self.object_detection.objects)
00706 buff.write(_struct_I.pack(length))
00707 for val1 in self.object_detection.objects:
00708 _v1 = val1.pose
00709 _v2 = _v1.position
00710 _x = _v2
00711 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00712 _v3 = _v1.orientation
00713 _x = _v3
00714 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00715 _x = val1.type
00716 length = len(_x)
00717 if python3 or type(_x) == unicode:
00718 _x = _x.encode('utf-8')
00719 length = len(_x)
00720 buff.write(struct.pack('<I%ss'%length, length, _x))
00721 buff.write(_struct_I.pack(val1.id))
00722 except struct.error as se: self._check_types(se)
00723 except TypeError as te: self._check_types(te)
00724
00725 def deserialize(self, str):
00726 """
00727 unpack serialized message in str into this message instance
00728 :param str: byte array of serialized message, ``str``
00729 """
00730 try:
00731 if self.object_detection is None:
00732 self.object_detection = checkerboard_detector2.msg.ObjectDetection()
00733 end = 0
00734 _x = self
00735 start = end
00736 end += 12
00737 (_x.object_detection.header.seq, _x.object_detection.header.stamp.secs, _x.object_detection.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00738 start = end
00739 end += 4
00740 (length,) = _struct_I.unpack(str[start:end])
00741 start = end
00742 end += length
00743 if python3:
00744 self.object_detection.header.frame_id = str[start:end].decode('utf-8')
00745 else:
00746 self.object_detection.header.frame_id = str[start:end]
00747 start = end
00748 end += 4
00749 (length,) = _struct_I.unpack(str[start:end])
00750 self.object_detection.objects = []
00751 for i in range(0, length):
00752 val1 = checkerboard_detector2.msg.Object6DPose()
00753 _v4 = val1.pose
00754 _v5 = _v4.position
00755 _x = _v5
00756 start = end
00757 end += 24
00758 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00759 _v6 = _v4.orientation
00760 _x = _v6
00761 start = end
00762 end += 32
00763 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00764 start = end
00765 end += 4
00766 (length,) = _struct_I.unpack(str[start:end])
00767 start = end
00768 end += length
00769 if python3:
00770 val1.type = str[start:end].decode('utf-8')
00771 else:
00772 val1.type = str[start:end]
00773 start = end
00774 end += 4
00775 (val1.id,) = _struct_I.unpack(str[start:end])
00776 self.object_detection.objects.append(val1)
00777 return self
00778 except struct.error as e:
00779 raise genpy.DeserializationError(e)
00780
00781
00782 def serialize_numpy(self, buff, numpy):
00783 """
00784 serialize message with numpy array types into buffer
00785 :param buff: buffer, ``StringIO``
00786 :param numpy: numpy python module
00787 """
00788 try:
00789 _x = self
00790 buff.write(_struct_3I.pack(_x.object_detection.header.seq, _x.object_detection.header.stamp.secs, _x.object_detection.header.stamp.nsecs))
00791 _x = self.object_detection.header.frame_id
00792 length = len(_x)
00793 if python3 or type(_x) == unicode:
00794 _x = _x.encode('utf-8')
00795 length = len(_x)
00796 buff.write(struct.pack('<I%ss'%length, length, _x))
00797 length = len(self.object_detection.objects)
00798 buff.write(_struct_I.pack(length))
00799 for val1 in self.object_detection.objects:
00800 _v7 = val1.pose
00801 _v8 = _v7.position
00802 _x = _v8
00803 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00804 _v9 = _v7.orientation
00805 _x = _v9
00806 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00807 _x = val1.type
00808 length = len(_x)
00809 if python3 or type(_x) == unicode:
00810 _x = _x.encode('utf-8')
00811 length = len(_x)
00812 buff.write(struct.pack('<I%ss'%length, length, _x))
00813 buff.write(_struct_I.pack(val1.id))
00814 except struct.error as se: self._check_types(se)
00815 except TypeError as te: self._check_types(te)
00816
00817 def deserialize_numpy(self, str, numpy):
00818 """
00819 unpack serialized message in str into this message instance using numpy for array types
00820 :param str: byte array of serialized message, ``str``
00821 :param numpy: numpy python module
00822 """
00823 try:
00824 if self.object_detection is None:
00825 self.object_detection = checkerboard_detector2.msg.ObjectDetection()
00826 end = 0
00827 _x = self
00828 start = end
00829 end += 12
00830 (_x.object_detection.header.seq, _x.object_detection.header.stamp.secs, _x.object_detection.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00831 start = end
00832 end += 4
00833 (length,) = _struct_I.unpack(str[start:end])
00834 start = end
00835 end += length
00836 if python3:
00837 self.object_detection.header.frame_id = str[start:end].decode('utf-8')
00838 else:
00839 self.object_detection.header.frame_id = str[start:end]
00840 start = end
00841 end += 4
00842 (length,) = _struct_I.unpack(str[start:end])
00843 self.object_detection.objects = []
00844 for i in range(0, length):
00845 val1 = checkerboard_detector2.msg.Object6DPose()
00846 _v10 = val1.pose
00847 _v11 = _v10.position
00848 _x = _v11
00849 start = end
00850 end += 24
00851 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00852 _v12 = _v10.orientation
00853 _x = _v12
00854 start = end
00855 end += 32
00856 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00857 start = end
00858 end += 4
00859 (length,) = _struct_I.unpack(str[start:end])
00860 start = end
00861 end += length
00862 if python3:
00863 val1.type = str[start:end].decode('utf-8')
00864 else:
00865 val1.type = str[start:end]
00866 start = end
00867 end += 4
00868 (val1.id,) = _struct_I.unpack(str[start:end])
00869 self.object_detection.objects.append(val1)
00870 return self
00871 except struct.error as e:
00872 raise genpy.DeserializationError(e)
00873
00874 _struct_I = genpy.struct_I
00875 _struct_3I = struct.Struct("<3I")
00876 _struct_4d = struct.Struct("<4d")
00877 _struct_3d = struct.Struct("<3d")
00878 class Detect(object):
00879 _type = 'checkerboard_detector2/Detect'
00880 _md5sum = '7d2841c5eef2578fbb718be68316c081'
00881 _request_class = DetectRequest
00882 _response_class = DetectResponse